diff --git a/.gitignore b/.gitignore
index 5be588d..77d0ff1 100644
--- a/.gitignore
+++ b/.gitignore
@@ -33,4 +33,14 @@ RCS
RCSLOG
SCCS
_$*
-/nbproject/private/
\ No newline at end of file
+/nbproject/private/
+application/views/sections/link.php
+application/config/database.php
+
+# exclude everything
+assets/cache/*
+Export/*
+
+# exception to the rule
+!assets/cache/.gitkeep
+!Export/.gitkeep
\ No newline at end of file
diff --git a/.idea/.name b/.idea/.name
new file mode 100644
index 0000000..f251219
--- /dev/null
+++ b/.idea/.name
@@ -0,0 +1 @@
+ADT
\ No newline at end of file
diff --git a/.idea/ADT.iml b/.idea/ADT.iml
new file mode 100644
index 0000000..c956989
--- /dev/null
+++ b/.idea/ADT.iml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/copyright/profiles_settings.xml b/.idea/copyright/profiles_settings.xml
new file mode 100644
index 0000000..e7bedf3
--- /dev/null
+++ b/.idea/copyright/profiles_settings.xml
@@ -0,0 +1,3 @@
+
+
+
\ No newline at end of file
diff --git a/.idea/encodings.xml b/.idea/encodings.xml
new file mode 100644
index 0000000..97626ba
--- /dev/null
+++ b/.idea/encodings.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/misc.xml b/.idea/misc.xml
new file mode 100644
index 0000000..72abef0
--- /dev/null
+++ b/.idea/misc.xml
@@ -0,0 +1,13 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/modules.xml b/.idea/modules.xml
new file mode 100644
index 0000000..b669213
--- /dev/null
+++ b/.idea/modules.xml
@@ -0,0 +1,8 @@
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/vcs.xml b/.idea/vcs.xml
new file mode 100644
index 0000000..94a25f7
--- /dev/null
+++ b/.idea/vcs.xml
@@ -0,0 +1,6 @@
+
+
+
+
+
+
\ No newline at end of file
diff --git a/.idea/workspace.xml b/.idea/workspace.xml
new file mode 100644
index 0000000..c493007
--- /dev/null
+++ b/.idea/workspace.xml
@@ -0,0 +1,206 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 1452862138192
+
+ 1452862138192
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/assets/download/Dispensing History as of 2014_11_03.pdf b/Export/.gitkeep
similarity index 100%
rename from assets/download/Dispensing History as of 2014_11_03.pdf
rename to Export/.gitkeep
diff --git a/Export/MBOONI DISTRICT HOSPITAL PATIENT MASTER LIST[09-Feb-2015 16-07-32 pm].csv b/Export/MBOONI DISTRICT HOSPITAL PATIENT MASTER LIST[09-Feb-2015 16-07-32 pm].csv
deleted file mode 100644
index 3b1c7dc..0000000
--- a/Export/MBOONI DISTRICT HOSPITAL PATIENT MASTER LIST[09-Feb-2015 16-07-32 pm].csv
+++ /dev/null
@@ -1,938 +0,0 @@
-"MEDICAL RECORD NUMBER","PATIENT NUMBER CCC","FIRST NAME","LAST NAME","OTHER NAME","DATE OF BIRTH","AGE","PATIENT CATEGORY","POB","GENDER","PREGNANT","CURRENT WEIGHT","CURRENT HEIGHT","CURRENT BSA","PHONE NUMBER","PHYSICAL ADDRESS","ALTERNATE ADDRESS","OTHER ILLNESSES","OTHER DRUGS","DRUG ALLERGIES","TB","SMOKE","ALCOHOL","DATE ENROLLED","PATIENT SOURCE","SUPPORTED BY","SERVICE","START REGIMEN","START REGIMEN DATE","CURRENT STATUS","SMS CONSENT","FAMILY PLANNING","TBPHASE","STARTPHASE","ENDPHASE","PARTNER STATUS","STATUS CHANGE DATE","DISCLOSURE","SUPPORT GROUP","CURRENT REGIMEN","NEXTAPPOINTMENT","DAYS TO NEXTAPPOINTMENT","START HEIGHT","START WEIGHT","START BSA","TRANSFER FROM","PROPHYLAXIS"
-"","12983","vaati","kelvin","syombua","2005-05-09","10","Paediatric","426","MALE","NO","23.2","118.9","0","717773187","mutitu","","","","","NO","NO","NO","2008-03-03","TRANSFER IN","GOK","ART","AZT + 3TC + NVP (< 15YRS PAED)","2009-05-09","Lost to follow-up","NO","","","","","","2013-12-12","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2013-09-13","-514","0","22","0","N/A","cotrimoxazole"
-"","2102","","","","1986-02-06","29","Adult","","MALE","NO","60","0","0","","","","","","","NO","NO","NO","2013-10-10","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-10-10","PEP end","NO","","","","","","2013-11-09","NO","","TDF + 3TC (Adult PEP Option 5)","2013-10-11","-486","0","60","0","N/A","cotrimoxazole"
-"","2130","","","","1976-01-12","40","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2013-10-27","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-10-27","PEP end","NO","","","","","","2013-11-26","NO","","TDF + 3TC (Adult PEP Option 5)","2013-10-27","-470","0","56","0","N/A","cotrimoxazole"
-"","2150","","","","1984-01-02","32","Adult","","MALE","NO","60","0","0","","","","","","","NO","NO","NO","2014-01-28","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2014-01-28","PEP end","NO","","","","","","2014-02-27","NO","","TDF + 3TC (Adult PEP Option 5)","2014-01-28","-377","0","60","0","N/A","cotrimoxazole"
-"","4705000617","josphine nthenya","","","1984-02-21 00:00:00","31","Adult","","FEMALE","NO","44","0","0","","utumoni pry sch","","","","","YES","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-02-21","Stopped due to duplication","NO","","","","","","2011-02-21","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-03-23","-1419","0","44","0","N/A","cotrimoxazole"
-"","705000276","","l","","1963-05-27 00:00:00","52","Adult","","MALE","NO","","0","0","","","","","","","NO","NO","NO","2011-05-27","TRANSFER IN","GOK","ART","OI ONLY","2011-05-27","Stopped due to duplication","NO","","","","","","2011-05-27","NO","","OI ONLY","2011-04-17","-1394","2","50","0","N/A","cotrimoxazole"
-"","1/8/2013","kilonzo","milka","","1977-05-08","38","Adult","426","FEMALE","NO","56","0","0","","mutitu","","","","","NO","NO","NO","2013-08-03","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-08-03","PEP end","NO","","","","","","2013-09-02","NO","","TDF + 3TC (Adult PEP Option 5)","2013-08-31","-527","0","56","0","N/A","cotrimoxazole"
-"","1/9/2013","mulinge","jacob","","1981-02-05","35","Adult","101","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2013-08-15","TRANSIT","GOK","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2013-08-15","PEP end","NO","","","","","","2013-09-14","NO","","TDF + 3TC + LPV/r (Adult PEP Option 6)","2013-09-12","-515","0","56","0","N/A","cotrimoxazole"
-"","10161000785","lucy","mumbe","","1982-07-12 00:00:00","33","Adult","","FEMALE","NO","51","0","0","","","","","","","NO","NO","NO","2010-07-12","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-07-12","Lost to follow-up","NO","","","","","","2011-11-10","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-08-12","-1277","0","51","0","N/A","cotrimoxazole"
-"","10202041130","florence mbula","ndunda","","1978-08-02 00:00:00","37","Adult","","FEMALE","NO","74","151","0","","","","","","","NO","NO","NO","2004-08-02","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2004-08-02","Active","NO","","","","","","2013-02-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","50","0","N/A","cotrimoxazole"
-"","10212114601","jones musyoka","ndoni","","1950-10-25 00:00:00","65","Adult","","MALE","NO","62","0","0","","","","","","","NO","NO","NO","2011-10-25","IN PATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-10-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-17","36","0","60","0","N/A","cotrimoxazole"
-"","10303080267","alice mbete","munyao","","1985-06-09 00:00:00","30","Adult","","FEMALE","NO","66","0","0","","kilima deb sch","","","","","NO","NO","NO","2011-06-09","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-06-09","Lost to follow-up","NO","","","","","","2012-05-24","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-02-24","-1081","0","44","0","N/A","cotrimoxazole"
-"","10414003961","charity waitherero","nzau","","1983-06-28 00:00:00","32","Adult","","FEMALE","NO","50","0","0","","nzeveni pri sch","","","","","NO","NO","NO","2011-06-28","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-06-28","Lost to follow-up","NO","","","","","","2011-10-26","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-07-28","-1292","0","50","0","N/A","cotrimoxazole"
-"","10501700651","josephine","ndinda","","1976-10-20","39","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2010-01-02","IN PATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2010-01-02","Lost to follow-up","NO","","","","","","2015-01-15","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-10-17","-115","0","52","0","N/A","cotrimoxazole"
-"","10516125173","mwendi","carolyne","ngina","1999-05-08","16","Adult"," ","FEMALE","NO","30","0","0","727714917","kyuu","","","",",","NO","NO","NO","2012-01-09","TRANSFER IN","","ART","AZT+3TC+NVP (>15YRS ADULT)","2013-11-11","Active","NO","","0","","","","2013-11-11","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","28","0","N/A","cotrimoxazole"
-"","1055127301","naomi","mutua","musiva","1943-05-04","73","Adult","426","FEMALE","NO","42.5","153","0","","nzeveni","","","","","NO","NO","NO","2013-02-18","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-07-30","Lost to follow-up","NO","","","","","","2014-06-16","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-03-18","-328","0","46","0","N/A","cotrimoxazole"
-"","10555127301","naum","musiva","","1947-05-05","69","Adult"," ","FEMALE","NO","42.5","0","0","","","","","",",","NO","NO","NO","2011-10-05","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2011-10-05","Active","NO","","0","","","","2013-07-02","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","44","0","N/A","cotrimoxazole"
-"","1056114634","ruth","muendo","nginah","1982-10-08","33","Adult","","FEMALE","NO","46.5","0","0","","","","","","","NO","NO","NO","2012-11-01","TRANSFER IN","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2012-11-01","Active","NO","","","","","","2013-11-20","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","49.6","0","N/A","cotrimoxazole"
-"","10702900071","ruth","mbolu","mwende","1963-05-08","53","Adult","426","FEMALE","NO","56","0","0","729835127","kitundu","","","","","NO","NO","NO","2005-05-08","TRANSIT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2005-08-24","Lost to follow-up","NO","","","","","","2013-09-29","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-07-01","-588","0","56","0","N/A","cotrimoxazole"
-"","10702901227","muteti","musyoka","","1961-06-15","54","Adult","","MALE","NO","58","0","0","","","","","","","NO","NO","NO","2009-08-07","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2009-08-07","Lost to follow-up","NO","","","","","","2013-03-07","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-07","-794","0","58","0","N/A","cotrimoxazole"
-"","10762900308","isaac","mutiso munguti","","1952-09-12 00:00:00","63","Adult","","MALE","NO","52.9","0","0","","","","","","","NO","NO","NO","2007-09-12","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2007-09-12","Active","NO","","","","","","2013-01-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","52","0","N/A","cotrimoxazole"
-"","11/9/14","kioko","ndunge","","1999-08-08","16","Adult","426","FEMALE","NO","35","0","0","","","","","","","NO","NO","NO","2014-09-10","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2014-09-10","PEP end","NO","","","","","","2014-10-10","NO","","TDF + 3TC (Adult PEP Option 5)","2014-10-08","-124","0","35","0","N/A","cotrimoxazole"
-"","1117010381","mumo","queen","mweke","1980-08-09","35","Adult","426","FEMALE","NO","58.7","0","0","713744365","kilugi","","","","","NO","NO","NO","2014-04-29","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-04-29","Lost to follow-up","NO","","","","","","2015-01-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-15","-117","0","54","0","N/A","cotrimoxazole"
-"","112508000986","muli","rosinah","","1979-06-09","36","Adult","426","FEMALE","NO","43","152","0","","","","","","","NO","NO","NO","2013-08-15","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-15","Active","NO","","","","","","2013-12-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","152","42.9","0","N/A","cotrimoxazole"
-"","11679000076","muendo","muia","","1958-02-08","58","Adult","301","MALE","NO","46.5","0","0","719432279","","","","","","NO","NO","NO","2012-05-06","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-12","Active","NO","","","","","","2013-06-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-12","3","0","49","0","N/A","cotrimoxazole"
-"","1173639","mary","mutuku","","1971-06-18 00:00:00","44","Adult","","FEMALE","NO","45","0","0","","","","","ctx/multivit","","NO","NO","NO","2007-06-18","TRANSFER IN","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2007-06-18","Lost to follow-up","NO","","","","","","2011-09-20","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-06-22","-1328","0","40","0","N/A","cotrimoxazole"
-"","1193601764","kaloko","doris","","1975-08-05","40","Adult","426","FEMALE","NO","58.5","157","0","","nzeveni","","","","","NO","NO","NO","2010-06-05","TRANSIT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2011-02-05","Lost to follow-up","NO","","","","","","2013-11-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-27","-531","157","58.5","0","N/A","cotrimoxazole"
-"","1199500340","mutheu","catherine","","1993-05-04","22","Adult","426","FEMALE","NO","48","0","0","","kithungo","","","","","NO","NO","NO","2014-01-06","TRANSIT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-06","Lost to follow-up","NO","","","","","","2014-05-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-24","-350","0","45","0","N/A","cotrimoxazole"
-"","1213133211","katulo","rosina","david","1964-04-05","52","Adult","426","FEMALE","NO","48.3","0","0","","kaliani","","","","","NO","NO","NO","2014-04-03","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-04-03","Active","NO","","","","","","2014-04-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-10","29","0","58","0","N/A","cotrimoxazole"
-"","12149000036","catherine","kanini mulwa","","1982-05-21 00:00:00","33","Adult","","FEMALE","NO","39","0","0","","","","","","","NO","NO","NO","2012-05-21","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-05-21","Lost to follow-up","NO","","","","","","2012-09-02","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-04","-980","0","39","0","N/A","cotrimoxazole"
-"","121490008","wavinya","ruth","samuel","1981-04-05","34","Adult","426","FEMALE","NO","48.6","0","0","728667736","kali","5/6/1981","","","","NO","NO","NO","2012-06-03","TRANSFER IN","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-07-17","Lost to follow-up","NO","","","","","","2014-03-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-12-05","-431","0","48","0","N/A","cotrimoxazole"
-"","12236000310","felistus wayua","kimeu","","1982-02-23 00:00:00","33","Adult","","FEMALE","NO","59","0","0","","","","","","","NO","NO","NO","2012-02-23","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-02-23","Lost to follow-up","NO","","","","","","2013-11-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-08-08","-550","0","51","0","N/A","cotrimoxazole"
-"","1245504818","muthoka","duncan","musyoki","1978-09-08","37","Adult","426","FEMALE","NO","49","0","0","700006936","kyuu","","","","","NO","NO","NO","2014-03-12","TRANSFER IN","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-08-07","NO","","OI Medicines","2014-05-09","-276","0","51","0","N/A","cotrimoxazole"
-"","12457003848","catherine","kyalo","","1978-07-07","37","Adult"," ","FEMALE","NO","48","0","0","","","","","",",","NO","NO","NO","2014-01-24","TRANSFER IN","","OI Only","OI Medicines","","Active","NO","","0","","","","2014-08-31","NO","","OI Medicines","2015-02-10","1","0","47","0","N/A","cotrimoxazole"
-"","12475001228","alex","mutuku","mumo","1982-01-04","34","Adult","","MALE","NO","61.4","0","0","","","","","","","NO","NO","NO","2014-01-29","TRANSFER IN","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-01-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-24","43","0","57","0","N/A","cotrimoxazole"
-"","1247501388","naumi","ndinda","","1977-05-06","38","Adult","421","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2014-01-27","TRANSFER IN","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2014-11-13","NO","","OI Medicines","2015-02-05","-4","0","52","0","N/A","cotrimoxazole"
-"","125000869","peter sikuku","kimihu","","1960-12-20 00:00:00","55","Adult","","MALE","NO","43","0","0","","","","","","","NO","NO","NO","2011-12-20","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-02","NO","","OI ONLY","2012-01-03","-1133","0","43","0","N/A","cotrimoxazole"
-"","12508000001PEP","w","","","1972-12-26 00:00:00","43","Adult","","MALE","NO","70","180","0","","","","","","","NO","NO","NO","2011-12-26","OUTPATIENT","GOK","PEP","PA3A(TDF300MG+3TC150MG)","2011-12-26","PEP end","NO","","","","","","2012-01-25","NO","","PA3A(TDF300MG+3TC150MG)","2012-01-23","-1113","180","70","0","N/A","cotrimoxazole"
-"","12508000002PEP","K","","","1976-03-29 00:00:00","39","Adult","","MALE","NO","70","0","0","","","","","","","NO","NO","NO","2011-03-29","OUTPATIENT","GOK","ART","PA1A(AZT 300mg + 3TC 150mg)","2011-03-29","PEP end","NO","","","","","","2011-04-28","NO","","PA1A(AZT 300mg + 3TC 150mg)","2011-04-26","-1385","0","70","0","N/A","cotrimoxazole"
-"","12508000093","eunice","kamanthe","","1978-01-03","38","Adult","","FEMALE","NO","54.5","0","0","","","","","","","NO","NO","NO","2014-03-07","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-03-07","Lost to follow-up","NO","","","","","","2014-07-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-05-02","-283","0","54.5","0","N/A","cotrimoxazole"
-"","12508000095","ndinda","mary","","1982-01-08","34","Adult","426","FEMALE","NO","50","167","0","","","","","","","NO","NO","NO","2014-07-31","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-31","Active","NO","","","","","","2014-07-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-15","-25","167","50","0","N/A","cotrimoxazole"
-"","125080001004","jacson","wambua","","2009-05-06","6","Paediatric","421","MALE","NO","12.5","0","0","","","","","","","NO","NO","NO","2013-01-14","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2013-01-14","Lost to follow-up","NO","","","","","","2014-01-22","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2013-10-24","-473","0","12.4","0","N/A","cotrimoxazole"
-"","125080001014","frorence","ngusye","","1971-05-12","44","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-05-15","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-05-15","Lost to follow-up","NO","","","","","","2014-02-10","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-12","-454","0","47","0","N/A","cotrimoxazole"
-"","125080001015","samson","kyama","","1973-10-11","42","Adult","","MALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-12-05","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-05","Lost to follow-up","NO","","","","","","2013-11-21","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-23","-535","0","50","0","N/A","cotrimoxazole"
-"","125080001016","eunice","mueni","","1985-04-10","30","Adult","","FEMALE","NO","47.5","0","0","","","","","","","NO","NO","NO","2012-10-05","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-05","Lost to follow-up","NO","","","","","","2013-10-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-07-19","-570","0","47.5","0","N/A","cotrimoxazole"
-"","125080001020","stephen","muli","","1977-01-05","39","Adult","422","MALE","NO","61.4","0","0","","","","","","","NO","NO","NO","2013-05-29","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-05-29","Lost to follow-up","NO","","","","","","2014-02-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-26","-440","0","53","0","N/A","cotrimoxazole"
-"","125080001027","dorcus","mwikali","","1970-05-06","45","Adult","","FEMALE","NO","52.6","0","0","","","","","","","NO","NO","NO","2012-12-02","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-12-02","Lost to follow-up","NO","","","","","","2014-03-12","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-12-12","-424","0","50","0","N/A","cotrimoxazole"
-"","125080001029","mambo","percy","","1971-05-05","44","Adult","426","FEMALE","NO","51","0","0","","","","","","","NO","NO","NO","2013-05-29","OUTPATIENT","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2013-05-29","Lost to follow-up","NO","","","","","","2013-11-18","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2013-08-20","-538","0","52","0","N/A","cotrimoxazole"
-"","125080001030","mueni","esther","","1977-01-05","39","Adult","424","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2013-05-29","OUTPATIENT","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2013-05-29","Lost to follow-up","NO","","","","","","2014-07-31","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-05-02","-283","0","46","0","N/A","cotrimoxazole"
-"","125080001032","eunice","ndunge","","1973-05-12","42","Adult","426","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2013-02-05","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-02-05","Lost to follow-up","NO","","","","","","2013-12-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-17","-510","0","42","0","N/A","cotrimoxazole"
-"","125080001035","winifred","mwongeli","","1987-10-05","28","Adult","426","FEMALE","NO","50.8","0","0","703136632","wizeni","","","","","YES","NO","NO","2013-05-24","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-02-10","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-12","-454","0","49","0","N/A","cotrimoxazole"
-"","125080001037","mary","mwikali","","1972-02-06","44","Adult","426","FEMALE","NO","41","153","0","705825330","utagwa","728959292","pyschosis","cpz 100mg","","NO","NO","NO","2013-01-05","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-05-25","Lost to follow-up","NO","","","","","","2013-12-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-12","-515","0","35","0","N/A","cotrimoxazole"
-"","125080001039","john","kioko","","1975-05-02","40","Adult","","MALE","NO","54.5","0","0","","","","","","","NO","NO","NO","2012-05-20","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2013-12-29","NO","","OI Medicines","2013-09-30","-497","0","53.5","0","N/A","cotrimoxazole"
-"","125080001040","muthoka","jennifer","","2010-05-05","5","Paediatric","426","MALE","NO","11","0","0","","kitundu","","","","","NO","NO","NO","2013-05-24","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-04","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2014-03-06","-340","0","9.5","0","N/A","cotrimoxazole"
-"","125080001041","onesmus","maingi","","1969-05-12","46","Adult","","MALE","NO","59.2","0","0","","","","","","","NO","NO","NO","2012-12-05","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2013-06-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-19","-52","0","61","0","N/A","cotrimoxazole"
-"","125080001042","ivony","muthina","","2012-07-07","3","Paediatric","","FEMALE","NO","6","0","0","","","","","","","NO","NO","NO","2012-12-09","OUTPATIENT","GOK","ART","ABC + 3TC + LPV/r (< 15YRS PAED)","2012-12-09","Lost to follow-up","NO","","","","","","2013-10-21","NO","","ABC + 3TC + LPV/r (< 15YRS PAED)","2013-07-23","-566","0","6","0","N/A","cotrimoxazole"
-"","125080001043","","","","1984-04-01","31","Adult","","FEMALE","NO","64","0","0","","","","","","","NO","NO","NO","2013-04-13","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-04-13","Lost to follow-up","NO","","","","","","2013-11-06","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-08","-550","0","60","0","N/A","cotrimoxazole"
-"","125080001045","purity","kioko","","2007-05-06","8","Paediatric","","FEMALE","NO","15.5","0","0","","","","","","","NO","NO","NO","2012-12-20","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2012-12-20","Lost to follow-up","NO","","","","","","2014-02-12","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2013-11-14","-452","0","16.3","0","N/A","cotrimoxazole"
-"","125080001048","kioko","mutheu","","1978-05-06","37","Adult","","FEMALE","NO","60.5","0","0","","","","","","","NO","NO","NO","2012-11-12","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-11-12","Lost to follow-up","NO","","","","","","2014-02-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-11-21","-445","0","59","0","N/A","cotrimoxazole"
-"","125080001049","muteti","sera","","2010-11-05","4","Paediatric","","MALE","NO","15","0","0","","","","","","","NO","NO","NO","2012-04-04","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2012-04-04","Active","NO","","","","","","2014-02-12","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-15","-25","0","12.7","0","N/A","cotrimoxazole"
-"","125080001054","domitila","kavindu","","1971-12-05","44","Adult","","FEMALE","NO","43","0","0","","","","","","","NO","NO","NO","2012-02-05","OUTPATIENT","GOK","OI Only","OI Medicines","","Stopped due to duplication","NO","","","","","","2013-07-23","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-10","-487","0","44","0","N/A","cotrimoxazole"
-"","125080001057","agnes","kavuu","","1983-06-05","32","Adult","","FEMALE","NO","52.8","0","0","","","","","","","NO","NO","NO","2013-02-15","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2013-07-23","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-12","-89","0","53","0","N/A","cotrimoxazole"
-"","125080001060","musyoka","mathew","","1981-05-15","34","Adult","","MALE","NO","60","0","0","","","","","","","NO","NO","NO","0201-05-04","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","0201-05-04","Active","NO","","","","","","2014-02-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-29","-11","0","52.5","0","N/A","cotrimoxazole"
-"","125080001071","mbeneka","joyce","","1978-05-06","37","Adult","425","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2013-05-14","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-03-05","-341","0","35","0","N/A","cotrimoxazole"
-"","125080001073","mbithe","nzyoki","","1986-09-10","29","Adult","426","FEMALE","NO","41.8","0","0","","","","","","","NO","NO","NO","2013-08-09","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-04-28","NO","","OI Medicines","2014-01-28","-377","0","46","0","N/A","cotrimoxazole"
-"","125080001089","kioko","john","","1970-05-12","45","Adult","","MALE","NO","54.3","0","0","","","","","","","NO","NO","NO","2013-05-21","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-02-27","NO","","OI Medicines","2013-11-29","-437","0","54.3","0","N/A","cotrimoxazole"
-"","12508000764","peter","muendo","","1976-04-11","39","Adult","","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2012-12-11","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-11","Lost to follow-up","NO","","","","","","2013-12-05","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-09-06","-521","0","55","0","N/A","cotrimoxazole"
-"","12508000820","serah","syokau","","1949-12-05","66","Adult","","FEMALE","NO","38","0","0","","","","","","","NO","NO","NO","2012-05-14","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-05-14","Lost to follow-up","NO","","","","","","2014-04-23","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-23","-382","0","40","0","N/A","cotrimoxazole"
-"","12508000834","maria","kaveke ndolo","","1967-01-16 00:00:00","49","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-01-16","OUTPATIENT","GOK","ART","OI ONLY","2012-01-16","Stopped due to duplication","NO","","","","","","2012-01-16","NO","","OI ONLY","2012-02-16","-1089","0","50","0","N/A","cotrimoxazole"
-"","12508000843","mueni","musyoka","","1985-11-11","30","Adult","426","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2011-11-29","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2011-11-29","Active","NO","","","","","","2013-06-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-07","57","0","47","0","N/A","cotrimoxazole"
-"","12508000845","dorcus","mbithe wambua","","1967-05-04 00:00:00","48","Adult","","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2012-05-04","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-05-04","Lost to follow-up","NO","","","","","","2014-09-08","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-06-10","-244","0","63","0","N/A","cotrimoxazole"
-"","12508000864","josphine","mbula mutuku","","1978-12-05 00:00:00","37","Adult","","FEMALE","NO","45","0","0","","","","","","","NO","NO","NO","2011-12-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-08","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-07-10","-944","0","44","0","N/A","cotrimoxazole"
-"","12508000865","benjamin","mutunga","","2008-12-05 00:00:00","6","Paediatric","","MALE","NO","15","97.8","0","","","","","","","NO","NO","NO","2011-12-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-05-21","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2014-02-20","-354","0","7","0","N/A","cotrimoxazole"
-"","12508000866","john kioko","mateli","","1971-11-24 00:00:00","44","Adult","","MALE","NO","54.9","0","0","","","","","","","NO","NO","NO","2011-11-24","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-01-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-23","-839","0","52","0","N/A","cotrimoxazole"
-"","12508000867","nelson nzioka","kavoi","","1968-12-06 00:00:00","47","Adult","","MALE","NO","63.2","0","0","","","","","","","NO","NO","NO","2011-12-06","IN PATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-12-06","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","55","0","N/A","cotrimoxazole"
-"","12508000868","justus mwendwa","ndeto","","1971-04-08 00:00:00","44","Adult","","MALE","NO","48","0","0","","","","","","","YES","NO","NO","2011-04-08","IN PATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-04-08","Lost to follow-up","NO","","","","","","2012-03-22","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-12-23","-1144","0","48","0","N/A","cotrimoxazole"
-"","12508000869","peter","sikuku kimilu","","1951-12-29 00:00:00","64","Adult","","MALE","NO","43","0","0","","","","","","","NO","NO","NO","2011-12-29","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-12-29","NO","","OI ONLY","2012-01-13","-1123","0","43","0","N/A","cotrimoxazole"
-"","12508000870","stephen mbeva","masika","","1969-12-09 00:00:00","46","Adult","","MALE","NO","53.4","0","0","","","","","","","NO","NO","NO","2011-12-09","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-12-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-07","57","0","37","0","N/A","cotrimoxazole"
-"","12508000871","maurice mutune","","","1966-01-20 00:00:00","50","Adult","","MALE","NO","78","0","0","","","","","","","NO","NO","NO","2012-01-20","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-01-20","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-24","43","0","64","0","N/A","cotrimoxazole"
-"","12508000873","muema","jackline","","1993-05-08","22","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2011-12-15","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-14","Lost to follow-up","NO","","","","","","2014-05-15","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-02-14","-360","0","56","0","N/A","cotrimoxazole"
-"","12508000874","christine wambua","","","1980-12-20 00:00:00","35","Adult","","FEMALE","NO","31","0","0","","","","","","","NO","NO","NO","2011-12-20","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-02","NO","","OI ONLY","2012-01-03","-1133","0","31","0","N/A","cotrimoxazole"
-"","12508000875","william","kiio syewa","","1946-12-16 00:00:00","69","Adult","","MALE","NO","54","0","0","","","","","","","NO","NO","NO","2011-12-16","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-12-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","68","0","N/A","cotrimoxazole"
-"","12508000876","eunice ndumi","","","1967-02-21 00:00:00","49","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2012-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2012-02-21","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-28","-12","0","45","0","N/A","cotrimoxazole"
-"","12508000877","theresiah kavindu","mbuni","","1964-12-20 00:00:00","51","Adult","","FEMALE","NO","37.7","0","0","","","","","","","NO","NO","NO","2011-12-20","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-20","Active","NO","","","","","","2012-12-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-24","15","0","35","0","N/A","cotrimoxazole"
-"","12508000878","musembi","musau ndolo","","1965-12-20 00:00:00","50","Adult","","MALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-12-20","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-10-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-07-30","-559","0","44","0","N/A","cotrimoxazole"
-"","12508000879","mueni","john nyamai","","1972-01-29 00:00:00","44","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-01-29","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-11","-881","0","48","0","N/A","cotrimoxazole"
-"","12508000880","","","","1974-01-01","42","Adult","","FEMALE","NO","48.8","0","0","","","","","","","NO","NO","NO","2013-09-12","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-12","Lost to follow-up","NO","","","","","","2014-01-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-10","-487","0","48.8","0","N/A","cotrimoxazole"
-"","12508000882","agnes","mwongeli munywoki","","1980-01-03 00:00:00","36","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2012-01-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-19","NO","","OI ONLY","2012-01-20","-1116","0","46","0","N/A","cotrimoxazole"
-"","12508000883","mulwa mbithi","ndivo","","1982-01-03 00:00:00","34","Adult","","MALE","NO","55.5","0","0","","","","","","","NO","NO","NO","2012-01-03","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-01-03","Lost to follow-up","NO","","","","","","2012-12-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-28","-864","0","48","0","N/A","cotrimoxazole"
-"","12508000885","bonface","mwanzia kimeu","","1983-01-01 00:00:00","33","Adult","","MALE","NO","53","0","0","","","","","","","NO","NO","NO","2012-01-01","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-01-01","Deceased","NO","","","","","","2012-01-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-02-17","-1088","0","53","0","N/A","cotrimoxazole"
-"","12508000887","theresia ndungwa","kioko","","1974-01-24 00:00:00","42","Adult","","FEMALE","NO","54.7","0","0","","","","","","","NO","NO","NO","2012-01-24","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-03-03","NO","","OI Medicines","2013-12-03","-433","0","53","0","N/A","cotrimoxazole"
-"","12508000888","nduku","susan","malula","1974-08-06","41","Adult","426","FEMALE","NO","46.8","140","0","7","","","","","","NO","NO","NO","2013-04-12","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-07-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","140","58","0","N/A","cotrimoxazole"
-"","12508000889","wambua muendo","kimeu","","1997-01-24 00:00:00","18","Adult"," ","MALE","NO","32.7","0","0","","","","","",",","NO","NO","NO","2012-01-24","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-19","Active","NO","","0","","","","2013-02-07","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-23","-17","0","28","0","N/A","cotrimoxazole"
-"","12508000890","maundu","sammy","","2011-01-09 00:00:00","4","Paediatric","","MALE","NO","11.3","0","0","","","","","","","NO","NO","NO","2012-01-09","","GOK","ART","CF2A(ABC + 3TC + NVP )","2012-01-09","Active","NO","","","","","","2012-12-06","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","0","6.9","0","N/A","cotrimoxazole"
-"","12508000892","maria","kaveke ndolo","","1967-01-16 00:00:00","49","Adult","","FEMALE","NO","41","0","0","","37","","","","","NO","NO","NO","2012-01-16","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-12","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-08-14","-909","0","37","0","N/A","cotrimoxazole"
-"","12508000893","theresia","ndinda mbuvi","","1987-01-10 00:00:00","28","Adult","","FEMALE","NO","47","0","0","","","","","","","NO","NO","NO","2012-01-10","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-01-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","53","0","N/A","cotrimoxazole"
-"","12508000894","jane","muthoki mwewa","","1984-01-14 00:00:00","32","Adult","","FEMALE","NO","41","0","0","","","","","","","NO","NO","NO","2012-01-14","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-02-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-11-07","-824","0","36","0","N/A","cotrimoxazole"
-"","12508000895","jackson","mwanzia mulinge","","1985-01-31 00:00:00","30","Adult","","MALE","NO","27","0","0","","","","","","","NO","NO","NO","2012-01-31","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-05-17","NO","","OI ONLY","2012-02-17","-1088","0","47","0","N/A","cotrimoxazole"
-"","12508000896","esther","mwikali muendo","","1981-01-10 00:00:00","35","Adult","","FEMALE","NO","52.5","0","0","","","","","","","NO","NO","NO","2012-01-10","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-01-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-25","16","0","39","0","N/A","cotrimoxazole"
-"","12508000897","samson ochieng","muma","","1983-02-06 00:00:00","32","Adult","","MALE","NO","63","160","0","","","","","","","NO","NO","NO","2012-02-06","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-02-06","Lost to follow-up","NO","","","","","","2013-11-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-06","-552","0","53","0","N/A","cotrimoxazole"
-"","12508000898","angelina kalondu","","","1967-02-06 00:00:00","49","Adult","","FEMALE","NO","41","0","0","","","","","","","NO","NO","NO","2012-02-06","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-01","NO","","OI ONLY","2012-07-03","-951","0","45","0","N/A","cotrimoxazole"
-"","12508000899","johnson keli","kimuyu","","2010-02-23 00:00:00","5","Paediatric","","MALE","NO","15","0","0","","","","","","","NO","NO","NO","2012-02-23","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-02-23","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-01-08","-32","0","10.5","0","N/A","cotrimoxazole"
-"","12508000900","mwanzia","ngathuki kamumbu","","1967-01-31 00:00:00","49","Adult","","MALE","NO","59","0","0","","","","","","","NO","NO","NO","2012-01-31","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-01-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","53","0","N/A","cotrimoxazole"
-"","12508000901","bonface musyoki","","","1982-02-21 00:00:00","33","Adult","","MALE","NO","37.5","0","0","","","","","","","NO","NO","NO","2012-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2012-02-21","NO","","OI Medicines","2015-01-29","-11","0","28","0","N/A","cotrimoxazole"
-"","12508000903","redemta mbithe","mbithi","","2011-02-14 00:00:00","4","Paediatric","","FEMALE","NO","14.2","65.6","0","","","","","","","NO","NO","NO","2012-02-14","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2012-02-14","Active","NO","","","","","","2012-12-10","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-22","-18","65.6","7.5","0","N/A","cotrimoxazole"
-"","12508000905","josephine kavindu","","","1960-02-23 00:00:00","56","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2012-02-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2012-09-25","-867","0","39","0","N/A","cotrimoxazole"
-"","12508000906","carol","nthambi mwinzi","","1986-02-22 00:00:00","29","Adult","","FEMALE","NO","52.5","0","0","","","","","","","NO","NO","NO","2012-02-22","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-03-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-12-25","-411","0","49","0","N/A","cotrimoxazole"
-"","12508000907","bonface","mwinzi kivesi","","1970-02-22 00:00:00","46","Adult","","MALE","NO","57","0","0","","","","","","","NO","NO","NO","2012-02-22","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-07-21","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-04-22","-293","0","49","0","N/A","cotrimoxazole"
-"","12508000908","dorcas","mueni mutie","","1975-02-23 00:00:00","41","Adult","","FEMALE","NO","58","0","0","","","","","","","NO","NO","NO","2012-02-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-07-27","NO","","OI Medicines","2014-04-28","-287","0","54","0","N/A","cotrimoxazole"
-"","12508000910","faith wayua","wambua","","1991-03-09 00:00:00","24","Adult","","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2012-03-09","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-05","NO","","OI Medicines","2012-08-07","-916","0","36","0","N/A","cotrimoxazole"
-"","12508000911","elizabeth mbatha","","","1966-03-21 00:00:00","50","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2012-03-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-06","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-09-07","-885","0","50","0","N/A","cotrimoxazole"
-"","12508000912","joyce","mumbua musyoka","","1974-07-03 00:00:00","41","Adult","","FEMALE","NO","60","0","0","","728069412","","","","","NO","NO","NO","2012-07-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-08-28","-895","0","60","0","N/A","cotrimoxazole"
-"","12508000913","eunice","kamanthe maingi","","1976-05-21 00:00:00","39","Adult","","FEMALE","NO","56.5","0","0","","","","","","","NO","NO","NO","2012-05-21","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-05-21","Active","NO","","","","","","2013-02-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","0","42","0","N/A","cotrimoxazole"
-"","12508000914","kambua mututa","","","1980-03-21 00:00:00","35","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2012-03-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-03-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-03","-6","0","40","0","N/A","cotrimoxazole"
-"","12508000916","harnington","mwanza wambua","","1970-04-05 00:00:00","46","Adult","","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2012-04-05","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-04-05","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-04","-5","0","50","0","N/A","cotrimoxazole"
-"","12508000917","florence","nduku mwanza","","1977-04-05 00:00:00","38","Adult","","FEMALE","NO","23","0","0","","","","","","","NO","NO","NO","2012-04-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-08","NO","","OI ONLY","2012-08-10","-913","0","23","0","N/A","cotrimoxazole"
-"","12508000918","mirium","","mwikali","1972-03-21 00:00:00","44","Adult","","FEMALE","NO","53.5","159","0","","","","","","","NO","NO","NO","2012-03-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-03-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","40","0","N/A","cotrimoxazole"
-"","12508000919","jonathan","mutune","","1972-03-21 00:00:00","44","Adult","","MALE","NO","47.8","0","0","","","","","","","NO","NO","NO","2012-03-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-03-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-25","44","0","40","0","N/A","cotrimoxazole"
-"","12508000920","dickson muendo","","","1972-03-21 00:00:00","44","Adult","","MALE","NO","55","158","0","","","","","","","NO","NO","NO","2012-03-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-03-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","40","0","N/A","cotrimoxazole"
-"","12508000921","joel kiamba kimuyu","kimuyu","","1975-04-05 00:00:00","40","Adult","","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2012-04-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-01-07","NO","","OI Medicines","2012-10-09","-853","0","53","0","N/A","cotrimoxazole"
-"","12508000922","ruth nduku","nzyoki","","1981-03-26 00:00:00","34","Adult","","FEMALE","NO","40","0","0","","","","","","","NO","NO","NO","2012-03-26","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-20","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-08-22","-901","0","40","0","N/A","cotrimoxazole"
-"","12508000923","anastacia","kasisi david","","1973-04-05 00:00:00","42","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2012-04-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2012-04-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","43","0","N/A","cotrimoxazole"
-"","12508000924","helen","nduku","","1984-06-19 00:00:00","31","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2012-06-19","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-19","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","42","0","N/A","cotrimoxazole"
-"","12508000925","JOHN","KYALO MUTUA","","1968-04-11 00:00:00","48","Adult","","MALE","NO","61.7","0","0","","KYANGOMA PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2012-04-11","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2012-04-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","46.5","0","N/A","cotrimoxazole"
-"","12508000927","catherine muthina","","","1974-05-01 00:00:00","41","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-05-01","OUTPATIENT","GOK","ART","OI ONLY","2012-05-01","Lost to follow-up","NO","","","","","","2012-09-24","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-26","-958","0","50","0","N/A","cotrimoxazole"
-"","12508000928","afonce nyanzi","","","1963-05-01 00:00:00","53","Adult","","MALE","NO","53","0","0","","","","","","","NO","NO","NO","2012-05-01","OUTPATIENT","GOK","ART","OI ONLY","2012-05-01","Lost to follow-up","NO","","","","","","2013-11-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-23","-535","0","50","0","N/A","cotrimoxazole"
-"","12508000930","jacline m malila","","","1984-05-01 00:00:00","31","Adult","","FEMALE","NO","40","0","0","","","","","","","NO","NO","NO","2012-05-01","TRANSFER IN","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-08-27","NO","","OI ONLY","2012-05-29","-986","0","40","0","N/A","cotrimoxazole"
-"","12508000931","","muthina","justina","1980-01-12","36","Adult","","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2012-04-25","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-01-25","Active","NO","","","","","","2014-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","48.5","0","N/A","cotrimoxazole"
-"","12508000932","nthenya","caro","kioko","1981-08-09","34","Adult","426","FEMALE","NO","56","0","0","7","nthungoni","","","","","NO","NO","NO","2013-04-04","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-05-08","Active","NO","","","","","","2014-04-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","56","0","N/A","cotrimoxazole"
-"","12508000933","faith","mwikali peter","","1987-05-22 00:00:00","28","Adult","","FEMALE","NO","49","0","0","","700747813","","","","","NO","NO","NO","2012-05-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-05-22","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-23","-48","0","38","0","N/A","cotrimoxazole"
-"","12508000934","eunice","muthina maitya","","1977-05-22 00:00:00","38","Adult","","FEMALE","NO","56.1","0","0","","","","","","","NO","NO","NO","2012-05-22","OUTPATIENT","GOK","ART","OI ONLY","2012-05-22","Active","NO","","","","","","2012-11-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","53.5","0","N/A","cotrimoxazole"
-"","12508000935","david","kata kaindi","","1992-05-22 00:00:00","23","Adult","","MALE","NO","67","175","0","","739605456","","","","","NO","NO","NO","2012-05-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-05-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","56","0","N/A","cotrimoxazole"
-"","12508000936","esther","kanini mwangangi","","1969-05-23 00:00:00","46","Adult","","FEMALE","NO","47","0","0","","","","","","","NO","NO","NO","2012-05-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-01","NO","","OI ONLY","2012-07-03","-951","0","42","0","N/A","cotrimoxazole"
-"","12508000939","purity","nthenya nzioki","","1984-07-16 00:00:00","31","Adult","","FEMALE","NO","53.3","0","0","","","","","","","NO","NO","NO","2012-07-16","","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-07-16","Lost to follow-up","NO","","","","","","2013-01-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-12","-850","0","54","0","N/A","cotrimoxazole"
-"","12508000940","grace","matheka","mukulu","1956-02-20","60","Adult","426","FEMALE","NO","57","0","0","","","","","","","NO","NO","NO","2012-07-24","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-07-24","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","53","0","N/A","cotrimoxazole"
-"","12508000941","bonface","mbaluka","","1979-06-19 00:00:00","36","Adult","","MALE","NO","62","0","0","","","","","","","NO","NO","NO","2012-06-19","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-19","Lost to follow-up","NO","","","","","","2012-12-10","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-09-11","-881","0","62","0","N/A","cotrimoxazole"
-"","12508000944","ruth","peter","nthuka","1992-05-08","23","Adult","426","FEMALE","NO","47","0","0","701072033","nzeveni","","","","","NO","NO","NO","2012-06-06","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-20","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-03-22","-324","0","44","0","N/A","cotrimoxazole"
-"","12508000945","stephen","amenya mutunga","","1997-06-12 00:00:00","18","Adult","","MALE","NO","37.4","153","0","","","","","","","NO","NO","NO","2012-06-12","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-21","-871","0","31.5","0","N/A","cotrimoxazole"
-"","12508000946","mbithe","eunice","","1993-06-07","22","Adult","426","FEMALE","NO","47","0","0","","uvuu","","","","","NO","NO","NO","2014-06-02","pmtct","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-06-02","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-17","8","0","48","0","N/A","cotrimoxazole"
-"","12508000947","tophyias","mwanzia ndunge","","2010-06-15 00:00:00","5","Paediatric","","MALE","NO","10.04","0","0","","","","","","","NO","NO","NO","2012-06-15","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-01-03","NO","","OI Medicines","2012-10-05","-857","0","10","0","N/A","cotrimoxazole"
-"","12508000948","margaret","ndunge kyalo","","1975-06-19 00:00:00","40","Adult","","FEMALE","NO","50.5","0","0","","","","","","","NO","NO","NO","2012-06-19","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-06-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","47","0","N/A","cotrimoxazole"
-"","12508000949","kyalo","daniel kimeu","","1974-06-19 00:00:00","41","Adult","","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2012-06-19","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-06-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","56","0","N/A","cotrimoxazole"
-"","12508000950","gladys","mbolu","munyiva","1974-04-13","41","Adult"," ","FEMALE","NO","48","0","0","","","","","",",","NO","NO","NO","2010-04-14","OUTPATIENT","","ART","TDF + 3TC + NVP (>15YRS ADULT)","2010-04-14","Active","NO","","0","","","","2013-02-12","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","47","0","N/A","cotrimoxazole"
-"","12508000952","josephine","mutindi","","1972-10-10","43","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-08-06","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-08-06","Lost to follow-up","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-18","-874","0","50","0","N/A","cotrimoxazole"
-"","12508000954","paul","katunga","nthele","1977-07-17 00:00:00","38","Adult","","MALE","NO","43.2","158","0","","731909572","","","","","NO","NO","NO","2012-07-17","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-07-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","46","0","N/A","cotrimoxazole"
-"","12508000957","musyoki","nduku","","2004-05-05","11","Paediatric","426","MALE","NO","23","0","0","","","","","","","NO","NO","NO","2012-07-20","OUTPATIENT","GOK","ART","AZT + 3TC + NVP (< 15YRS PAED)","2012-07-20","Active","NO","","","","","","2013-06-21","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-05","-4","0","18.5","0","N/A","cotrimoxazole"
-"","12508000958","nduku","janet","kioko","1985-08-08","30","Adult","426","FEMALE","NO","48","0","0","","kyuu","","","","","NO","NO","NO","2012-07-23","OUTPATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2013-08-27","Lost to follow-up","NO","","","","","","2014-10-26","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-07-28","-196","0","53","0","N/A","cotrimoxazole"
-"","12508000959","mary","","meli","1999-02-02","16","Adult","426","FEMALE","NO","39","132","0","","","","","","","NO","NO","NO","2012-07-24","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2012-07-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-13","-27","132","31.5","0","N/A","cotrimoxazole"
-"","12508000959m","mary","meli","","1999-12-05","15","Adult","","FEMALE","NO","32.8","0","0","","","","","","","NO","NO","NO","2010-05-14","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2010-05-14","Lost to follow-up","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-12-14","-787","0","32.8","0","N/A","cotrimoxazole"
-"","12508000962","nzuu","nthenya","","2004-08-10","11","Paediatric","102","MALE","NO","22","112","0","","","","","","","NO","NO","NO","2012-08-14","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2012-08-14","NO","","ABC + 3TC + EFV (< 15YRS PAED)","2015-01-15","-25","112","17.5","0","N/A","cotrimoxazole"
-"","12508000963","mutanu","regina","kyama","1976-05-12","39","Adult","426","FEMALE","NO","45","0","0","","","","","","","NO","NO","NO","2012-02-08","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-02-08","Active","NO","","","","","","2013-06-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","43.8","0","N/A","cotrimoxazole"
-"","12508000965","peninah","wambua","","1975-10-10","40","Adult","206","FEMALE","NO","28","0","0","","","","","","","NO","NO","NO","2012-08-06","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-12-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-09-23","-139","0","35.5","0","N/A","cotrimoxazole"
-"","12508000966","nyamasyo","esther","mueni","1980-05-01","35","Adult","426","FEMALE","NO","49.5","0","0","","","","","","","NO","NO","NO","2012-08-14","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2012-12-24","NO","","OI Medicines","2012-09-25","-867","0","52","0","N/A","cotrimoxazole"
-"","12508000967","rose","daniel","mukii","1971-08-09","44","Adult","426","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2012-06-05","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-06-07","Active","NO","","","","","","2013-06-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-17","36","0","56","0","N/A","cotrimoxazole"
-"","12508000968","miriam","mutua","","1962-06-16","53","Adult","","FEMALE","NO","56.7","0","0","","","","","","","NO","NO","NO","2012-08-17","OUTPATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2012-08-17","Active","NO","","","","","","2013-03-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-08","58","0","50","0","N/A","cotrimoxazole"
-"","12508000969","ndwiwa","musembi","","2009-05-11","6","Paediatric","","MALE","NO","17.7","0","0","","","","","","","NO","NO","NO","2012-11-06","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2012-11-06","Lost to follow-up","NO","","","","","","2014-12-24","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2014-09-25","-137","0","15.8","0","N/A","cotrimoxazole"
-"","12508000972","eunice","mwongeli","","1986-05-06","29","Adult","","FEMALE","NO","49","0","0","","","","","","","NO","NO","NO","2012-05-06","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-05-06","Active","NO","","","","","","2014-07-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-06","-3","0","50","0","N/A","cotrimoxazole"
-"","12508000974","regina","mumbua","","1983-02-02","32","Adult","","FEMALE","NO","65.5","0","0","","","","","","","NO","NO","NO","2012-08-30","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2012-12-12","NO","","OI Medicines","2012-09-13","-879","0","65.5","0","N/A","cotrimoxazole"
-"","12508000977","miriam","ndanu","","2011-03-16","4","Paediatric"," ","FEMALE","NO","10.4","0","0","","","","","",",","NO","NO","NO","2012-01-09","OUTPATIENT","","ART","ABC + 3TC + LPV/r (>15YRS ADULT)","2012-01-09","Lost to follow-up","NO","","0","","","","2013-10-26","NO","","ABC + 3TC + LPV/r (>15YRS ADULT)","2013-07-28","-561","0","10.4","0","N/A","cotrimoxazole"
-"","12508000980","moses","mulee","","1981-06-15","34","Adult","","MALE","NO","48","163","0","","","","","","","NO","NO","NO","2012-09-24","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2012-10-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-06","-3","0","49.5","0","N/A","cotrimoxazole"
-"","12508000981","rose","munini","","1965-05-03","50","Adult","","FEMALE","NO","71.6","158","0","","","","","","","NO","NO","NO","2012-08-10","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-08-10","Active","NO","","","","","","2013-07-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","64.5","0","N/A","cotrimoxazole"
-"","12508000982","eunice","wanza","","1974-06-15","41","Adult","","FEMALE","NO","80","0","0","","","","","","","NO","NO","NO","2012-10-08","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2012-10-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-25","16","0","76","0","N/A","cotrimoxazole"
-"","12508000983","philys","mbenya","","1973-06-15","42","Adult","","FEMALE","NO","40.5","0","0","","","","","","","NO","NO","NO","2012-10-09","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2012-10-25","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","41","0","N/A","cotrimoxazole"
-"","12508000984","musau","mumo","","2012-10-09","2","Paediatric","","MALE","NO","13","0","0","","","","","","","NO","NO","NO","2012-10-09","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2012-10-25","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-15","-25","0","9","0","N/A","cotrimoxazole"
-"","12508000985","","","","1985-01-01","31","Adult","","FEMALE","NO","49.8","0","0","","","","","","","NO","NO","NO","2013-09-13","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2013-12-26","NO","","OI Medicines","2013-09-27","-500","0","49.8","0","N/A","cotrimoxazole"
-"","12508000986","rosina","ndunge","","1979-06-15","36","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2012-10-11","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2012-10-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-11-27","-74","0","47.5","0","N/A","cotrimoxazole"
-"","12508000987","ndunge","magrate","","1976-05-08","39","Adult","426","FEMALE","NO","45.5","0","0","712831085","","","","","","NO","NO","NO","2012-02-13","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-06-18","Active","NO","","","","","","2013-06-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","45","0","N/A","cotrimoxazole"
-"","12508000988","evans","muli","","1974-06-15","41","Adult","","MALE","NO","61","0","0","","","","","","","NO","NO","NO","2012-10-16","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2012-10-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-05","-4","0","60","0","N/A","cotrimoxazole"
-"","12508000990","josphine","luki","","1976-04-05","39","Adult","","FEMALE","NO","57","154","0","","","","","","","NO","NO","NO","2012-10-02","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-02","Active","NO","","","","","","2013-06-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-03","22","0","43","0","N/A","cotrimoxazole"
-"","12508000992","mutile","regina","","1983-05-12","32","Adult","426","FEMALE","NO","55.2","0","0","","kikima","","","","","NO","NO","NO","2014-06-02","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-06-02","Active","NO","","","","","","2014-06-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-12-03","-68","0","51","0","N/A","cotrimoxazole"
-"","12508000995","kioko","mutinda","","2007-09-06","8","Paediatric","426","FEMALE","NO","22","0","0","702996066","mutitu","","","","","NO","NO","NO","2012-12-30","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-07-17","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","20","0","N/A","cotrimoxazole"
-"","12508000996","mutheu","jacinta","","1979-05-08","36","Adult","426","FEMALE","NO","33.5","0","0","715291285","uthiuni","","","","","NO","NO","NO","2014-05-22","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-05-22","Active","NO","","","","","","2014-05-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","40","0","N/A","cotrimoxazole"
-"","12508000997","jackline","wambua","mwikali","2012-05-06","3","Paediatric","422","FEMALE","NO","11.5","0","0","","","","","","","NO","NO","NO","2013-03-26","OUTPATIENT","GOK","ART","ABC + 3TC + LPV/r (< 15YRS PAED)","2013-06-04","Active","NO","","","","","","2014-04-14","NO","","ABC + 3TC + LPV/r (< 15YRS PAED)","2014-12-30","-41","0","12","0","N/A","cotrimoxazole"
-"","12508001000","kilonzo","george","","1937-05-08","79","Adult","426","MALE","NO","55","0","0","735195188","mutitu","","","","","NO","NO","NO","2010-05-08","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-05-06","Active","NO","","","","","","2013-07-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-05","-4","0","56","0","N/A","cotrimoxazole"
-"","12508001002","muthoki","gladys","","1981-05-09","34","Adult","426","FEMALE","NO","93.1","0","0","","","","","","","NO","NO","NO","2013-05-05","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-16","Active","NO","","","","","","2013-08-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-12-25","-46","0","88","0","N/A","cotrimoxazole"
-"","12508001003","zipporah","nzwili","muthoki","1972-05-06","43","Adult","426","FEMALE","NO","80","0","0","710924126","","","","","","NO","NO","NO","2013-01-31","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2013-06-18","NO","","OI Medicines","2015-04-02","52","0","75","0","N/A","cotrimoxazole"
-"","12508001004","jackson","muthama","wambua","2009-05-08","6","Paediatric","426","MALE","NO","13","0","0","706417884","kali","","","","","NO","NO","NO","2013-02-05","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2013-02-05","Lost to follow-up","NO","","","","","","2014-04-24","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2014-01-24","-381","0","12","0","N/A","cotrimoxazole"
-"","12508001009","muinde","mutuku","mbuvi","1962-02-02","54","Adult","426","MALE","NO","49.5","0","0","","","","","","","NO","NO","NO","2013-08-15","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-12-31","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-02","-130","0","56","0","N/A","cotrimoxazole"
-"","12508001010","nduku","winifred","kioko","1994-05-20","21","Adult","","FEMALE","NO","42.6","0","0","707278795","kivandini","","","","","NO","NO","NO","2014-04-15","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-04-15","Active","NO","","","","","","2014-04-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-13","4","0","38","0","N/A","cotrimoxazole"
-"","12508001011","joseph","odede","otieno","1985-01-02","31","Adult","","MALE","NO","53","175","0","","","","","","","NO","NO","NO","2013-09-23","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-03-31","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-12-31","-405","175","53.5","0","N/A","cotrimoxazole"
-"","12508001013","mwikali","georginah","","1972-08-09","43","Adult","426","FEMALE","NO","41","0","0","","kitundu","","","","","NO","NO","NO","2014-06-02","pmtct","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-06-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","43","0","N/A","cotrimoxazole"
-"","12508001014","florence","mutuku","ngusye","1970-04-08","45","Adult","425","FEMALE","NO","57","0","0","","","","","","","NO","NO","NO","2013-04-03","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-05-29","Active","NO","","","","","","2013-10-22","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-05","-4","0","43","0","N/A","cotrimoxazole"
-"","12508001015","kyama","samson","lui","1973-05-08","42","Adult","426","MALE","NO","56","166","0","728829880","tuvilani","","","","","NO","NO","NO","2013-03-13","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-15","Lost to follow-up","NO","","","","","","2014-04-16","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-01-16","-389","166","53.3","0","N/A","cotrimoxazole"
-"","12508001016","eunice","benedict","mueni","1985-06-08","30","Adult","426","FEMALE","NO","59","0","0","713768750","mavindu","","","","","NO","NO","NO","2013-03-03","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-06-07","Active","NO","","","","","","2013-06-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-25","16","0","47","0","N/A","cotrimoxazole"
-"","12508001020","stephen","muli","","1978-01-01","38","Adult","","MALE","NO","60","170","0","","","","","","","NO","NO","NO","2013-09-23","IN PATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-09-23","Active","NO","","","","","","2013-12-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-19","10","170","55","0","N/A","cotrimoxazole"
-"","12508001023","nicolus","mutuku","","1982-04-05","33","Adult","426","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2013-03-25","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-03-25","Active","NO","","","","","","2013-12-26","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-06","-34","0","57.5","0","N/A","cotrimoxazole"
-"","12508001025","tery","nduku","","2004-04-05","11","Paediatric","426","FEMALE","NO","20","0","0","","","","","","","NO","NO","NO","2012-03-12","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-06-21","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","0","16.8","0","N/A","cotrimoxazole"
-"","12508001027","dorcus","kiamba","mwikali","1963-01-08","53","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2013-04-16","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-05-29","Active","NO","","","","","","2013-05-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","45","0","N/A","cotrimoxazole"
-"","12508001028","muendo","nganda","","1968-02-09","48","Adult","301","MALE","NO","52","0","0","","","","","","","NO","YES","NO","2013-02-05","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-06-04","Lost to follow-up","NO","","","","","","2013-11-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-27","-531","0","51","0","N/A","cotrimoxazole"
-"","12508001029","mambo","percy","","1970-08-09","45","Adult"," ","MALE","NO","52","171","0","720284180","kyuu","","","",",","NO","NO","NO","2013-04-24","OUTPATIENT","","ART","AZT + 3TC + EFV (>15YRS ADULT)","2013-08-15","Active","NO","","0","","","","2014-11-17","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-03-25","44","171","52.8","0","N/A","Dapsone"
-"","12508001030","mueni","esther","","1977-09-05","38","Adult","426","FEMALE","NO","46","151","0","715426198","kyuu","","","","","NO","NO","NO","2013-04-24","OUTPATIENT","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2013-05-05","Lost to follow-up","NO","","","","","","2014-07-03","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-04-04","-311","151","48","0","N/A","cotrimoxazole"
-"","12508001034","isaac","savali","","2012-02-02","3","Paediatric","426","MALE","NO","12","0","0","","","","","","","NO","NO","NO","2013-02-05","OUTPATIENT","GOK","ART","ABC + 3TC + LPV/r (>15YRS ADULT)","2013-06-07","Active","NO","","","","","","2013-10-03","NO","","ABC + 3TC + LPV/r (< 15YRS PAED)","2015-01-13","-27","0","8.5","0","N/A","cotrimoxazole"
-"","12508001035","winfred","mutinda","mwongeli","1986-02-08","29","Adult","426","FEMALE","NO","47","0","0","703136632","mutitu","70787541159","","","","NO","NO","NO","2013-04-05","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-06-04","Active","NO","","","","","","2013-09-16","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-13","-27","0","49","0","N/A","cotrimoxazole"
-"","12508001037","mary","kioko","","1971-01-01","45","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2013-09-22","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-22","Lost to follow-up","NO","","","","","","2014-09-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-06-26","-228","0","44.2","0","N/A","cotrimoxazole"
-"","12508001039","john","mwau","kioko","1973-05-08","42","Adult","421","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2013-05-25","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-06-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-13","4","0","56","0","N/A","cotrimoxazole"
-"","12508001040","jenifer","muthoka","","2009-01-01","6","Paediatric","","FEMALE","NO","13","0","0","","","","","","","NO","NO","NO","2013-09-26","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2013-09-26","Active","NO","","","","","","2013-11-07","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-16","-24","0","11","0","N/A","cotrimoxazole"
-"","12508001041","maingi","onesmus","","1970-01-01","46","Adult","426","MALE","NO","59","0","0","","","","","","","NO","NO","NO","2013-09-12","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2015-01-15","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-17","-115","0","64","0","N/A","cotrimoxazole"
-"","12508001043","zipporah","nzioki","mwongeli","1985-01-06","31","Adult","426","FEMALE","NO","60","0","0","719810582","kaliani","","","","","NO","NO","NO","2013-06-03","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-06-03","Lost to follow-up","NO","","","","","","2013-09-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-06-17","-602","0","60","0","N/A","cotrimoxazole"
-"","12508001045","purity","kioko","ngina","2008-05-09","7","Paediatric","426","FEMALE","NO","16.9","0","0","714450795","mutitu","","","","","NO","NO","NO","2013-06-06","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-06-06","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","0","25","0","N/A","cotrimoxazole"
-"","12508001046","mulinge","kimeu","","1984-04-05","31","Adult","426","MALE","NO","43","0","0","","","","","","","NO","NO","NO","2013-01-07","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-07-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-30","-10","0","54","0","N/A","cotrimoxazole"
-"","12508001048","anne","kioko","mutheu","1987-05-06","28","Adult","421","FEMALE","NO","60","0","0","714450795","","","","","","NO","NO","NO","2013-06-18","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-10-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-07-31","-193","0","54","0","N/A","cotrimoxazole"
-"","12508001049","muteti","serah","","2010-06-11","5","Paediatric","425","MALE","NO","14","0","0","","","","","","","NO","NO","NO","2013-06-19","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2013-06-19","Lost to follow-up","NO","","","","","","2015-01-25","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2014-10-27","-105","0","10","0","N/A","cotrimoxazole"
-"","12508001051","wanza","eunice","","1978-05-07","37","Adult","426","FEMALE","NO","45","156","0","7","mutitu","","","","","NO","NO","NO","2013-07-02","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-15","Lost to follow-up","NO","","","","","","2014-05-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-02-07","-367","156","44.6","0","N/A","cotrimoxazole"
-"","12508001054","kavindu","domitila","","1972-05-08","43","Adult","426","FEMALE","NO","52","150","0","700212339","ithaga","","","","","NO","NO","NO","2013-07-09","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-05-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-13","-361","130","43","0","N/A","cotrimoxazole"
-"","12508001055","mutete","martha","ndavi","1949-02-05","67","Adult","426","FEMALE","NO","40","157","0","","nzeveveni","711468465","pychosis","","","NO","NO","NO","2013-07-21","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-13","Lost to follow-up","NO","","","","","","2014-07-10","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-04-11","-304","152","39.5","0","N/A","cotrimoxazole"
-"","12508001056","nzyuko","haaron","","1975-05-05","40","Adult","426","MALE","NO","47","169.2","0","703467263","uthiuni","","","","","YES","YES","NO","2013-08-26","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-26","Active","NO","","","","","","2013-08-26","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","45","0","N/A","cotrimoxazole"
-"","12508001057","agnes","kavuu","","1983-05-09","32","Adult","421","FEMALE","NO","50","0","0","715878897","kalama","","","","","NO","NO","NO","2013-07-17","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-07-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-04-02","52","0","45","0","N/A","cotrimoxazole"
-"","12508001058","mutheu","bridgit","richard","1989-01-01","26","Adult","426","FEMALE","NO","51","155","0","714577653","kitundu","","","","","NO","NO","NO","2013-07-31","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-13","Active","NO","","","","","","2013-08-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","155","46.7","0","N/A","cotrimoxazole"
-"","12508001059","","","","1989-01-01","26","Adult","","MALE","NO","58","0","0","","","","","","","NO","NO","NO","2013-09-13","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-02-06","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-08","-458","0","58.3","0","N/A","cotrimoxazole"
-"","12508001060","MATHEW","MUSYOKI","","1981-01-01","35","Adult","","MALE","NO","61","0","0","","","","","","","NO","NO","NO","2013-09-04","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-04","Lost to follow-up","NO","","","","","","2015-02-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-11-05","-96","0","54","0","N/A","cotrimoxazole"
-"","12508001061","mutunga","denis","","1978-01-05","38","Adult","416","MALE","NO","38","0","0","726077226","kyuu","","","","","NO","NO","NO","2013-08-08","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-01","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-03-03","-343","0","58","0","N/A","cotrimoxazole"
-"","12508001063","syombua","eunice","muli","1964-06-09","51","Adult","426","FEMALE","NO","65.5","154.3","0","","nzeveni","","","","","NO","NO","NO","2013-08-25","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-08-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-30","-10","0","54","0","N/A","cotrimoxazole"
-"","12508001065","francis","nthatu","ngei","1964-01-01","52","Adult","","MALE","NO","62","0","0","","","","","","","NO","NO","NO","2013-09-03","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2013-12-16","NO","","OI Medicines","2013-09-17","-510","0","60","0","N/A","cotrimoxazole"
-"","12508001066","ngina","phylis","maingi","1972-05-05","43","Adult","426","FEMALE","NO","46","0","0","","utagwa","723112321","","","","NO","NO","NO","2013-09-05","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-11-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-06","25","0","85","0","N/A","cotrimoxazole"
-"","12508001068","everlyne","mule","keli","1976-01-01","40","Adult","","FEMALE","NO","31","140","0","","","","","","","NO","NO","NO","2013-09-23","","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-05-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-28","-346","140","38.5","0","N/A","cotrimoxazole"
-"","12508001069","richard","mutuku","mutua","1960-01-07","56","Adult","","MALE","NO","59.1","169","0","","","","","","","NO","NO","NO","2013-09-25","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-09-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-17","36","169","56.7","0","N/A","cotrimoxazole"
-"","12508001071","joyce","mbeneka","","1978-05-12","37","Adult","","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2013-08-09","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2015-01-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-31","-101","0","48","0","N/A","cotrimoxazole"
-"","12508001072","florence","mueni","","1978-12-21","37","Adult","","FEMALE","NO","51","0","0","","","","","","","NO","NO","NO","2013-11-08","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-08","Active","NO","","","","","","2013-11-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-13","4","0","37","0","N/A","cotrimoxazole"
-"","12508001073","mbithe","nzioki","","1986-01-01","30","Adult","426","FEMALE","NO","45","0","0","","nzaini","","","","","NO","NO","NO","2013-08-10","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-11-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-09","-31","0","48","0","N/A","cotrimoxazole"
-"","12508001074","","kithuku","matat","1973-01-12","43","Adult","","MALE","NO","61.5","0","0","","","","","","","NO","NO","NO","2013-10-09","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-10-09","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-25","16","0","60","0","N/A","cotrimoxazole"
-"","12508001075","boniface","ndolo","","1974-05-14","41","Adult","425","MALE","NO","63.5","0","0","","","","","","","NO","NO","NO","2013-09-14","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-14","Active","NO","","","","","","2013-10-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-09","-31","0","58","0","N/A","cotrimoxazole"
-"","12508001076","ester","kanini","","1969-05-14","46","Adult"," ","FEMALE","NO","68","0","0","","","","","",",","NO","NO","NO","2013-10-10","OUTPATIENT","","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-10","Active","NO","","0","","","","2013-10-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-25","16","0","51","0","N/A","Dapsone"
-"","12508001078","erick","mutuku","","1984-01-21","32","Adult","","MALE","NO","53.5","0","0","","","","","","","NO","NO","NO","2013-11-08","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-11-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-29","-11","0","50","0","N/A","cotrimoxazole"
-"","12508001079","","mbuvu","mativo","1972-01-10","44","Adult","","MALE","NO","47","0","0","","","","","","","NO","NO","NO","2013-11-08","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-11-08","Lost to follow-up","NO","","","","","","2014-02-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-11-22","-444","0","47","0","N/A","cotrimoxazole"
-"","12508001082","nduku","ndanu","","2007-05-05","8","Paediatric"," ","FEMALE","NO","18.6","0","0","","","","","",",","NO","NO","NO","2013-11-28","OUTPATIENT","","ART","ABC + 3TC + NVP (< 15YRS PAED)","2010-12-23","Active","NO","","0","","","","2013-11-28","NO","","ABC + 3TC + EFV (< 15YRS PAED)","2015-01-15","-25","0","18","0","N/A","cotrimoxazole"
-"","12508001084","","musyoka","kioko","2005-12-04","9","Paediatric","","MALE","NO","21.3","0","0","","","","","","","NO","NO","NO","2014-01-28","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-01-28","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-08","-32","0","18.8","0","N/A","cotrimoxazole"
-"","12508001085","felistus","robert","keli","1987-01-06","29","Adult","","FEMALE","NO","42","0","0","","","","","","","NO","NO","NO","2014-01-03","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-01-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","41","0","N/A","cotrimoxazole"
-"","12508001088","","mutua","bernard","1987-01-10","28","Adult","","MALE","NO","68.2","0","0","","","","","","","NO","NO","NO","2013-12-03","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-12-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-09","-31","0","41","0","N/A","cotrimoxazole"
-"","12508001089","nduku","esther","nzau","1985-08-08","30","Adult","426","FEMALE","NO","45","0","0","7","nzeveni","","","","","NO","NO","NO","2013-05-05","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-25","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-03-27","-319","0","45","0","N/A","cotrimoxazole"
-"","12508001090","nzuve","david","mbithuka","1939-05-05","77","Adult","426","MALE","NO","65","0","0","705683635","kitundu","","","","","NO","NO","NO","2014-01-06","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-04-20","NO","","OI Medicines","2014-01-20","-385","0","65","0","N/A","cotrimoxazole"
-"","12508001091","mutanu","mary","mulikya","1989-05-05","26","Adult","","FEMALE","NO","54","0","0","","nzeveni","","","","","NO","NO","NO","2014-01-10","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-03-13","-333","0","54","0","N/A","cotrimoxazole"
-"","12508001092","mercy","mutunga","murugi","1972-01-02","44","Adult","","FEMALE","NO","57","0","0","","","","","","","NO","NO","NO","2014-01-24","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-07-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-04-21","-294","0","56","0","N/A","cotrimoxazole"
-"","12508001093","","","","1973-01-07","43","Adult","","FEMALE","NO","53","0","0","","","","","","","NO","NO","NO","2014-01-27","IN PATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-27","Lost to follow-up","NO","","","","","","2014-05-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-10","-364","0","53","0","N/A","cotrimoxazole"
-"","12508001094","janet","musila","katunge","1958-01-05","58","Adult","","FEMALE","NO","47.5","0","0","","","","","","","NO","NO","NO","2014-01-27","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-01-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-16","-24","0","46","0","N/A","cotrimoxazole"
-"","12508001095","franscica","benard","","1952-05-09","64","Adult","426","FEMALE","NO","47","0","0","","mataa-kitundu","","","","","NO","NO","NO","2014-01-30","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-02-18","Active","NO","","","","","","2014-02-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-13","4","0","56","0","N/A","cotrimoxazole"
-"","12508001096","katindi","florence","","1979-05-08","36","Adult","426","FEMALE","NO","57","0","0","703763075","nzaini","","","","","NO","NO","NO","2014-02-03","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-02-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-13","4","0","54","0","N/A","cotrimoxazole"
-"","12508001097","wayua","eunice","","1964-05-08","51","Adult","426","FEMALE","NO","43.1","0","0","","kitundu","","","","","NO","NO","NO","2014-02-03","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-02-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-30","-10","0","33","0","N/A","cotrimoxazole"
-"","12508001098","mueni","alice","sammy","1986-05-08","29","Adult","426","FEMALE","NO","49","0","0","","","","","","","NO","NO","NO","2014-02-04","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-12-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-09-04","-158","0","54","0","N/A","cotrimoxazole"
-"","12508001099","mutinda","agnes","","1968-08-07","47","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2014-02-04","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-02","NO","","OI Medicines","2014-03-04","-342","0","48","0","N/A","cotrimoxazole"
-"","12508001100","peter","syombua","jackline","1978-05-05","37","Adult","426","FEMALE","NO","45","0","0","","kyuu","","","","","NO","NO","NO","2014-02-10","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-02-21","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","","44","0","N/A","cotrimoxazole"
-"","12508001101","ngina","mulwa","susan","1955-09-07","60","Adult","","FEMALE","NO","43.5","0","0","","","","","","","NO","NO","NO","2014-02-18","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-02-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-30","-10","0","49","0","N/A","cotrimoxazole"
-"","12508001103","mutua","benard","kitheka","1989-05-09","26","Adult","426","MALE","NO","35.5","0","0","702921048","kithungo","","","","","NO","NO","NO","2014-02-24","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-08","NO","","OI Medicines","2014-03-10","-336","0","35","0","N/A","cotrimoxazole"
-"","12508001104","simon","mwalali","mutunga","1975-05-07","40","Adult","426","MALE","NO","79","178","0","","","","","","","NO","NO","NO","2014-02-27","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-06-11","NO","","OI Medicines","2014-03-13","-333","178","79","0","N/A","cotrimoxazole"
-"","12508001105","bernadette","kiuwa","syekonyo","1990-08-09","25","Adult","426","FEMALE","NO","66","177","0","","","","","","","NO","NO","NO","2014-02-27","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-08-07","NO","","OI Medicines","2014-05-09","-276","177","69","0","N/A","cotrimoxazole"
-"","12508001106","mwikali","monica","kioko","1973-09-06","42","Adult","426","FEMALE","NO","50","0","0","724382553","kaliani","","","","","NO","NO","NO","2014-03-11","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-03-11","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","51","0","N/A","cotrimoxazole"
-"","12508001107","ngina","victoria","kisoi","1978-05-08","37","Adult","426","FEMALE","NO","55","0","0","705779592","kithungo","","","","","NO","NO","NO","2014-03-11","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-03-11","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-06","-34","0","45","0","N/A","cotrimoxazole"
-"","12508001108","stephen","mukithya","munyao","1978-01-05","38","Adult","","MALE","NO","63","0","0","","","","","","","NO","NO","NO","2014-03-14","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-03-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-16","-24","0","65.5","0","N/A","cotrimoxazole"
-"","12508001109","peter","kimeu","ndumbu","1963-06-08","52","Adult","","MALE","NO","55.5","0","0","","","","","","","NO","NO","NO","2014-05-02","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-05-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-20","-20","0","55.8","0","N/A","cotrimoxazole"
-"","12508001111","josephine","kisilu","nduku","1969-06-15","46","Adult","426","FEMALE","NO","50.9","0","0","701074422","kithungo","","","","","NO","NO","NO","2014-04-08","OUTPATIENT","GOK","ART","OI Medicines","2014-04-08","Active","NO","","","","","","2014-04-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-04-08","58","0","48.5","0","N/A","cotrimoxazole"
-"","12508001112","carol","kimanthi","mbithe","2012-05-05","3","Paediatric","","FEMALE","NO","12","0","0","","","","","","","NO","NO","NO","2014-07-31","pmtct","GOK","ART","ABC + 3TC + LPV/r (>15YRS ADULT)","2014-07-31","Active","NO","","","","","","2014-07-31","NO","","ABC + 3TC + LPV/r (< 15YRS PAED)","2015-01-15","-25","0","11","0","N/A","cotrimoxazole"
-"","12508001113","charles","maloli","mwololo","1983-06-15","32","Adult","426","MALE","NO","45","0","0","","utangwa","","","","","NO","NO","NO","2014-04-09","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-08-21","NO","","OI Medicines","2014-05-23","-262","0","45","0","N/A","cotrimoxazole"
-"","12508001114","KENEDDY","NGEWA","NDAVI","1961-05-07","55","Adult","","MALE","NO","39","0","0","","","","","CTX","","NO","NO","NO","2014-04-22","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-10-02","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-04","-220","0","40","0","N/A","cotrimoxazole"
-"","12508001115","julius","musyoka","","1957-01-05","59","Adult","426","MALE","NO","55","0","0","","","","","","","NO","NO","NO","2014-04-23","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-10-16","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-18","-206","0","57","0","N/A","cotrimoxazole"
-"","12508001119","katulu","rhoda","","1999-05-09","16","Adult","","FEMALE","NO","47.9","0","0","","","","","","","NO","NO","NO","2014-05-22","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2015-02-04","NO","","OI Medicines","2014-11-06","-95","0","46","0","N/A","cotrimoxazole"
-"","12508001120","syombua","susan","","1973-07-08","42","Adult","426","FEMALE","NO","53.4","0","0","","mataa kitundu","","","","","NO","NO","NO","2014-06-20","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-06-20","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-04-02","52","0","52","0","N/A","cotrimoxazole"
-"","12508001122","kivungi","peter","","1971-05-09","44","Adult","426","MALE","NO","41","0","0","","nzeveni","","","","","NO","NO","NO","2014-06-17","IN PATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-06-17","Lost to follow-up","NO","","","","","","2014-11-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-19","-174","0","39","0","N/A","cotrimoxazole"
-"","12508001124","john","waita","kasyoki","1972-05-08","43","Adult","426","MALE","NO","46","0","0","","","","","","","NO","NO","NO","2014-07-20","OUTPATIENT","GOK","","OI Medicines","","Active","NO","","","","","","2014-07-20","NO","","OI ONLY","2015-01-16","-24","0","46","0","N/A","cotrimoxazole"
-"","12508001126","SELINA","NDUNGE","","1986-08-09","29","Adult","426","FEMALE","NO","42","0","0","","","","","","","NO","NO","NO","2014-04-07","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-08","Active","NO","","","","","","2014-08-09","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-05","-35","0","42","0","N/A","cotrimoxazole"
-"","12508001128","mutua","stephen","mwikali","1992-10-06","23","Adult","","MALE","NO","51","0","0","","","","","","","YES","NO","NO","2014-07-29","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-12-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-09-15","-147","0","51","0","N/A","cotrimoxazole"
-"","12508001129","kilonzo","esther","","1978-04-06","37","Adult","426","MALE","NO","50","0","0","","mavindu","","","","","NO","NO","NO","2014-07-29","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2015-01-15","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-17","-115","0","48","0","N/A","cotrimoxazole"
-"","12508001130","STELLA","KAMENE","KIMEU","1965-06-15","50","Adult","425","FEMALE","NO","61.6","156","0","","MUTITU SECONDARYSCHOOL","","","","","NO","NO","NO","2014-08-01","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-05","Active","NO","","","","","","2014-09-23","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-19","-52","156","60","0","N/A","cotrimoxazole"
-"","12508001131","NDEKE","CHARLES","","2012-08-06","3","Paediatric","426","MALE","NO","9","0","0","","UTAGWA","","","","","NO","NO","NO","2014-08-20","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2014-08-20","Active","NO","","","","","","2014-08-20","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-10","1","0","9.3","0","N/A","cotrimoxazole"
-"","12508001132","ndugwa","jeniffer","ngosi","1985-05-09","30","Adult","","FEMALE","NO","46","0","0","705942409","kyuu","","","","","NO","NO","NO","2014-08-18","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-18","Lost to follow-up","NO","","","","","","2015-02-05","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-07","-94","0","42","0","N/A","cotrimoxazole"
-"","12508001137","wilson","kingoo","","1932-09-30","84","Adult","426","MALE","NO","45.8","0","0","","kikima","","","","","NO","NO","NO","2014-09-05","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-09-30","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-09","-31","0","56","0","N/A","cotrimoxazole"
-"","12508001138","justina","muthina","","1977-08-01","38","Adult","426","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2014-10-16","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-16","Active","NO","","","","","","2014-10-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","46","0","N/A","cotrimoxazole"
-"","12508001139","mwikali","muia","","2006-01-07","9","Paediatric","426","FEMALE","NO","18.1","0","0","","mavindu","","","","","NO","NO","NO","2014-09-16","OUTPATIENT","GOK","ART","AZT + 3TC + NVP (< 15YRS PAED)","2014-09-16","Active","NO","","","","","","2014-10-02","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-02-05","-4","0","18","0","N/A","cotrimoxazole"
-"","12508001140","MULINGE","MUENDO","","1982-06-15","33","Adult","426","MALE","NO","42.6","156","0","","KYANGOMA PRIMARY SCHOOL","702139249","","","","NO","NO","NO","2014-10-01","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-10-13","Lost to follow-up","NO","","","","","","2015-01-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-10-27","-105","156","41.2","0","N/A","cotrimoxazole"
-"","12508001141","PAULINE","NDUNGWA","MUTHINI","1976-06-15","39","Adult","425","FEMALE","NO","60","159","0","718285584","MUTWII SECONDARY SCHOOL","","","","","NO","NO","NO","2014-09-18","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-09-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-23","-17","159","61.5","0","N/A","cotrimoxazole"
-"","12508001143","david","wambua","","1979-06-01","36","Adult","426","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2014-09-25","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-09-25","Active","NO","","","","","","2014-10-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-12","3","0","52","0","N/A","cotrimoxazole"
-"","12508001145","elizabeth","syombua","","1976-05-06","39","Adult","426","FEMALE","NO","70","0","0","","","","","","","NO","NO","NO","2014-09-29","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-11-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-12","-59","0","70","0","N/A","cotrimoxazole"
-"","12508001146","MWENDWA","DENNIS","MUTUKU","2000-08-28","15","Adult","426","MALE","NO","21.9","131","0","726084124","MAVINDU PRIMARU SCHOOL","","","","","NO","NO","NO","2014-09-30","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-09-30","Active","NO","","","","","","2014-10-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-13","-88","131","21.3","0","N/A","cotrimoxazole"
-"","12508001152","JOSEPH","MAWEU","NYAMASYO","1979-06-15","36","Adult","426","MALE","NO","60.5","0","0","713117941","NZUENI PRIMARY SCHOOL","","","","","NO","NO","NO","2014-10-13","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2014-10-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-06","-3","0","60.5","0","N/A","cotrimoxazole"
-"","12508001153","evans","muthiani","","1984-05-07","31","Adult","426","MALE","NO","68","0","0","","mbooni","","","","","NO","NO","NO","2014-10-21","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-21","Active","NO","","","","","","2014-11-05","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","66","0","N/A","cotrimoxazole"
-"","12508001154","mary","musau","keli","1963-06-06","52","Adult","426","FEMALE","NO","65","0","0","","","","","","","NO","NO","NO","2014-10-21","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2014-11-08","NO","","OI Medicines","2015-01-02","-38","0","65","0","N/A","cotrimoxazole"
-"","12508001155","wayua","doris","","1958-04-06","58","Adult","426","FEMALE","NO","48","0","0","","mtitu","","","","","NO","NO","NO","2014-11-18","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-18","Active","NO","","","","","","2014-11-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-10","1","0","48","0","N/A","cotrimoxazole"
-"","1256600001","kimeu","monicah","","1987-08-25","28","Adult","426","FEMALE","NO","64","0","0","706995232","kyuu","","","","","NO","NO","YES","2014-05-19","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-09-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-06-11","-243","0","63","0","N/A","cotrimoxazole"
-"","12626004047","mwende","veronicah","","1987-01-05","29","Adult","419","FEMALE","NO","57","0","0","714174922","mwingi","","","","","NO","NO","NO","2012-08-15","TRANSFER IN","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-12-08","NO","","OI Medicines","2014-09-09","-153","0","56","0","N/A","cotrimoxazole"
-"","12787000801","mbithi","john","","1958-02-08","58","Adult","426","MALE","NO","40","0","0","711768429","yadue","","","","","NO","NO","NO","2014-08-18","IN PATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-18","Lost to follow-up","NO","","","","","","2014-12-21","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-09-22","-140","0","40","0","N/A","cotrimoxazole"
-"","12808000034","nthambi","elizabeth","mutuku","1969-05-06","46","Adult","426","FEMALE","NO","36","0","0","711924721","mavindu","","","","","NO","NO","NO","2014-07-04","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-04","Active","NO","","","","","","2014-07-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","35","0","N/A","cotrimoxazole"
-"","13060256110","patrick","muthiani","kyalo","1964-03-25","52","Adult","426","FEMALE","NO","38","0","0","","","","","","","NO","NO","NO","2010-01-29","TRANSFER IN","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2010-01-29","Active","NO","","","","","","2014-03-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-24","15","0","58","0","N/A","cotrimoxazole"
-"","130625610","muthiani","kyalo","","1958-05-05","58","Adult","426","MALE","NO","58","0","0","","","","","","","NO","NO","NO","2014-01-14","TRANSIT","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2014-01-14","Lost to follow-up","NO","","","","","","2014-04-28","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-01-28","-377","0","58","0","N/A","cotrimoxazole"
-"","1310902","fredrick kathoka","","","1431-09-29 00:00:00","592","Adult","","MALE","NO","62","0","0","","","","","","","YES","NO","NO","2011-09-29","IN PATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-09-29","Lost to follow-up","NO","","","","","","2012-06-06","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2012-03-08","-1068","0","62.4","0","N/A","cotrimoxazole"
-"","15/07","mwende","elizabeth","","1994-12-05","20","Adult","426","FEMALE","NO","54","154","0","724529803","kikima","","","","","NO","NO","NO","2013-07-16","OUTPATIENT","GOK","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2013-07-16","PEP end","NO","","","","","","2013-08-15","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2013-08-13","-545","154","54","0","N/A","cotrimoxazole"
-"","1516125173","carolyne","ngina","mwendi","1999-01-08","16","Adult","","FEMALE","NO","27","0","0","","","","","","","NO","NO","NO","2012-01-01","IN PATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2012-01-01","Lost to follow-up","NO","","","","","","2014-03-18","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-12-18","-418","0","27","0","N/A","cotrimoxazole"
-"","1535000314","wahu","elizabeth","","1980-05-08","35","Adult","729","FEMALE","NO","64","160.4","0","","galikya","","","","","NO","NO","NO","2012-02-14","TRANSFER IN","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2013-01-05","Transfer out","NO","","","","","","2014-01-06","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-01-28","-377","0","61","0","N/A","cotrimoxazole"
-"","1731973","mary kariri","mutuku","","1981-03-15 00:00:00","34","Adult","","FEMALE","NO","44.5","0","0","","imandini","","","","","NO","NO","NO","2011-03-15","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-15","Lost to follow-up","NO","","","","","","2011-07-11","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-04-12","-1399","0","41","0","N/A","cotrimoxazole"
-"","20140213","","","","2012-01-12","3","Paediatric","","FEMALE","NO","11","0","0","","","","","","","NO","NO","NO","2014-02-14","OUTPATIENT","GOK","PEP","AZT + 3TC + LPV/r (Paed PEP Option 1)","2014-02-14","PEP end","NO","","","","","","2014-03-16","NO","","AZT + 3TC + LPV/r (Paed PEP Option 1)","2014-03-14","-332","0","11","0","N/A","cotrimoxazole"
-"","20140309","muvea","benson","","1968-09-05","47","Adult","426","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2014-09-03","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2014-09-03","PEP end","NO","","","","","","2014-10-03","NO","","TDF + 3TC (Adult PEP Option 5)","2014-10-01","-131","0","56","0","N/A","cotrimoxazole"
-"","20983M03","KELVIN VAATI","SYOMBUA","","2006-08-02 00:00:00","9","Paediatric","","MALE","NO","17","0","0","","","","","","","NO","NO","NO","2011-08-02","IN PATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2011-08-02","Lost to follow-up","NO","","","","","","2011-11-28","NO","","CF2A(ABC + 3TC + NVP )","2011-08-30","-1259","0","17","0","N/A","cotrimoxazole"
-"","2192","juliana","kingoo","kamanthe","1969-01-02","47","Adult","","FEMALE","NO","86","0","0","","","","","","","NO","NO","NO","2013-05-30","IN PATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-05-30","Active","NO","","","","","","2013-11-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","83","0","N/A","cotrimoxazole"
-"","2312","","","","1969-01-20","47","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2013-10-12","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-10-12","PEP end","NO","","","","","","2013-11-11","NO","","TDF + 3TC (Adult PEP Option 5)","2013-10-12","-485","0","50","0","N/A","cotrimoxazole"
-"","2535","","","","1978-12-12","37","Adult","","MALE","NO","70","0","0","","","","","","","NO","NO","NO","2014-01-24","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2014-01-24","PEP end","NO","","","","","","2014-02-23","NO","","TDF + 3TC (Adult PEP Option 5)","2014-02-21","-353","0","70","0","N/A","cotrimoxazole"
-"","2983m03","kelvin","vaati syombua","","2003-03-03 00:00:00","12","Paediatric","","MALE","NO","20","0","0","","","","","","","NO","NO","NO","2008-03-03","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2008-03-03","Lost to follow-up","NO","","","","","","2012-11-12","NO","","CF2A(ABC + 3TC + NVP )","2012-08-14","-909","0","16.5","0","N/A","cotrimoxazole"
-"","3040010001079","wayua lydia","paul","","1968-12-08 00:00:00","47","Adult","","FEMALE","NO","67","0","0","","","","","","","NO","NO","NO","2011-12-08","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-12-08","Lost to follow-up","NO","","","","","","2012-04-05","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-01-06","-1130","0","67","0","N/A","cotrimoxazole"
-"","304013630","margrate","musembi","","1982-06-15","33","Adult","","FEMALE","NO","56.5","0","0","","","","","","","NO","NO","NO","2009-05-04","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2009-05-04","Transfer out","NO","","","","","","2013-03-12","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2013-11-05","-461","0","56.5","0","N/A","cotrimoxazole"
-"","30513101880","michael","kioko","","1958-12-03 00:00:00","57","Adult","","MALE","NO","49","0","0","","","","","","","NO","NO","NO","2011-12-03","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-12-03","Lost to follow-up","NO","","","","","","2012-04-09","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-01-10","-1126","0","49","0","N/A","cotrimoxazole"
-"","31100803015","agnes","kasemba","","1976-05-07","39","Adult","305","FEMALE","NO","48","0","0","7","","","","","","NO","NO","NO","2008-04-06","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2010-12-04","Lost to follow-up","NO","","","","","","2013-11-11","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-13","-545","0","48","0","N/A","cotrimoxazole"
-"","3923","kioko","everlyne","","1982-09-08","33","Adult","426","MALE","NO","40","0","0","","","","","","","NO","NO","NO","2014-05-01","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2014-05-01","PEP end","NO","","","","","","2014-05-31","NO","","","2014-05-31","-254","0","40","0","N/A","cotrimoxazole"
-"","40300102069","mueni","amos","","1977-10-25 00:00:00","38","Adult","","FEMALE","NO","57","155","0","","","","","","","NO","NO","NO","2009-10-25","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-10-25","Lost to follow-up","NO","","","","","","2013-01-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-09","-853","0","49","0","N/A","cotrimoxazole"
-"","404000102176","josphine","syoweu","","1970-05-28","45","Adult","426","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2006-11-05","IN PATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2006-11-05","Lost to follow-up","NO","","","","","","2014-11-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-08-20","-173","0","58.2","0","N/A","cotrimoxazole"
-"","40400100541"," francis","nzesya nthiwa","","1969-01-18 00:00:00","47","Adult","","MALE","NO","59","0","0","","","","","","","NO","NO","NO","2005-01-18","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-01-18","Lost to follow-up","NO","","","","","","2012-06-11","NO","","AS2A(TDF300MG+3TC150MG+LPV/R200MG/50MG)","2012-03-13","-1063","0","59","0","N/A","cotrimoxazole"
-"","40400101060","nashon muli","mativo","","1960-06-28 00:00:00","55","Adult","","MALE","NO","56","0","0","","muumoni primary","","","ctx/multivit","","NO","NO","NO","2005-06-28","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-06-28","Active","NO","","","","","","2013-01-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-24","43","0","53","0","N/A","cotrimoxazole"
-"","40400101382","DUKE BOSIRE","","","2007-03-15 00:00:00","8","Paediatric","","MALE","NO","21","123","0","","DEB COUNTY KIKIMA","","","","","NO","NO","NO","2011-03-15","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-03-15","Lost to follow-up","NO","","","","","","2011-10-31","NO","","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2011-08-02","-1287","123","22","0","N/A","cotrimoxazole"
-"","40400101674","muendi mulili","","","1994-12-29 00:00:00","20","Adult","","FEMALE","NO","33","141","0","","mweani pri sch","","","","","NO","NO","NO","2005-12-29","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2005-12-29","Lost to follow-up","NO","","","","","","2014-07-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-04-08","-307","0","30","0","N/A","cotrimoxazole"
-"","40400101909","veronica","nduku musyoka","","1962-02-27 00:00:00","54","Adult","","FEMALE","NO","41","0","0","","","","","","","NO","NO","NO","2006-02-27","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-02-27","Lost to follow-up","NO","","","","","","2011-10-16","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-07-18","-1302","0","49","0","N/A","cotrimoxazole"
-"","40400102152","mwikali","joseph","","1998-05-05 00:00:00","17","Adult","","FEMALE","NO","43","0","0","","kusyethuku primary","","","cotrimoxazole/multivitamin","","NO","NO","NO","2008-05-05","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2008-05-05","Active","NO","","","","","","2013-02-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-19","-21","0","27","0","N/A","cotrimoxazole"
-"","40400102176","josephine","syoweu","","1965-06-11 00:00:00","50","Adult","","FEMALE","NO","58.7","0","0","","nthaani primary school","","","septrin/m/vitamin","","NO","NO","NO","2006-06-11","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-06-11","Lost to follow-up","NO","","","","","","2014-01-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-03","-494","0","56","0","N/A","cotrimoxazole"
-"","40400102333","WILSON MUINDI","KILONZI","","1958-11-28 00:00:00","57","Adult","","MALE","NO","52","0","0","","MUTUI PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2006-11-28","IN PATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2006-11-28","Active","NO","","","","","","2012-10-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-06","-3","0","50","0","N/A","cotrimoxazole"
-"","40400102866","","kavindu maingi","","1968-10-27 00:00:00","47","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2006-10-27","IN PATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2006-10-27","NO","","OI Medicines","2015-01-19","-21","0","57","0","N/A","cotrimoxazole"
-"","40400103065","ANN MUENI","WAMBUA","","1960-03-25 00:00:00","56","Adult","","FEMALE","NO","45","0","0","","KALIANI PRY SCH","","","","","NO","NO","NO","2011-03-25","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-25","Active","NO","","","","","","2013-02-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","45","0","N/A","cotrimoxazole"
-"","40400103247","ann nduku","kiio","","1974-06-09 00:00:00","41","Adult","","FEMALE","NO","63.5","0","0","","kisesini pri sch","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-06-09","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","59","0","N/A","cotrimoxazole"
-"","40400103384","marietta ndunge","kang'oka","","1984-03-29 00:00:00","31","Adult","","FEMALE","NO","79","155","0","","aic kikima","","","","","NO","NO","NO","2011-03-29","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-29","Active","NO","","","","","","2013-01-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","54","0","N/A","cotrimoxazole"
-"","40400103497","MARY MUENI","","","1977-03-15 00:00:00","38","Adult","","FEMALE","NO","42","0","0","","KYAI PRI SCH","","","","","NO","NO","NO","2011-03-15","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-03-15","Active","NO","","","","","","2012-12-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-17","8","0","41","0","N/A","cotrimoxazole"
-"","4040010384","ndunge","marrieta","kangoka","1982-08-09","33","Adult","423","FEMALE","NO","72","0","0","715329062","nthungoni","","","","","NO","NO","NO","2007-08-09","TRANSFER IN","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2012-05-06","Lost to follow-up","NO","","","","","","2013-10-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-02","-556","0","72","0","N/A","cotrimoxazole"
-"","40400104030","hellen ngina","","","1968-09-29 00:00:00","47","Adult","","FEMALE","NO","54.2","150","0","","kaliani primary","","","cotrimoxazole/multivitamin","","NO","NO","NO","2009-09-29","IN PATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2009-09-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-27","-74","0","45","0","N/A","cotrimoxazole"
-"","40400104582","joshua","muinde","","1999-02-28 00:00:00","16","Adult","426","MALE","NO","20","0","0","","","","","ctx/multivit","","NO","NO","NO","2008-02-29","IN PATIENT","GOK","ART","OI ONLY","2008-02-29","Active","NO","","","","","","2014-02-02","NO","","AZT + 3TC + EFV (< 15YRS PAED)","2015-01-16","-24","0","17","0","N/A","cotrimoxazole"
-"","40400104583","LUCIA NDUNGE","","","1973-03-15 00:00:00","43","Adult","","FEMALE","NO","43","147","0","","KALIANI PRI SCH","","","","","NO","NO","NO","2011-03-15","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-15","Lost to follow-up","NO","","","","","","2014-02-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-11-04","-462","0","47","0","N/A","cotrimoxazole"
-"","40400104744","paul","malinda","ndeto","1962-04-22 00:00:00","54","Adult","","MALE","NO","70","177","0","","","","","","","NO","NO","NO","2008-04-22","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","","Active","NO","","","","","","2008-04-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","63","0","N/A","cotrimoxazole"
-"","40400105227","virginia","muoki","","1979-09-08 00:00:00","36","Adult","","FEMALE","NO","53","0","0","","","","","","","NO","NO","NO","2008-09-08","IN PATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-09-08","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-25","44","0","54","0","N/A","cotrimoxazole"
-"","40400106207","paul","makau","","1953-06-25 00:00:00","63","Adult","","MALE","NO","50","0","0","","","","","ctx/multivit","","NO","NO","NO","2009-06-25","IN PATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-03-12","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-12","-789","0","52","0","N/A","cotrimoxazole"
-"","40400106761","rose","mwelu maitha","","1972-06-15 00:00:00","43","Adult","","FEMALE","NO","66.6","0","0","","710457914","","","","","NO","NO","NO","2012-06-15","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-15","Active","NO","","","","","","2013-03-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-03","22","0","63","0","N/A","cotrimoxazole"
-"","40400107496","eunice","mwende","","1983-08-11 00:00:00","32","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2010-08-11","IN PATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2010-08-11","Lost to follow-up","NO","","","","","","2012-09-20","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2012-06-22","-962","0","51","0","N/A","cotrimoxazole"
-"","4040013417","wilson","kioko mutinda","","2000-12-04 00:00:00","14","Paediatric"," ","MALE","NO","25","0","0","","","","","",",","NO","NO","NO","2008-12-04","IN PATIENT","","ART","CF2A(ABC + 3TC + NVP )","2008-12-04","Lost to follow-up","NO","","0","","","","2013-10-22","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-07-24","-565","0","21","0","N/A","cotrimoxazole"
-"","4040103065","anne","mueni wambua","","1961-05-21 00:00:00","55","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2012-05-21","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-05-21","Lost to follow-up","NO","","","","","","2013-09-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-06-26","-593","0","43","0","N/A","cotrimoxazole"
-"","40401502192","alice","muluki mutie","","1962-03-18 00:00:00","54","Adult","","FEMALE","NO","47","162","0","","","","","","","NO","NO","NO","2011-03-18","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-18","Active","NO","","","","","","2012-12-20","NO","","TDF + ABC + LPV/r (>15YRS ADULT)","2015-02-05","-4","0","46","0","N/A","cotrimoxazole"
-"","404016000710","felistus wayua","kimeu","","1982-06-05 00:00:00","33","Adult","","FEMALE","NO","50","0","0","","704741268","","","","","NO","NO","NO","2012-06-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-06-05","Lost to follow-up","NO","","","","","","2012-11-26","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-08-28","-895","0","50","0","N/A","cotrimoxazole"
-"","40401600084","felista","ndinda musyoki","","1976-03-15 00:00:00","39","Adult","","FEMALE","NO","62","0","0","","","","","","","NO","NO","NO","2007-03-15","IN PATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2007-03-15","Transfer out","NO","","","","","","2007-03-15","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-02-21","-1084","0","58","0","N/A","cotrimoxazole"
-"","404016000858","eunice","wanza","","1985-08-01","30","Adult","425","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-07-31","TRANSIT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-07-31","Lost to follow-up","NO","","","","","","2012-11-12","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2012-08-14","-909","0","50","0","N/A","cotrimoxazole"
-"","40401601094","MUIA MUTUNGA","MWANIKI","","1960-09-20 00:00:00","55","Adult","","MALE","NO","45","0","0","","MULOONI PRI","","","COTRIMOXAZOLE/MULTIVIT","","NO","NO","NO","2011-09-20","IN PATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-09-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-24","15","0","48","0","N/A","cotrimoxazole"
-"","404400103384","marieta","ndunge kangoka","","1984-04-05 00:00:00","31","Adult","","FEMALE","NO","26","0","0","","","","","","","NO","NO","NO","2012-04-05","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-04-05","Lost to follow-up","NO","","","","","","2012-08-29","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-05-31","-984","0","26","0","N/A","cotrimoxazole"
-"","40483400113","veronica mwikali","kasimu","","1989-04-06 00:00:00","26","Adult","","FEMALE","NO","77","0","0","","","","","ctx/multivit","","NO","NO","NO","2009-04-06","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-06","Lost to follow-up","NO","","","","","","2014-09-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-06-06","-248","0","62","0","N/A","cotrimoxazole"
-"","40483400157","sammy munguti","kavoi","","1985-09-15 00:00:00","30","Adult","","MALE","NO","56.5","159","0","","","","","ctx/multivit","","NO","NO","NO","2009-09-15","TRANSFER IN","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-29","NO","","OI Medicines","2012-08-31","-892","0","53","0","N/A","cotrimoxazole"
-"","40507002761","musau","nzilu","","1957-01-05","59","Adult","426","MALE","NO","52","0","0","","ngai","","","","","NO","NO","NO","2014-06-05","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-06-05","Lost to follow-up","NO","","","","","","2014-09-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-06-19","-235","0","52","0","N/A","cotrimoxazole"
-"","407","georgina","mutheu","","1986-06-07","29","Adult","426","FEMALE","NO","58","154","0","","","","","","","NO","NO","NO","2013-03-07","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-03-07","PEP end","NO","","","","","","2013-04-06","NO","","TDF + 3TC (Adult PEP Option 5)","2013-08-01","-557","154","58","0","N/A","cotrimoxazole"
-"","40701000012","sammy","rose","","1977-07-08","38","Adult","426","FEMALE","NO","54.6","160.5","0","705946371","utagwa","","","","","NO","NO","NO","2000-07-06","TRANSFER IN","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2011-09-05","Active","NO","","","","","","2013-08-13","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","160.5","54","0","N/A","cotrimoxazole"
-"","40701000056","syombua","maiani","","2007-06-01 00:00:00","8","Paediatric","","FEMALE","NO","27","121.5","0","","","","","","","NO","NO","NO","2012-06-01","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-06-01","Lost to follow-up","NO","","","","","","2015-01-28","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-10-30","-102","0","24","0","N/A","cotrimoxazole"
-"","40701000089","mwikali","mwangagi","","1956-05-08 00:00:00","60","Adult","","FEMALE","NO","58","0","0","","","","","","","NO","NO","NO","2006-05-08","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-05-08","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","59","0","N/A","cotrimoxazole"
-"","40701000157","christine","muthina ngumbi","","1980-01-27 00:00:00","36","Adult","","FEMALE","NO","51.5","0","0","","","","","","","NO","NO","NO","2008-01-27","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-01-27","Lost to follow-up","NO","","","","","","2011-07-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-04-19","-1392","0","51.5","0","N/A","cotrimoxazole"
-"","40701000162","agneta","musenya kyengo","","1987-07-13 00:00:00","28","Adult","","FEMALE","NO","49","0","0","","","","","","","NO","NO","NO","2005-07-13","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2005-07-13","Lost to follow-up","NO","","","","","","2014-04-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-20","-385","0","51","0","N/A","cotrimoxazole"
-"","40701000244","richard","musyoki","","1949-12-12 00:00:00","66","Adult","","MALE","NO","46","0","0","","","","","","","NO","NO","NO","2005-12-12","IN PATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2005-12-12","Deceased","NO","","","","","","2005-12-12","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-05-20","-1361","0","46","0","N/A","cotrimoxazole"
-"","40701000289","LUCIA MWANZA","","","1981-03-15 00:00:00","34","Adult","","FEMALE","NO","36","0","0","","KYANZUKI PRI SCH","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-15","Lost to follow-up","NO","","","","","","2011-08-24","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-05-26","-1355","0","44","0","N/A","cotrimoxazole"
-"","407010003613","lilian","nthoka","kyalo","1980-02-05","36","Adult","426","FEMALE","NO","42","0","0","","","","","","","NO","NO","NO","2012-04-12","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2013-05-29","Lost to follow-up","NO","","","","","","2013-09-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-06-26","-593","0","42","0","N/A","cotrimoxazole"
-"","40701000389","bonface","muthama","","2001-02-11 00:00:00","14","Paediatric","","MALE","NO","21","0","0","","iiani pri school","","","ctx/multivit","","NO","NO","NO","2006-02-11","OUTPATIENT","GOK","ART","C1C (d4T + 3TC + NVP [20 - <30 kg])","2006-02-11","Lost to follow-up","NO","","","","","","2011-07-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-04-19","-1392","0","21","0","N/A","cotrimoxazole"
-"","40701000474","musyoki","mutua","","2007-08-05","8","Paediatric","","MALE","NO","18.2","0","0","","","","","","","NO","NO","NO","2011-04-12","TRANSFER IN","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2011-04-12","Active","NO","","","","","","2013-02-07","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","0","15.9","0","N/A","cotrimoxazole"
-"","40701000755","ann kavinya","munyao","","1973-06-09 00:00:00","42","Adult","","FEMALE","NO","54.5","0","0","","kitundu","","","","","NO","NO","NO","2011-06-09","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-06-09","Active","NO","","","","","","2013-03-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","52","0","N/A","cotrimoxazole"
-"","40701000793","christopher","munyao","","1974-08-07 00:00:00","41","Adult","","MALE","NO","53.2","0","0","","","","","","","NO","NO","NO","2007-08-07","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-08-07","Active","NO","","","","","","2012-11-20","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-01-27","-13","0","55","0","N/A","cotrimoxazole"
-"","40701000834","theresia mutheu","mbithi","","1983-03-15 00:00:00","32","Adult","","FEMALE","NO","53","0","0","","","","","","","NO","NO","NO","2011-03-15","IN PATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-07-30","NO","","OI Medicines","2014-05-01","-284","0","66","0","N/A","cotrimoxazole"
-"","40701000981","jennifer","nduku kimeu","","1984-04-20 00:00:00","31","Adult","","FEMALE","NO","53","0","0","","","","","","","NO","NO","NO","2012-04-20","IN PATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2012-04-20","Lost to follow-up","NO","","","","","","2012-11-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-08-03","-920","0","53","0","N/A","cotrimoxazole"
-"","40701001261","phyillis","mbete","kaluvu","1967-06-12 00:00:00","48","Adult","","FEMALE","NO","45","156.5","0","","","","","","","NO","NO","NO","2012-06-12","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-06-12","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-01-29","-11","0","46","0","N/A","cotrimoxazole"
-"","40701002814","rhoda","kimweli","","1944-05-11 00:00:00","72","Adult","","FEMALE","NO","44","144.9","0","","","","","ctx/multivit","","NO","NO","NO","2010-05-11","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-05-11","Lost to follow-up","NO","","","","","","2014-11-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-05","-188","0","42","0","N/A","cotrimoxazole"
-"","40701003233","daisy","fridah","hazard","1982-05-08","33","Adult","","FEMALE","NO","44","0","0","","kikima","","","","","NO","NO","NO","2011-05-06","TRANSIT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2012-02-02","Lost to follow-up","NO","","","","","","2013-11-27","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-08-29","-529","0","48","0","N/A","cotrimoxazole"
-"","40701003613","lilian","kyalo","","1979-05-03","36","Adult","","FEMALE","NO","56.6","0","0","","","","","","","NO","NO","NO","2012-12-06","OUTPATIENT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2012-12-06","Lost to follow-up","NO","","","","","","2015-01-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-15","-117","0","54","0","N/A","cotrimoxazole"
-"","4070100834","teresiah","mbithi","","1980-05-17","35","Adult","","FEMALE","NO","55.4","0","0","","","","","","","NO","NO","NO","2013-05-14","OUTPATIENT","GOK","ART","OI Medicines","","Active","NO","","","","","","2013-10-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-22","-18","0","51","0","N/A","cotrimoxazole"
-"","4070106981","magdaline","nthoki","","1980-01-12","36","Adult","","FEMALE","NO","65","0","0","","","","","","","NO","NO","NO","2008-04-08","TRANSFER IN","GOK","ART","AZT + 3TC + EFV (>15YRS ADULT)","2014-03-04","Lost to follow-up","NO","","","","","","2014-10-22","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-07-24","-200","0","60","0","N/A","cotrimoxazole"
-"","4070293","elizabeth","mbithe muunda","","1964-10-22 00:00:00","51","Adult","","FEMALE","NO","72","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-22","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-22","Lost to follow-up","NO","","","","","","2011-06-15","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-17","-1425","0","72","0","N/A","cotrimoxazole"
-"","40705000","JOSEPH","MUTHINI MUOKI","","1974-10-21 00:00:00","41","Adult","","MALE","NO","59","0","0","","","","","M/VITS","","NO","NO","NO","2008-10-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-21","Lost to follow-up","NO","","","","","","2011-01-12","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-14","-1579","0","59","0","N/A","cotrimoxazole"
-"","40705000001","MWANGANGI","MATHEKA","","1954-07-15 00:00:00","61","Adult","","MALE","NO","58.1","0","0","","","","","","","NO","NO","NO","2006-07-15","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-07-15","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-04-02","52","0","60","0","N/A","cotrimoxazole"
-"","40705000006","dorothy kilonzo","","","1983-06-20 00:00:00","32","Adult","","FEMALE","NO","63.9","0","0","","kilyungi pri sch","","","","","NO","NO","NO","2011-06-20","IN PATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-06-20","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-22","-18","0","72","0","N/A","cotrimoxazole"
-"","40705000007","shandrack","kya lo mutiso","","1973-09-20 00:00:00","42","Adult","","MALE","NO","68","0","0","","","","","","","YES","NO","NO","2006-09-20","OUTPATIENT","GOK","ART","OI ONLY","2006-09-20","Active","NO","","","","","","2013-03-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-12-03","-68","0","59","0","N/A","cotrimoxazole"
-"","40705000009","ELIZABETH","NDUNGWA MATHEKA","","1961-05-19 00:00:00","55","Adult","","FEMALE","NO","65","0","0","","","","","PIRITON,FLAGYL","","YES","NO","NO","2006-05-19","","GOK","ART","OI ONLY","2006-05-19","Lost to follow-up","NO","","","","","","2012-12-24","NO","","OI ONLY","2012-09-25","-867","0","57","0","N/A","cotrimoxazole"
-"","40705000012","rose nduku","sammy","","1983-06-09 00:00:00","32","Adult","","FEMALE","NO","61","0","0","","box 103 kilama","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-06-09","Lost to follow-up","NO","","","","","","2012-06-07","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-03-09","-1067","0","61","0","N/A","cotrimoxazole"
-"","40705000013","virginia nduku","muema","","1982-04-10 00:00:00","33","Adult","","FEMALE","NO","50","0","0","","","","","","","YES","NO","NO","2009-04-10","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-04-10","Transfer out","NO","","","","","","2009-04-10","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-13","-1307","0","50","0","N/A","cotrimoxazole"
-"","40705000014","MARY","KANINI","","1983-08-03 00:00:00","32","Adult"," ","FEMALE","NO","41","0","0","","","","","FLAGYL,AMOXYL",",","NO","NO","NO","2006-08-03","OUTPATIENT","","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-08-03","Active","NO","","0","","","","2014-05-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-25","16","0","42","0","N/A","cotrimoxazole"
-"","40705000015","DORCAS","MUTHIANI","","1976-10-09 00:00:00","39","Adult","","FEMALE","NO","62.5","0","0","","","","","FLAGYL, ALBENDAZOLE","","NO","NO","NO","2006-10-09","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-01-05","NO","","OI ONLY","2010-10-07","-1586","0","62.5","0","N/A","cotrimoxazole"
-"","40705000016","PENNINA","MANTHI","","1974-10-09 00:00:00","41","Adult","","FEMALE","NO","45.7","0","0","","","","","","","NO","NO","NO","2006-10-09","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-10-09","Active","NO","","","","","","2013-02-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-08","-32","0","44","0","N/A","cotrimoxazole"
-"","40705000020","musau joseph","","","1974-06-09 00:00:00","41","Adult","","MALE","NO","60.2","0","0","","nzeveni","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-06-09","Active","NO","","","","","","2012-11-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-25","-46","0","66","0","N/A","cotrimoxazole"
-"","40705000022","DORCUS","MUTHOKI","","1974-12-15 00:00:00","41","Adult","","FEMALE","NO","43","0","0","","","","","","","NO","NO","NO","2005-12-15","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-12-15","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","38","0","N/A","cotrimoxazole"
-"","40705000024","ANGELLA","NDUNGWA"," MUISU","1984-05-09 00:00:00","31","Adult","","FEMALE","NO","45","0","0","","","","","M/VIT","","NO","NO","NO","2007-05-09","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2007-05-09","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-25","44","0","43","0","N/A","cotrimoxazole"
-"","40705000027","EUNICE","MWIKALI","","1984-02-01 00:00:00","31","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2006-02-01","OUTPATIENT","GOK","ART","OI ONLY","2006-02-01","Active","NO","","","","","","2006-02-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-11","2","0","42.5","0","N/A","cotrimoxazole"
-"","40705000031","MATATA","DAVID","","2005-07-07 00:00:00","10","Paediatric","","MALE","NO","7.8","0","0","","","","","P/CET,PIRITON","","NO","NO","NO","2006-07-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2006-07-07","NO","","OI ONLY","2010-10-07","-1586","0","7.8","0","N/A","cotrimoxazole"
-"","40705000032","SAMMY","MUEMA","","1956-10-11 00:00:00","59","Adult","","MALE","NO","49","0","0","","","","","P/CET,PIRITON","","NO","NO","NO","2006-10-11","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-10-11","Active","NO","","","","","","2012-11-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-17","36","0","49","0","N/A","cotrimoxazole"
-"","40705000035","ALICE","MUTAVE SAMMY","","1961-11-18 00:00:00","54","Adult","","FEMALE","NO","39.3","0","0","","","","","PIRITON,AMOTID","","NO","NO","NO","2006-11-18","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-11-18","Active","NO","","","","","","2013-03-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-05","-4","0","41","0","N/A","cotrimoxazole"
-"","40705000038","JOHN","KASINZI MUNYAO","","1954-10-12 00:00:00","61","Adult","","MALE","NO","47","0","0","","","","","","","NO","NO","NO","2006-10-12","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-10-12","Lost to follow-up","NO","","","","","","2012-12-03","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-09-04","-888","0","47","0","N/A","cotrimoxazole"
-"","40705000039","RICHARD","MUTUKU","","1974-12-01 00:00:00","41","Adult","","MALE","NO","68","0","0","","","","","","","NO","NO","NO","2006-12-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2006-12-01","Lost to follow-up","NO","","","","","","2012-04-10","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-01-11","-1125","0","71","0","N/A","cotrimoxazole"
-"","40705000040","joyce wanza","","","1957-03-29 00:00:00","59","Adult","","FEMALE","NO","54","0","0","","","","","","","NO","NO","NO","2011-03-29","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-03-29","Active","NO","","","","","","2013-02-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-19","10","0","49","0","N/A","cotrimoxazole"
-"","40705000042","DORCAS","MUMBUA NTHIWA","","1974-01-08 00:00:00","42","Adult","","FEMALE","NO","66.7","0","0","","","","","","","NO","NO","NO","2007-01-08","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-01-08","Active","NO","","","","","","2013-04-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-07","57","0","53.5","0","N/A","cotrimoxazole"
-"","40705000043","KYALO","JONES","","1975-01-15 00:00:00","41","Adult","","MALE","NO","51","0","0","","MAKUENI DISTRICT- KITUNDU LOCATION","","","KETACONAZOLE","","NO","NO","NO","2007-01-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-01-15","Active","NO","","","","","","2012-11-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","45","0","N/A","cotrimoxazole"
-"","40705000046","JANET","KYALO","","1985-01-30 00:00:00","30","Adult"," ","FEMALE","NO","74.5","160","0","","","","","BRUFEN,M-VIT,",",","NO","NO","NO","2007-01-30","OUTPATIENT","","ART","OI ONLY","","Active","NO","","0","","","","2007-01-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","68.5","0","N/A","Dapsone"
-"","40705000051","ANN","MBITHE MATIVO","","1973-02-12 00:00:00","43","Adult","","FEMALE","NO","46.2","0","0","","","","","FLUCONAZOLE","","NO","NO","NO","2007-02-12","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-02-12","Active","NO","","","","","","2014-02-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-22","-18","0","36","0","N/A","cotrimoxazole"
-"","40705000056","syombua","maiani","","2003-03-12 00:00:00","12","Paediatric","","FEMALE","NO","27.8","116","0","","kilyungi pri","","","septrin/multivit","","NO","NO","NO","2007-03-12","OUTPATIENT","GOK","ART","CF1A (AZT + 3TC + NVP [10 - <20 kg])","2007-03-12","Active","NO","","","","","","2014-08-13","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-09","-31","116","14","0","N/A","cotrimoxazole"
-"","40705000058","MULWA","MUTHOKA","","2003-02-14 00:00:00","12","Paediatric","","MALE","NO","32.2","134","0","","","","","COTRIMOXAZOLE","","NO","NO","NO","2007-02-14","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-02-14","Active","NO","","","","","","2012-12-20","NO","","AZT + 3TC + EFV (< 15YRS PAED)","2015-01-16","-24","0","12","0","N/A","cotrimoxazole"
-"","40705000061","PENNINA","KYALO","","1986-10-02 00:00:00","29","Adult","","FEMALE","NO","53","0","0","","","","","","","YES","NO","NO","2005-10-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-10-02","Lost to follow-up","NO","","","","","","2012-05-17","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-02-17","-1088","0","49","0","N/A","cotrimoxazole"
-"","40705000063","WANZA","MUTAVI","","1977-07-10 00:00:00","38","Adult","","FEMALE","NO","54","0","0","","","","","M/VIT, FLAGYL","","YES","NO","NO","2007-07-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-10","Lost to follow-up","NO","","","","","","2012-04-30","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-01-31","-1105","0","60","0","N/A","cotrimoxazole"
-"","40705000071","muendi","mwikali","","2003-12-02 00:00:00","11","Paediatric","","FEMALE","NO","20","0","0","","","","","","","NO","NO","NO","2008-12-02","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-05-15","NO","","OI Medicines","2014-02-14","-360","0","15","0","N/A","cotrimoxazole"
-"","40705000073","KYALO","IVINYU","","1977-03-27 00:00:00","38","Adult","","MALE","NO","64","0","0","","","","","PIRITON, M/VIT","","NO","NO","NO","2007-03-27","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-29","NO","","OI ONLY","2012-07-31","-923","0","61","0","N/A","cotrimoxazole"
-"","40705000076","janet","minoo","","1988-09-08","27","Adult","426","FEMALE","NO","51.5","0","0","","","","","","","NO","NO","NO","2011-05-06","OUTPATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2013-06-06","Active","NO","","","","","","2013-06-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-28","-12","0","56","0","N/A","cotrimoxazole"
-"","40705000078","JANET","MINOO","","1986-03-01 00:00:00","29","Adult","","FEMALE","NO","54","0","0","","","","","M/VIT, PIRITON,","","NO","NO","NO","2007-03-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-03-01","Lost to follow-up","NO","","","","","","2012-03-19","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-12-20","-1147","0","61.5","0","N/A","cotrimoxazole"
-"","40705000079","josphat","musyoka makau","","1947-02-15 00:00:00","69","Adult","","MALE","NO","54","0","0","","","","","","","NO","NO","NO","2007-02-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-02-15","Active","NO","","","","","","2012-11-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","52","0","N/A","cotrimoxazole"
-"","40705000081","ALICE","NDINDA MUIA","","1967-04-19 00:00:00","49","Adult","","FEMALE","NO","69.6","0","0","","","","","AMOXYL, P/CET","","NO","NO","NO","2007-04-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-04-19","Active","NO","","","","","","2013-03-04","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-03-17","36","0","62.5","0","N/A","cotrimoxazole"
-"","40705000082","JOHNSON","MUTUKU","","1911-04-10 00:00:00","105","Adult","","MALE","NO","54","0","0","","","","","PIRITON, AMOXYL, COARTERM.","","YES","NO","NO","2007-04-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-04-10","Lost to follow-up","NO","","","","","","2012-09-27","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2012-06-29","-955","0","96","0","N/A","cotrimoxazole"
-"","40705000083","ANNAH","NDINGO","","1957-09-28 00:00:00","58","Adult","","FEMALE","NO","63","0","0","","","","","PIRITON, M/VIT","","YES","NO","NO","2007-09-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-09-28","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-20","-20","0","48","0","N/A","cotrimoxazole"
-"","40705000086","MUTINDI","KISOLO","","1989-04-30 00:00:00","26","Adult","","FEMALE","NO","35","0","0","","","","","M/VIT, PIRITON","","NO","NO","NO","2007-04-30","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2007-04-30","NO","","OI ONLY","2010-10-08","-1585","0","35","0","N/A","cotrimoxazole"
-"","40705000089","ESTHER ndoti","MUTETI","","1978-05-11 00:00:00","37","Adult","","FEMALE","NO","48","0","0","","","","","PIRITON, ALBENDAZOLE, P/CET.","","YES","NO","NO","2007-05-11","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-05-11","Active","NO","","","","","","2013-02-18","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-21","-19","0","41","0","N/A","cotrimoxazole"
-"","40705000090","AGNES MUIA","","","1969-03-15 00:00:00","47","Adult","","FEMALE","NO","40","0","0","","KALIANI","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-15","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-03","22","0","38","0","N/A","cotrimoxazole"
-"","40705000095","MUTUNGA","NZIOKI","","1998-05-15 00:00:00","17","Adult","","MALE","NO","29","140","0","","P O BOX 60 MBOONI","","","M/VIT, ABZ","","NO","NO","NO","2007-05-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-05-15","Lost to follow-up","NO","","","","","","2011-11-14","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-08-16","-1273","0","15","0","N/A","cotrimoxazole"
-"","40705000096","ZIPORAH","MULEI","","1970-06-16 00:00:00","45","Adult","","FEMALE","NO","49.5","0","0","","P O BOX 347 KIKIMA","","","M/VIT, AMOXYL.","","NO","NO","NO","2007-06-16","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-06-16","Active","NO","","","","","","2012-12-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-05","-4","0","50","0","N/A","cotrimoxazole"
-"","40705000097","MBATHA","MARTIN","","2005-06-19 00:00:00","10","Paediatric"," ","MALE","NO","19","0","0","","P O BOX 347 KIKIMA","","","P-CET,PIRITON,M-VIT.",",","NO","NO","NO","2007-06-19","IN PATIENT","","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-06-19","Active","NO","","0","","","","2012-12-27","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-01-05","-35","0","10.9","0","N/A","cotrimoxazole"
-"","40705000098","MWIKALI","MUTUKU","","1995-05-03 00:00:00","20","Adult","","FEMALE","NO","49","0","0","","","","","AMOXYL, P/CET,ALBENDAZOLE,HYDROCORTISOME CREAM","","NO","NO","NO","2007-05-03","TRANSFER IN","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-05-03","Active","NO","","","","","","2013-03-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-14","-26","0","25","0","N/A","cotrimoxazole"
-"","40705000099","NZILANI","GLADYS MWANZIA","","1980-05-29 00:00:00","35","Adult","","FEMALE","NO","49.5","143","0","","","","","M/VIT,PIRITON, COARTERM.","","NO","NO","NO","2007-05-29","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-05-29","Active","NO","","","","","","2012-12-20","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-05","-4","0","44.5","0","N/A","cotrimoxazole"
-"","40705000104","susan","mutindi","","1951-09-21 00:00:00","64","Adult","","FEMALE","NO","50","2.28","0","","64 kikima","","","","","NO","NO","NO","2010-09-21","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-09-21","Active","NO","","","","","","2012-12-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-17","36","2.28","52","0","N/A","cotrimoxazole"
-"","40705000105","anthony","makau","musau","1972-12-10","43","Adult","","MALE","NO","55","0","0","","","","","","","NO","NO","NO","2014-01-30","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2014-11-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-19","-174","0","50","0","N/A","cotrimoxazole"
-"","40705000107","elizabeth","muthiani","","1981-09-06 00:00:00","34","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2010-09-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-09-06","Lost to follow-up","NO","","","","","","2012-03-29","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-12-30","-1137","0","46","0","N/A","cotrimoxazole"
-"","40705000108","regina","nthenya wambua","","1975-04-20 00:00:00","40","Adult","","FEMALE","NO","49.5","0","0","","","","","","","NO","NO","NO","2007-04-20","TRANSFER IN","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2007-04-20","Active","NO","","","","","","2012-11-29","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-17","8","0","51","0","N/A","cotrimoxazole"
-"","40705000110","regina","nthenya wambua","","1975-04-08 00:00:00","40","Adult","","FEMALE","NO","49","0","0","","","","","septrin/m/vit","","NO","NO","NO","2007-04-08","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-04-08","Lost to follow-up","NO","","","","","","2011-09-12","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-06-14","-1336","0","59","0","N/A","cotrimoxazole"
-"","40705000115","mary","penina muoka","","1973-07-15 00:00:00","42","Adult","","FEMALE","NO","54","0","0","","mavindu village","","","septrin.m/vit","","NO","NO","NO","2006-07-15","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-07-15","Active","NO","","","","","","2013-03-11","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-19","10","0","54","0","N/A","cotrimoxazole"
-"","40705000116","phylis","mwelu mutisya","","1959-06-13 00:00:00","56","Adult","","FEMALE","NO","58","155","0","","","","","","","NO","NO","NO","2007-06-13","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2007-06-13","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","67","0","N/A","cotrimoxazole"
-"","40705000119","martha","mutanu ndavi","","1957-07-30 00:00:00","58","Adult","","FEMALE","NO","46","0","0",""," mutitu village, kyanguma","","","m/vt, septrin","","NO","NO","NO","2007-07-30","TRANSFER IN","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-07-30","Active","NO","","","","","","2013-04-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-25","44","0","45","0","N/A","cotrimoxazole"
-"","40705000120","muoka","muema","","1960-04-15 00:00:00","56","Adult","","MALE","NO","55","161","0","","mavindu village","","","septrin, m/vit","","YES","NO","NO","2005-04-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-04-15","Active","NO","","","","","","2013-04-04","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-11","2","0","52","0","N/A","cotrimoxazole"
-"","40705000121","elizabeth","kimuyu","munyiva","1975-11-12 00:00:00","40","Adult","","MALE","NO","70","0","0","","","","","","","NO","NO","NO","2011-11-12","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-11-12","Active","NO","","","","","","2012-12-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-03","22","0","43","0","N/A","cotrimoxazole"
-"","40705000122","munyao","kanini","","2000-08-01 00:00:00","15","Adult","","MALE","NO","33.4","100","0","","kitundu village","","","septrin, m/vit","","NO","NO","NO","2007-08-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-08-01","Active","NO","","","","","","2012-12-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","100","20","0","N/A","cotrimoxazole"
-"","40705000124","ronarld","kyalo","","1966-07-09 00:00:00","49","Adult","","MALE","NO","77.5","0","0","","uthiuni village","","","SEPTRIN, M/VIT","","YES","NO","NO","2007-07-09","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-07-09","Lost to follow-up","NO","","","","","","2012-10-25","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-07-27","-927","0","70","0","N/A","cotrimoxazole"
-"","40705000125","SUSAN","NGINA MWALUKO","","1973-08-07 00:00:00","42","Adult","","FEMALE","NO","48.3","0","0","","","","","","","YES","NO","NO","2007-08-07","OUTPATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2007-08-07","Deceased","NO","","","","","","2007-08-07","NO","","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2011-03-16","-1426","0","48.3","0","N/A","cotrimoxazole"
-"","40705000138","WANZA","MUTHIANI","","1983-07-17 00:00:00","32","Adult","","MALE","NO","45","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-07-17","TRANSFER IN","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2007-07-17","Deceased","NO","","","","","","2007-07-17","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-13","-1307","0","48","0","N/A","cotrimoxazole"
-"","40705000141","JANIFA","WANYUA","","1983-07-31 00:00:00","32","Adult","","FEMALE","NO","56","164","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-07-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-31","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","50","0","N/A","cotrimoxazole"
-"","40705000143","NICHOLUS","IIA MUNUVE","","1965-07-15 00:00:00","50","Adult","","MALE","NO","46","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-07-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-15","Active","NO","","","","","","2012-12-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","49","0","N/A","cotrimoxazole"
-"","40705000144","JOSEPH","KIOKO KITONGA","","1973-09-18 00:00:00","42","Adult","","MALE","NO","43","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-09-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-09-18","Lost to follow-up","NO","","","","","","2012-03-26","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-27","-1140","0","45","0","N/A","cotrimoxazole"
-"","40705000148","WAMBUA","NDOLO","","2006-07-10 00:00:00","9","Paediatric","","MALE","NO","20","107","0","","","","","","","NO","NO","NO","2009-07-10","TRANSFER IN","GOK","ART","CF3A (D4t + 3TC + NVP","2009-07-10","Active","NO","","","","","","2012-12-27","NO","","ABC + 3TC + EFV (< 15YRS PAED)","2015-01-05","-35","100","13","0","N/A","cotrimoxazole"
-"","40705000153","JANET","MBITHE","","1985-12-18 00:00:00","30","Adult","","FEMALE","NO","75","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-12-18","TRANSFER IN","GOK","ART","TDF + 3TC + LPV/r (>15YRS ADULT)","2007-12-18","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-25","16","0","69","0","N/A","cotrimoxazole"
-"","40705000157","WINFRED","MUKONYO KELI","","1980-12-10 00:00:00","35","Adult","","FEMALE","NO","50","0","0","","KILENGE VILLAGE","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-12-10","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-11","NO","","OI ONLY","2011-07-13","-1307","0","46.5","0","N/A","cotrimoxazole"
-"","40705000157m","ngumbau","muthina","","1982-08-10","33","Adult","","FEMALE","NO","51","0","0","","","","","","","NO","NO","NO","2006-02-11","TRANSIT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2006-02-11","Lost to follow-up","NO","","","","","","2013-02-05","NO","","AZT+3TC+NVP (>15YRS ADULT)","2012-11-07","-824","0","51","0","N/A","cotrimoxazole"
-"","40705000160","ANGELINA","MUTINDA","","1953-10-19 00:00:00","62","Adult","","FEMALE","NO","44","0","0",""," MUTITU VILLAGE","","","SEPTRIN, M/VIT","","NO","NO","NO","2007-10-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-10-19","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-03","22","0","38","0","N/A","cotrimoxazole"
-"","40705000161","EUNICE","MUTUKU","MWIKALI","1973-02-25 00:00:00","43","Adult","","FEMALE","NO","56.3","0","0","","NZEVENI VILLLAGE","","","SEPTRIN, M/VIT","","NO","NO","NO","2008-02-25","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-25","Active","NO","","","","","","2013-01-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","63","0","N/A","cotrimoxazole"
-"","40705000163","ROSE MUVIKU","KATIKU","","1958-03-15 00:00:00","58","Adult","","FEMALE","NO","58","0","0","","MAVINDU","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-15","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-20","-20","0","58","0","N/A","cotrimoxazole"
-"","40705000165","CHARLES","MUTISYA NGUI","","1964-02-05 00:00:00","52","Adult","","MALE","NO","56.5","168","0","","mutitu kalima village","","","septrin, m/vit","","NO","NO","NO","2008-02-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-05","Active","NO","","","","","","2013-03-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","16","49","0","N/A","cotrimoxazole"
-"","40705000167","JOSEPHINE","MBITHE MUSANGO","","1958-02-08 00:00:00","58","Adult","","FEMALE","NO","52.2","0","0","","","","","M/VIT, PIRITON,","","NO","NO","NO","2008-02-08","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-08","Active","NO","","","","","","2012-12-03","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-17","36","0","51","0","N/A","cotrimoxazole"
-"","40705000170","GEORGE","WAMBUA","","1945-02-08 00:00:00","71","Adult","","MALE","NO","56","0","0","","","","","M/VITS, ABZ","","NO","NO","NO","2008-02-08","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-08","Active","NO","","","","","","2013-02-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","66","0","N/A","cotrimoxazole"
-"","40705000173","joyce","rael jeremiah","","1970-01-31 00:00:00","46","Adult","","FEMALE","NO","47","163","0","","UVUU VILLAGE","","","SEPTRIN, M/VIT","","NO","NO","NO","2008-01-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-01-31","Active","NO","","","","","","2012-12-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","47","0","N/A","cotrimoxazole"
-"","40705000175","ALFONSE","MUSEE MUIA","","2003-03-03 00:00:00","12","Paediatric","","MALE","NO","26","0","0","","","","","PIRITON, M/VITS","","NO","NO","NO","2008-03-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-03-03","Active","NO","","","","","","2012-12-10","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","16","0","N/A","cotrimoxazole"
-"","40705000176","PENNINAH","MUTUNGA","NDILA","1982-02-18 00:00:00","33","Adult","","FEMALE","NO","84","0","0","","","","","M/VITS, PIRITON.","","NO","NO","NO","2008-02-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-18","Active","NO","","","","","","2013-01-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","47","0","N/A","cotrimoxazole"
-"","40705000180","EUNICE","NDUKU MUTINDA","","1978-03-31 00:00:00","37","Adult","","FEMALE","NO","68.6","0","0","","","","","M/VITS, PIRITON, COATERM","","NO","NO","NO","2008-03-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-03-31","Active","NO","","","","","","2013-01-23","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-22","-18","0","52","0","N/A","cotrimoxazole"
-"","40705000181","AGNES","KIITI","","1960-03-10 00:00:00","56","Adult","","FEMALE","NO","47.2","157","0","","","","","M/VITS","","NO","NO","NO","2008-03-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-03-10","Active","NO","","","","","","2013-03-19","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-02-10","1","0","44","0","N/A","cotrimoxazole"
-"","40705000182","DORCAS","NDUNGE NZIOKA","","1975-03-06 00:00:00","41","Adult","","FEMALE","NO","45","0","0","","","","","ALBENDAZOLE, COATERM, FLAGYL","","NO","NO","NO","2008-03-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-03-06","Active","NO","","","","","","2012-03-08","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-10","1","0","45","0","N/A","cotrimoxazole"
-"","40705000184","EUNICE","MWONGELI MUTISYA","","1978-01-12 00:00:00","38","Adult","","FEMALE","NO","40","0","0","","","","","PIRITON, COATERM, M/VITS","","NO","NO","NO","2008-01-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-01-12","Lost to follow-up","NO","","","","","","2013-03-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-12-11","-790","0","34","0","N/A","cotrimoxazole"
-"","40705000185","ELIZABETH","MULU","","1981-04-10 00:00:00","34","Adult","","FEMALE","NO","48.5","0","0","","","","","M/VITS,","","NO","NO","NO","2008-04-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-04-10","Active","NO","","","","","","2012-12-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","38","0","N/A","cotrimoxazole"
-"","40705000187","veronica","mutua","","1982-04-15 00:00:00","33","Adult","","FEMALE","NO","49","0","0","","","","","","","NO","NO","NO","2008-04-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-04-15","Lost to follow-up","NO","","","","","","2011-10-20","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-07-22","-1298","0","50","0","N/A","cotrimoxazole"
-"","40705000190","KATHINA","MANTHI","","2002-04-11 00:00:00","13","Paediatric","","FEMALE","NO","25","119.9","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2008-04-11","OUTPATIENT","GOK","ART","CF1A (AZT + 3TC + NVP [10 - <20 kg])","2008-04-11","Active","NO","","","","","","2013-03-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-08","-32","0","123","0","N/A","cotrimoxazole"
-"","40705000191n","irene","mulinge","","1991-05-04","24","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-10-10","CASUALTY","GOK","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2012-10-10","PEP end","NO","","","","","","2012-11-09","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2012-11-07","-824","0","50","0","N/A","cotrimoxazole"
-"","40705000192","JEREMIAH","KYAMA KATIKU","","1965-04-30 00:00:00","51","Adult","","MALE","NO","40.3","0","0","","","","","PIRITON, M/VITS","","YES","NO","NO","2008-04-30","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-04-30","Lost to follow-up","NO","","","","","","2014-08-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-05-06","-279","0","51","0","N/A","cotrimoxazole"
-"","40705000195","sharron","muindi","","2005-02-10 00:00:00","10","Paediatric","","FEMALE","NO","24","117.9","0","","nzeveni primary","","","cotrimoxazole,multivitamin","","NO","NO","NO","2009-02-10","OUTPATIENT","GOK","ART","CF1A (AZT + 3TC + NVP [10 - <20 kg])","2009-02-10","Active","NO","","","","","","2012-12-20","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-01-07","-33","0","16","0","N/A","cotrimoxazole"
-"","40705000197","FREDRICK","MUTUKU MUENDO","","1990-04-17 00:00:00","25","Adult","","MALE","NO","47","0","0","","","","","M/VITS, PIRITON,","","NO","NO","NO","2008-04-17","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-04-17","Active","NO","","","","","","2012-12-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-12-10","-61","0","50","0","N/A","cotrimoxazole"
-"","40705000198","ELIZABETH","KANINI MUSYOKA","","1964-05-13 00:00:00","51","Adult","","FEMALE","NO","44","0","0","","","","","M/VITS, KETAKONAZOLE","","NO","NO","NO","2008-05-13","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-05-13","Active","NO","","","","","","2012-12-20","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-27","18","0","40","0","N/A","cotrimoxazole"
-"","40705000199","JACKLINE","NDULU MULEI","","1977-08-23 00:00:00","38","Adult","","FEMALE","NO","53","155","0","","","","","PIRITON, M/VITS","","NO","NO","NO","2005-08-23","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-08-23","Lost to follow-up","NO","","","","","","2014-05-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-13","-361","0","63","0","N/A","cotrimoxazole"
-"","40705000200","MARY","WANGUI JUMA","","1977-01-31 00:00:00","39","Adult","","FEMALE","NO","75.5","0","0","","","","","M/VITS","","NO","NO","NO","2006-01-31","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2015-01-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-10-27","-105","0","75","0","N/A","cotrimoxazole"
-"","40705000201","ndanu","kavindu","","2002-04-01 00:00:00","13","Paediatric","","FEMALE","NO","26","116.5","0","","","","","septrin, m/vit","","NO","NO","NO","2008-04-01","OUTPATIENT","GOK","ART","C1B (d4T + 3TC + NVP [10 - <20 kg])","2008-04-01","Active","NO","","","","","","2013-04-11","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","16","0","N/A","cotrimoxazole"
-"","40705000202","KYALO","MAWIOO","","2002-05-16 00:00:00","13","Paediatric","","MALE","NO","33.9","0","0","","","","","SEPTRIN, M/VITS COATERM","","NO","NO","NO","2008-05-16","TRANSFER IN","GOK","","OI ONLY","","Active","NO","","","","","","2008-05-16","NO","","OI ONLY","2015-01-08","-32","0","19","0","N/A","cotrimoxazole"
-"","40705000203","IRENE","MWIKALI","","1981-08-27 00:00:00","34","Adult","","FEMALE","NO","51.4","0","0","","","","","PIRITON, M/VITS, P/CET, COATERM","","NO","NO","NO","2008-08-27","TRANSFER IN","GOK","ART","OI ONLY","","Active","NO","","","","","","2008-08-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-08","-32","0","46","0","N/A","cotrimoxazole"
-"","40705000204","muli","florence","","1980-05-08","35","Adult","426","FEMALE","NO","63.8","146","0","701681933","nzeveni","","","","","NO","NO","NO","2008-08-09","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2010-06-09","Active","NO","","","","","","2013-07-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-22","-18","146","56","0","N/A","cotrimoxazole"
-"","40705000205","EUNICE","NYAMASYO","","1970-05-12 00:00:00","45","Adult","","FEMALE","NO","50","0","0","","","","","M/VIT, P/CET, TINIDAZOLE","","NO","NO","NO","2008-05-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-05-12","Active","NO","","","","","","2012-11-29","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-11","2","0","46","0","N/A","cotrimoxazole"
-"","40705000207","veronicah kanini","muthe","","1984-06-20 00:00:00","31","Adult","","FEMALE","NO","47","0","0","","syathani pri sch","","","","","NO","NO","NO","2011-06-20","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-06-20","Lost to follow-up","NO","","","","","","2011-10-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-07-20","-1300","0","47","0","N/A","cotrimoxazole"
-"","40705000208","ANGELA","MBUVI","","1972-04-21 00:00:00","43","Adult","","FEMALE","NO","36","0","0","","","","","M/VITS","","NO","NO","NO","2008-04-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-04-21","Lost to follow-up","NO","","","","","","2012-12-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-10-01","-861","0","46","0","N/A","cotrimoxazole"
-"","40705000210","MUMO","KINGOO","","2002-05-27 00:00:00","13","Paediatric","","MALE","NO","19","0","0","","","","","M/VITS, AMOXYL, PIRITON.","","YES","NO","NO","2008-05-27","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-05-27","Lost to follow-up","NO","","","","","","2012-07-03","NO","","CF1B(AZT + 3TC + EFV [30 - <40 kg])","2012-04-04","-1041","0","17","0","N/A","cotrimoxazole"
-"","40705000215","JOSEPHINE","KALOKI","","1970-06-09 00:00:00","45","Adult","","FEMALE","NO","51","0","0","","","","","M/VITS, AMOXYL, FLAGYL.","","NO","NO","NO","2008-06-09","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-06-09","Active","NO","","","","","","2012-12-27","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-03-04","23","0","50","0","N/A","cotrimoxazole"
-"","40705000217","JOSECORDIAN","NZILANI MUTIKU","","1980-07-15 00:00:00","35","Adult","","FEMALE","NO","57.5","0","0","","","","","M/VITS, AMOXYL, BRUFEN","","YES","NO","NO","2008-07-15","OUTPATIENT","PEPFAR","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-07-15","Lost to follow-up","NO","","","","","","2014-01-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-31","-466","0","58","0","N/A","cotrimoxazole"
-"","40705000219","wambua","mueni","","1999-04-08 00:00:00","16","Adult","","MALE","NO","27.9","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-04-08","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-04-08","Active","NO","","","","","","2012-11-20","NO","","AZT + 3TC + EFV (< 15YRS PAED)","2015-01-13","-27","0","20","0","N/A","cotrimoxazole"
-"","40705000219`","MUMBUA","MUENI","","1999-04-08 00:00:00","16","Adult","","FEMALE","NO","20","0","0","","","","","M/VITS, BRUFEN","","YES","NO","NO","2008-04-08","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-04-08","Stopped due to duplication","NO","","","","","","2008-04-08","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-10-14","-1579","0","20","0","N/A","cotrimoxazole"
-"","40705000221","MUEMA","PAUL NYAUI","","2002-07-30 00:00:00","13","Paediatric","","MALE","NO","14","0","0","","","","","M/VITS, BRUFEN,","","NO","NO","NO","2008-07-30","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-07-30","Deceased","NO","","","","","","2008-07-30","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-14","-1579","0","14","0","N/A","cotrimoxazole"
-"","40705000222","PAUL","NYAUI MATHUKI","","1962-07-03 00:00:00","53","Adult","","MALE","NO","50","0","0","","","","","M/VITS, BRUFEN","","NO","NO","NO","2008-07-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2008-07-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","50","0","N/A","cotrimoxazole"
-"","40705000223","daniel","kivuva","","1960-06-25 00:00:00","55","Adult","","MALE","NO","71.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-06-25","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2008-06-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-17","8","0","65","0","N/A","cotrimoxazole"
-"","40705000224","JONES","MAILU","","1943-07-01 00:00:00","73","Adult","","MALE","NO","55","0","0","","","","","M/VITS, FLAGYL,BRUFEN","","NO","NO","NO","2008-07-01","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-07-01","Lost to follow-up","NO","","","","","","2012-03-13","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-12-14","-1153","0","60","0","N/A","cotrimoxazole"
-"","40705000226","ROSE","LOKO MAWEU","","1972-07-11 00:00:00","43","Adult","","FEMALE","NO","49","0","0","","","","","M/VITS, AMOXYL","","YES","NO","NO","2008-07-11","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-07-11","Active","NO","","","","","","2013-04-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","46","0","N/A","cotrimoxazole"
-"","40705000228","onesmus mwanza","maundu","","1976-07-18 00:00:00","39","Adult","","MALE","NO","54","0","0","","kyangoma pri sch","","","","","NO","NO","NO","2008-07-18","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2008-07-18","Active","NO","","","","","","2012-12-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","51","0","N/A","cotrimoxazole"
-"","40705000230","JOHN","MUSYIMI","","1950-07-30 00:00:00","65","Adult","","MALE","NO","49.4","0","0","","","","","M/VITS, COATERM","","YES","NO","NO","2007-07-30","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-30","Active","NO","","","","","","2013-01-31","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-06","-34","0","46","0","N/A","cotrimoxazole"
-"","40705000231","NAHASON","MUINDI MBUVI","","1963-07-22 00:00:00","52","Adult","","MALE","NO","47","0","0","","","","","PIRITON, M/VITS, BRUFEN","","YES","NO","NO","2008-07-22","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-07-22","Active","NO","","","","","","2012-12-06","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-29","-11","0","48","0","N/A","cotrimoxazole"
-"","40705000233","ANTONY","MUTUA","","2000-07-31 00:00:00","15","Adult","","FEMALE","NO","33","0","0","","","","","M/VIT, BRUFEN","","NO","NO","NO","2008-07-31","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2008-07-31","NO","","OI ONLY","2011-05-03","-1378","0","27","0","N/A","cotrimoxazole"
-"","40705000234","KIMATU","NDAA","","1973-12-02 00:00:00","42","Adult","","MALE","NO","53","0","0","","","","","M/VITS, COATERM, PIRITON","","YES","NO","NO","2008-12-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-12-02","Lost to follow-up","NO","","","","","","2014-05-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-25","-349","0","54","0","N/A","cotrimoxazole"
-"","40705000235","jackson","wambua","","1976-07-27 00:00:00","39","Adult","","MALE","NO","56","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-07-27","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-07-27","Active","NO","","","","","","2013-03-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-09","0","0","49","0","N/A","cotrimoxazole"
-"","40705000236","MWENDE","MUSANGO","","1980-08-04 00:00:00","35","Adult","","FEMALE","NO","47","0","0","","","","","FLAGYL, M/VITS,P/CET","","NO","NO","NO","2008-08-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-08-04","Deceased","NO","","","","","","2008-08-04","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-02-03","-1102","0","45","0","N/A","cotrimoxazole"
-"","40705000238","SARAH","NDUNGE MUENDO","","1966-07-29 00:00:00","49","Adult","","FEMALE","NO","43","0","0","","","","","M/VITS, AMOXYL","","YES","NO","NO","2008-07-29","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-07-29","Active","NO","","","","","","2012-12-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","45","0","N/A","cotrimoxazole"
-"","40705000239","FAITH","MWIKALI","","2002-08-18 00:00:00","13","Paediatric","","FEMALE","NO","45","111.6","0","","","","","PIRITON, BRUFEN, M/VITS","","YES","NO","NO","2008-08-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-08-18","Lost to follow-up","NO","","","","","","2014-04-16","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-01-16","-389","0","14","0","N/A","cotrimoxazole"
-"","40705000240","MWONGELI","JEREMIAH","","1998-08-19 00:00:00","17","Adult","","FEMALE","NO","35.4","0","0","","","","","M/VITS, PIRITON,","","NO","NO","NO","2008-08-19","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-08-19","Active","NO","","","","","","2012-10-24","NO","","AZT + 3TC + EFV (< 15YRS PAED)","2015-01-13","-27","0","24.5","0","N/A","cotrimoxazole"
-"","40705000241","PHYLLIS","KIMEU","","1955-09-16 00:00:00","60","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2008-09-16","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-09-16","Active","NO","","","","","","2013-02-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","54","0","N/A","cotrimoxazole"
-"","40705000249","damaris","ndaisi kyalo","","1984-07-14 00:00:00","31","Adult","","FEMALE","NO","34.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-07-14","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-07-14","Lost to follow-up","NO","","","","","","2012-07-13","NO","","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2012-04-14","-1031","0","45","0","N/A","cotrimoxazole"
-"","40705000251","joseph","muthini muoki","","1974-08-21 00:00:00","41","Adult","","MALE","NO","59","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-08-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-08-21","Lost to follow-up","NO","","","","","","2011-06-15","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-17","-1425","0","59","0","N/A","cotrimoxazole"
-"","40705000253","jackline","wambua","","1986-02-03","29","Adult","","FEMALE","NO","47.2","0","0","","","","","","","NO","NO","NO","2008-09-09","pmtct","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2008-09-09","Lost to follow-up","NO","","","","","","2014-07-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-04-29","-286","0","47.2","0","N/A","cotrimoxazole"
-"","40705000254","CATHERINE","NDUKU MUTINDA","","1970-08-26 00:00:00","45","Adult","","FEMALE","NO","47","0","0","","","","","M/VITS, PIRITON","","NO","NO","NO","2008-08-26","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-08-26","Active","NO","","","","","","2012-11-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-25","44","0","41","0","N/A","cotrimoxazole"
-"","40705000255","STEPHEN","MUTHOKA KIMEU","","1974-03-31 00:00:00","41","Adult","","MALE","NO","56","0","0","","","","","M/VIT,","","NO","NO","NO","2009-03-31","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-03-31","Active","NO","","","","","","2013-02-04","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-02-17","8","0","57","0","N/A","cotrimoxazole"
-"","40705000256","MUTETI","DAVID","","1967-11-18 00:00:00","48","Adult","","MALE","NO","54.5","0","0","","","","","M/VITS","","NO","NO","NO","2008-11-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-18","Active","NO","","","","","","2013-02-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","52","0","N/A","cotrimoxazole"
-"","40705000257","JAMES","KYAMBO MUSYOKA","","1967-10-21 00:00:00","48","Adult","","MALE","NO","51.9","165","0","","","","","M/VITS,","","NO","NO","NO","2008-10-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-21","Active","NO","","","","","","2013-03-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","46","0","N/A","cotrimoxazole"
-"","40705000258","joseph","mwanzia kimeu","","1975-09-04 00:00:00","40","Adult","","MALE","NO","57","0","0","","matta village","","","septrin, m/vit","","NO","NO","NO","2008-09-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-09-04","Active","NO","","","","","","2013-03-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","55","0","N/A","cotrimoxazole"
-"","40705000260","martha","kisilu kimulu","","1972-06-05 00:00:00","43","Adult","","FEMALE","NO","54.2","0","0","","nzeveni village","","","septrin, m/vit","","NO","NO","NO","2007-06-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-06-05","Active","NO","","","","","","2012-12-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","0","49","0","N/A","cotrimoxazole"
-"","40705000261","susan","mutinda mbwika","","1973-08-08 00:00:00","42","Adult","","FEMALE","NO","54","0","0","","mataa village","","","septrin, m/vit","","NO","NO","NO","2008-08-08","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-08-08","Lost to follow-up","NO","","","","","","2012-03-08","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-09","-1158","0","46","0","N/A","cotrimoxazole"
-"","40705000262","ann","munyiva mutua","","1980-09-19 00:00:00","35","Adult","","FEMALE","NO","55","0","0","","mwanyani village","","","SEPTRIN, M/VIT","","NO","NO","NO","2008-09-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-09-19","Lost to follow-up","NO","","","","","","2012-09-13","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2012-06-15","-969","0","41","0","N/A","cotrimoxazole"
-"","40705000263","JOSEPHINE","MBITHE MWANGANGI","","1978-09-23 00:00:00","37","Adult","","FEMALE","NO","41.6","0","0","","kyuu village","","","septrin, m/vit","","NO","NO","NO","2008-09-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-06-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-03-05","-341","0","53","0","N/A","cotrimoxazole"
-"","40705000264","nancy","mwanzia","","1976-09-23 00:00:00","39","Adult","","FEMALE","NO","72","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-09-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-06-28","NO","","OI ONLY","2012-03-30","-1046","0","72","0","N/A","cotrimoxazole"
-"","40705000266","margret","mutunge mavi","","1971-09-29 00:00:00","44","Adult","","FEMALE","NO","50","0","0","","","","","m/vit, septrin","","NO","NO","NO","2008-09-29","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-02-13","NO","","OI ONLY","2011-11-15","-1182","0","48","0","N/A","cotrimoxazole"
-"","40705000268","erick","keli mutunge","","2005-09-30 00:00:00","9","Paediatric","","MALE","NO","16","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-09-30","TRANSFER IN","GOK","ART","CF3A (D4t + 3TC + NVP","2008-09-30","Lost to follow-up","NO","","","","","","2011-12-04","NO","","CF1A (AZT + 3TC + NVP [10 - <20 kg])","2011-09-05","-1253","0","8","0","N/A","cotrimoxazole"
-"","40705000269","joshua","wambua kimuyu","","1976-09-30 00:00:00","39","Adult","","MALE","NO","52","0","0","","","","","SEPTRIN, M/VIT","","YES","NO","NO","2008-09-30","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-15","NO","","OI ONLY","2011-03-17","-1425","0","52","0","N/A","cotrimoxazole"
-"","40705000270","MUSYIMI","MUSYOKI NDOL","","1973-10-06 00:00:00","42","Adult","","MALE","NO","47.5","0","0","","","","","","","NO","NO","NO","2008-10-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-06","Transfer out","NO","","","","","","2008-10-06","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-17","-1425","0","47.5","0","N/A","cotrimoxazole"
-"","40705000272","florence mbida","","","1985-03-08 00:00:00","30","Adult","","FEMALE","NO","63","0","0","","nziluni","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-08","Active","NO","","","","","","2012-05-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","57","0","N/A","cotrimoxazole"
-"","40705000273","florence","mbnda","","1982-10-06 00:00:00","33","Adult","","FEMALE","NO","64","0","0","","nzeveni","","","septrin, m/vt","","NO","NO","NO","2008-10-06","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-06","Lost to follow-up","NO","","","","","","2011-06-15","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-17","-1425","0","64","0","N/A","cotrimoxazole"
-"","40705000274","ndanu","mutua","","2005-10-07 00:00:00","9","Paediatric","","FEMALE","NO","12","60","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-07","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2008-10-07","Lost to follow-up","NO","","","","","","2011-10-20","NO","","CF3A (D4t + 3TC + NVP","2011-07-22","-1298","0","10","0","N/A","cotrimoxazole"
-"","40705000275","salome","kyalo mathei","","1975-10-09 00:00:00","40","Adult","","FEMALE","NO","68","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-09","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-09","Active","NO","","","","","","2013-01-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","65","0","N/A","cotrimoxazole"
-"","40705000276","muthiani","musyoka","","2000-10-09 00:00:00","15","Adult","","FEMALE","NO","30","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-09","OUTPATIENT","GOK","ART","C1B (d4T + 3TC + NVP [10 - <20 kg])","2008-10-09","Active","NO","","","","","","2012-12-20","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-10","1","0","16.6","0","N/A","cotrimoxazole"
-"","40705000277","mwongeli","kikumu","","1997-10-13 00:00:00","18","Adult","","FEMALE","NO","43","0","0","","kithungo","","","ctx/multivit","","NO","NO","NO","2008-10-13","OUTPATIENT","GOK","ART","C4C (AZT + 3TC + NVP [20 - <30 kg])","2008-10-13","Active","NO","","","","","","2013-03-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-12","3","0","23","0","N/A","cotrimoxazole"
-"","40705000279","bernand keli","muthembwa","","1956-10-13 00:00:00","59","Adult","","MALE","NO","60","0","0","","kithungo village","","","septrin, m/vit","","NO","NO","NO","2008-10-13","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-13","Active","NO","","","","","","2012-09-17","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-20","-20","0","55","0","N/A","cotrimoxazole"
-"","40705000283","winfred","nzisa kaunda","","1978-10-21 00:00:00","37","Adult","","FEMALE","NO","54","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-21","Active","NO","","","","","","2012-09-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-22","-18","0","61","0","N/A","cotrimoxazole"
-"","40705000286","mwende","kiilu","","1972-10-21 00:00:00","43","Adult","","FEMALE","NO","40","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-21","Lost to follow-up","NO","","","","","","2014-11-18","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-08-20","-173","0","45","0","N/A","cotrimoxazole"
-"","40705000290","catherine","onesmus","","1959-10-27 00:00:00","56","Adult","","FEMALE","NO","59","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-27","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-27","Lost to follow-up","NO","","","","","","2012-10-09","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-07-11","-943","0","58","0","N/A","cotrimoxazole"
-"","40705000291","christine","mutinda","","1961-10-28 00:00:00","54","Adult","","FEMALE","NO","57.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-10-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-10-28","Active","NO","","","","","","2013-04-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","52","0","N/A","cotrimoxazole"
-"","40705000292","dominic","muthini","","1995-07-23 00:00:00","20","Adult","","MALE","NO","46","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-07-23","IN PATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2008-07-23","Lost to follow-up","NO","","","","","","2014-11-18","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-08-20","-173","0","20","0","N/A","cotrimoxazole"
-"","40705000293","ELIZABETH MBITHE","MUUNDA","","1964-10-22 00:00:00","51","Adult","","FEMALE","NO","87","157","0","","NDUENI PRI SCHOOL","","","CTX/MULTIVIT","","NO","NO","NO","2008-10-22","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2008-10-22","Active","NO","","","","","","2012-12-09","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-07","57","0","86","0","N/A","cotrimoxazole"
-"","40705000295","JUSTUS","MUIA MUTUKU","","1985-11-07 00:00:00","30","Adult","","MALE","NO","58","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-07","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-11-07","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-24","43","0","60","0","N/A","cotrimoxazole"
-"","40705000296","ruth","muia mutuku","","1962-11-06 00:00:00","53","Adult","","FEMALE","NO","49.1","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-06","Active","NO","","","","","","2012-12-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-11-18","-83","0","48","0","N/A","cotrimoxazole"
-"","40705000297","elija","keli","","1950-06-15 00:00:00","66","Adult","","MALE","NO","64","0","0","","","","","septrin, m/vit","","NO","NO","NO","2002-06-15","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2002-06-15","Active","NO","","","","","","2012-12-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","59","0","N/A","cotrimoxazole"
-"","40705000300","eunice","mutheu","","1980-11-13 00:00:00","35","Adult","","FEMALE","NO","46.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-13","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-11-13","Active","NO","","","","","","2012-06-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","41","0","N/A","cotrimoxazole"
-"","40705000302","benjamin","mwanza","","1963-11-17 00:00:00","52","Adult","","MALE","NO","50","164","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-17","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-17","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","48","0","N/A","cotrimoxazole"
-"","40705000304","mary","nduku ngei","","1986-11-17 00:00:00","29","Adult","","FEMALE","NO","65","0","0","","","","","","","NO","NO","NO","2008-11-17","TRANSFER IN","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-30","NO","","OI ONLY","2011-04-01","-1410","0","65","0","N/A","cotrimoxazole"
-"","40705000306","joyce","mbithe mwanza","","1973-11-18 00:00:00","42","Adult","","FEMALE","NO","84","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-18","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-05","24","0","71","0","N/A","cotrimoxazole"
-"","40705000308","SUSAN MELI","MUVIKU","","1975-09-03 00:00:00","40","Adult","","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2011-09-03","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-09-03","Lost to follow-up","NO","","","","","","2012-01-26","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-10-28","-1200","0","52","0","N/A","cotrimoxazole"
-"","40705000309","mwende","margret kavuu","","2001-11-20 00:00:00","13","Paediatric","","FEMALE","NO","39.2","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-20","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2008-11-20","Active","NO","","","","","","2013-03-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","20","0","N/A","cotrimoxazole"
-"","40705000310","kelvin","kioko ndunge","","2000-11-24 00:00:00","14","Paediatric","","MALE","NO","33","140","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-24","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2008-11-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","19","0","N/A","cotrimoxazole"
-"","40705000311","mwende","musyoka","","1994-11-24 00:00:00","21","Adult","","FEMALE","NO","28.7","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-24","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2008-11-24","Lost to follow-up","NO","","","","","","2014-08-20","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-05-22","-263","0","35.3","0","N/A","cotrimoxazole"
-"","40705000312","martha","ndileve wambua","","1957-11-22 00:00:00","58","Adult","","FEMALE","NO","73.3","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-22","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-22","Active","NO","","","","","","2012-11-20","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-03-04","23","0","81","0","N/A","cotrimoxazole"
-"","40705000313","mulu","musyoka nthakyo","","1968-11-25 00:00:00","47","Adult","","MALE","NO","54","0","0","","","","","septrin. m/vit","","NO","NO","NO","2008-11-25","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-11-25","Lost to follow-up","NO","","","","","","2012-09-06","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-06-08","-976","0","52","0","N/A","cotrimoxazole"
-"","40705000314","jane","mueni kyalo","","1973-11-27 00:00:00","42","Adult","","FEMALE","NO","71","152","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-27","OUTPATIENT","GOK","ART","OI ONLY","2008-11-27","Active","NO","","","","","","2008-11-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","51","0","N/A","cotrimoxazole"
-"","40705000315","amos","kyatha"," mutiso","1976-12-01 00:00:00","39","Adult","","MALE","NO","49.3","157","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-12-01","Lost to follow-up","NO","","","","","","2014-01-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-10-23","-474","0","60","0","N/A","cotrimoxazole"
-"","40705000316","susan kanini","munyao","","1963-12-01 00:00:00","52","Adult","","FEMALE","NO","50.8","159","0","","kisesini pri sch","","","","","NO","NO","NO","2008-12-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-12-01","Lost to follow-up","NO","","","","","","2014-02-17","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2013-11-19","-447","0","54","0","N/A","cotrimoxazole"
-"","40705000317","mercy","kamanthe","","2006-11-27 00:00:00","8","Paediatric","","FEMALE","NO","10","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-11-27","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2008-11-27","Lost to follow-up","NO","","","","","","2011-06-15","NO","","CF3A (D4t + 3TC + NVP","2011-03-17","-1425","0","10","0","N/A","cotrimoxazole"
-"","40705000318","doris","mutua","","1978-02-05","38","Adult","426","FEMALE","NO","45.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-02-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-02","Active","NO","","","","","","2012-12-12","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-08","-32","0","51","0","N/A","cotrimoxazole"
-"","40705000320","mary","mbula nziioki","","1974-12-02 00:00:00","41","Adult","","FEMALE","NO","32","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-02","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2008-12-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","30","0","N/A","cotrimoxazole"
-"","40705000322","florence","kavindu kitili","","1963-12-03 00:00:00","52","Adult","","FEMALE","NO","77.2","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-12-03","Active","NO","","","","","","2012-12-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","56","0","N/A","cotrimoxazole"
-"","40705000323","mutiso","kyatha","","2004-12-04 00:00:00","10","Paediatric","","MALE","NO","25","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-04","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2008-12-04","Active","NO","","","","","","2013-03-14","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-02-25","16","0","14","0","N/A","cotrimoxazole"
-"","40705000329","carolyne","mwende musyoka","","1980-06-29 00:00:00","35","Adult","","FEMALE","NO","49","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-06-29","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-06-29","Lost to follow-up","NO","","","","","","2012-06-18","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-03-20","-1056","0","47","0","N/A","cotrimoxazole"
-"","40705000330","VERONICA","NDETI","","1970-12-10 00:00:00","45","Adult","","FEMALE","NO","60.8","0","0","","MUVAA PRI","","","CTX/MULTIVIT","","NO","NO","NO","2008-12-10","OUTPATIENT","GOK","ART","OI ONLY","2008-12-10","Active","NO","","","","","","2008-12-10","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-12","3","0","52","0","N/A","cotrimoxazole"
-"","40705000331","mutete katunge","ngui","","2001-03-15 00:00:00","14","Paediatric","","FEMALE","NO","44","0","0","","713027379","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2011-03-15","Active","NO","","","","","","2013-02-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","23","0","N/A","cotrimoxazole"
-"","40705000334","zipporah n","mutua","","1963-12-27 00:00:00","52","Adult","","FEMALE","NO","57","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-27","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-12-27","Active","NO","","","","","","2012-11-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","42","0","N/A","cotrimoxazole"
-"","40705000336","penina wayua","kyengo","","1968-12-29 00:00:00","47","Adult","","FEMALE","NO","53.2","0","0","","muthwani primary","","","ctx/multivit","","NO","NO","NO","2008-12-29","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2008-12-29","Active","NO","","","","","","2012-12-31","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","55","0","N/A","cotrimoxazole"
-"","40705000338","vaati","mutua","","2002-12-30 00:00:00","12","Paediatric","","MALE","NO","20","0","0","","","","","septrin, m/vit","","NO","NO","NO","2008-12-30","OUTPATIENT","GOK","ART","CF1A (AZT + 3TC + NVP [10 - <20 kg])","2008-12-30","Active","NO","","","","","","2013-03-11","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","13","0","N/A","cotrimoxazole"
-"","40705000340","titus","mutua nzioki","","1962-01-02 00:00:00","54","Adult","","MALE","NO","59","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-01-02","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","57","0","N/A","cotrimoxazole"
-"","40705000341","margaret mutete","mutisya","","1963-03-15 00:00:00","53","Adult","","FEMALE","NO","59","0","0","","","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-03-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","47","0","N/A","cotrimoxazole"
-"","40705000342","winfred","ndunge","","1980-01-05 00:00:00","36","Adult","","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2009-01-05","OUTPATIENT","GOK","ART","OI ONLY","2009-01-05","Active","NO","","","","","","2012-10-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-11","2","0","43","0","N/A","cotrimoxazole"
-"","40705000343","beatrace","keli musau","","1963-01-05 00:00:00","53","Adult","","MALE","NO","73","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-01-05","Active","NO","","","","","","2013-01-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","71.5","0","N/A","cotrimoxazole"
-"","40705000344","faith","mwende paul","","1962-01-03 00:00:00","54","Adult","","FEMALE","NO","24","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-03-11","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2012-12-11","-790","0","16","0","N/A","cotrimoxazole"
-"","40705000347","kioko","keli","","2008-01-09 00:00:00","7","Paediatric","","MALE","NO","7","0","0","","","","","m/vit, septrin","","NO","NO","NO","2009-01-09","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2009-01-09","Lost to follow-up","NO","","","","","","2011-06-15","NO","","CF3A (D4t + 3TC + NVP","2011-03-17","-1425","0","7","0","N/A","cotrimoxazole"
-"","40705000349","mary","mutuet kioko","","1982-01-01 00:00:00","34","Adult","","FEMALE","NO","54","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-01","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-01-01","Lost to follow-up","NO","","","","","","2012-06-25","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2012-03-27","-1049","0","54","0","N/A","cotrimoxazole"
-"","40705000350","john","musa munyoki","","1962-01-14 00:00:00","54","Adult","","MALE","NO","63","0","0","","","","","","","NO","NO","NO","2009-01-14","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2009-01-14","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-04","-5","0","66","0","N/A","cotrimoxazole"
-"","40705000351","christine","mwikali peter","","1984-01-19 00:00:00","32","Adult","","FEMALE","NO","66.6","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-19","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-06-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-03-26","-320","0","62","0","N/A","cotrimoxazole"
-"","40705000352","mueni","mutinda kimata","","1988-01-19 00:00:00","27","Adult","","FEMALE","NO","53","150","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-01-19","Active","NO","","","","","","2012-08-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","47","0","N/A","cotrimoxazole"
-"","40705000353","stephene mutangili","mwololo","","1973-01-16 00:00:00","43","Adult","","MALE","NO","57","0","0","","kimandini primary","","","ctx/multivit","","NO","NO","NO","2009-01-16","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-01-16","Lost to follow-up","NO","","","","","","2011-08-08","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-05-10","-1371","0","47","0","N/A","cotrimoxazole"
-"","40705000354","elizabeth","mbatha mutangili","","1984-01-16 00:00:00","32","Adult","","FEMALE","NO","54","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-16","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-15","NO","","OI ONLY","2011-03-17","-1425","0","54","0","N/A","cotrimoxazole"
-"","40705000356","margret","kaluki keli","","1971-03-03 00:00:00","45","Adult","","FEMALE","NO","61","0","0","","mbanya","","","septrin, m/vit","","NO","NO","NO","2009-03-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-03","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-15","-25","0","57","0","N/A","cotrimoxazole"
-"","40705000357","hellen","wanyua","","1962-01-29 00:00:00","54","Adult","","FEMALE","NO","55","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-29","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-01-29","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","48","0","N/A","cotrimoxazole"
-"","40705000359","josephine","nthenya mutiso","","1978-02-03 00:00:00","38","Adult","","FEMALE","NO","31","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-02-03","Lost to follow-up","NO","","","","","","2013-12-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-02","-525","0","37","0","N/A","cotrimoxazole"
-"","40705000362","muthini","maundu","","2000-02-07 00:00:00","15","Adult","","MALE","NO","31","126","0","","","","","","","NO","NO","NO","2009-02-07","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-02-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","21","0","N/A","cotrimoxazole"
-"","40705000363","everlyn","nthenya mutunga","","1979-02-15 00:00:00","37","Adult","","FEMALE","NO","46","0","0","","","","","septrin,m/vit","","NO","NO","NO","2011-02-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-02-15","Lost to follow-up","NO","","","","","","2013-12-23","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-24","-503","0","42","0","N/A","cotrimoxazole"
-"","40705000364","peter","mue kiio","","1946-02-10 00:00:00","70","Adult","","MALE","NO","46","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-10","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-02-10","Lost to follow-up","NO","","","","","","2012-05-07","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-02-07","-1098","0","45.5","0","N/A","cotrimoxazole"
-"","40705000366","christine","kalondu","","1975-02-02 00:00:00","41","Adult","","FEMALE","NO","52.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-02-02","Active","NO","","","","","","2012-12-06","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-01-08","-32","0","46","0","N/A","cotrimoxazole"
-"","40705000367","juda","musembi malelu","","2001-02-11 00:00:00","14","Paediatric","","MALE","NO","38","148","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-11","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-02-11","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","24","0","N/A","cotrimoxazole"
-"","40705000368","ndunge","mutunga","","1987-02-12 00:00:00","28","Adult","","FEMALE","YES","50","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-02-12","Lost to follow-up","NO","","","","","","2012-09-20","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-06-22","-962","0","52.9","0","N/A","cotrimoxazole"
-"","40705000369","mwende","mwanzia","","1999-02-12 00:00:00","16","Adult"," ","MALE","NO","41","0","0","","","","","septrin,m-vit",",","NO","NO","NO","2009-02-12","OUTPATIENT","","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-02-12","Active","NO","","0","","","","2012-12-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-13","32","0","23","0","N/A","cotrimoxazole"
-"","40705000372","kanini","peter","","1981-02-23 00:00:00","34","Adult","","FEMALE","NO","43","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-23","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-02-23","Lost to follow-up","NO","","","","","","2011-06-15","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-17","-1425","0","43","0","N/A","cotrimoxazole"
-"","40705000374","florence","mueni mwanzia","","1966-02-24 00:00:00","50","Adult","","FEMALE","NO","49","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-02-24","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2009-02-24","NO","","OI ONLY","2011-03-17","-1425","0","49","0","N/A","cotrimoxazole"
-"","40705000376","dorcas","mwikali","","1968-01-24 00:00:00","48","Adult","","FEMALE","NO","46","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-24","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-01-24","Active","NO","","","","","","2012-12-31","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-23","14","0","52","0","N/A","cotrimoxazole"
-"","40705000378","ann","kisoi","","1973-03-10 00:00:00","43","Adult","","FEMALE","NO","52","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-03-10","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-03-10","Lost to follow-up","NO","","","","","","2014-05-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-02-26","-348","0","50.5","0","N/A","cotrimoxazole"
-"","40705000379","charity","muthikwa kyatha","","1979-02-27 00:00:00","36","Adult","268","FEMALE","NO","59.6","0","0","","","","","septrin,m-vit",",","NO","NO","NO","2009-02-27","OUTPATIENT","","ART","OI ONLY","","Active","NO","","0","","","","2009-02-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-25","44","0","56","0","N/A","cotrimoxazole"
-"","40705000381","joyce","nduku kimeu","","1963-03-02 00:00:00","53","Adult","","FEMALE","NO","51","150","0","","","","","septrin, m/vit","","YES","NO","NO","2009-03-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-02","Active","NO","","","","","","2012-12-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-16","-24","0","44","0","N/A","cotrimoxazole"
-"","40705000382","daniel","mutuku","","1953-03-03 00:00:00","63","Adult","","MALE","NO","62","172.9","0","","","","","","","NO","NO","NO","2009-03-03","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2009-03-03","Active","NO","","","","","","2013-01-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-24","15","0","59","0","N/A","cotrimoxazole"
-"","40705000383","agnes","ngulumo","","1964-05-05 00:00:00","52","Adult","","FEMALE","NO","58","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-05-05","Active","NO","","","","","","2012-12-13","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","52","0","N/A","cotrimoxazole"
-"","40705000384","penina","mutuku","","1961-03-05 00:00:00","55","Adult","","FEMALE","NO","75.6","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-03-05","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-05","Active","NO","","","","","","2013-03-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","67","0","N/A","cotrimoxazole"
-"","40705000386","JANE","KIOKO","","1957-03-10 00:00:00","59","Adult","","FEMALE","NO","74.8","","0","","","","","SPTRIN, M/VIT","","NO","NO","NO","2009-03-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-10","Active","NO","","","","","","2012-06-28","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-22","-18","0","72","0","N/A","cotrimoxazole"
-"","40705000387","ELIZABETH","NDUNGE PETER","","1960-03-12 00:00:00","56","Adult","","FEMALE","NO","43.3","","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-03-12","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-03-12","Lost to follow-up","NO","","","","","","2014-02-20","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-22","-444","","39.5","0","N/A","cotrimoxazole"
-"","40705000388","PAMELA","NDANU MUTUNGA","","2001-05-07 00:00:00","14","Paediatric","","FEMALE","NO","31.9","0","0","","","","","SEPTRIN, /M/VIT","","NO","NO","NO","2009-05-07","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2009-05-07","Active","NO","","","","","","2012-12-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","18.7","0","N/A","cotrimoxazole"
-"","40705000389","MUTANU","KAMETU","","1959-03-10 00:00:00","57","Adult","","FEMALE","NO","53","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-03-10","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-10","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-17","8","0","76","0","N/A","cotrimoxazole"
-"","40705000398","patricia","mwenga","","1980-10-28 00:00:00","35","Adult","","FEMALE","NO","41","0","0","","","","","","","NO","NO","NO","2008-10-28","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2008-10-28","Active","NO","","","","","","2013-01-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","36","0","N/A","cotrimoxazole"
-"","40705000400","lither","kavinndu","","1989-01-26 00:00:00","26","Adult","","FEMALE","NO","48","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-01-26","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2009-01-26","NO","","OI ONLY","2011-03-18","-1424","0","48","0","N/A","cotrimoxazole"
-"","40705000406","abrahan","kirima","","1974-10-28 00:00:00","41","Adult","","MALE","NO","50","0","0","","","","","septrin, m/vit","","YES","NO","NO","2009-10-28","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-10-28","Lost to follow-up","NO","","","","","","2013-11-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-27","-531","0","50","0","N/A","cotrimoxazole"
-"","40705000408","john","mutune","","2001-03-31 00:00:00","14","Paediatric","","MALE","NO","29","0","0","","","","","septrin, m//vit","","NO","NO","NO","2009-03-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-31","Active","NO","","","","","","2013-02-07","NO","","AZT + 3TC + EFV (< 15YRS PAED)","2015-01-13","-27","0","16","0","N/A","cotrimoxazole"
-"","40705000409","mirrium","mutune","","1975-03-31 00:00:00","40","Adult","","FEMALE","NO","55","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-03-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-03-31","Active","NO","","","","","","2012-11-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","44.5","0","N/A","cotrimoxazole"
-"","40705000411","mutio","muendo","","1980-04-03 00:00:00","35","Adult","","FEMALE","NO","66","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-03","Lost to follow-up","NO","","","","","","2014-09-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-07-01","-223","0","58","0","N/A","cotrimoxazole"
-"","40705000412","mwanzia","mainga musyoki","","1964-04-06 00:00:00","52","Adult","","MALE","NO","56","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-06","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-04","-5","0","57.3","0","N/A","cotrimoxazole"
-"","40705000413","eunice","kivinya mwanzia","","1969-04-06 00:00:00","47","Adult","","FEMALE","NO","47.8","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-06","Active","NO","","","","","","2012-11-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","41.5","0","N/A","cotrimoxazole"
-"","40705000414","pamela","mwende stanley","","1978-04-09 00:00:00","37","Adult","","FEMALE","NO","31","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-09","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-09","Lost to follow-up","NO","","","","","","2012-12-13","NO","","d4T + 3TC + NVP (>15YRS ADULT)","2012-09-14","-878","0","49.5","0","N/A","cotrimoxazole"
-"","40705000415","mercy","muthoki mulimi","","2000-04-10 00:00:00","15","Adult","","FEMALE","NO","37.7","0","0","","","","","M/VIT, PARACETAMOL","","NO","NO","NO","2009-04-10","OUTPATIENT","GOK","ART","OI ONLY","2009-04-10","Active","NO","","","","","","2012-12-02","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-05","-4","0","22","0","N/A","cotrimoxazole"
-"","40705000416","jackson","kioko mwangangi","","1979-04-14 00:00:00","36","Adult","","MALE","NO","62","","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-14","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-14","Lost to follow-up","NO","","","","","","2014-11-10","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-08-12","-181","","61","0","N/A","cotrimoxazole"
-"","40705000418","rose","mueni mutuku","","1962-04-16 00:00:00","54","Adult","","FEMALE","NO","67","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-16","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-16","Active","NO","","","","","","2012-11-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-11","2","0","69.9","0","N/A","cotrimoxazole"
-"","40705000419","JAPHETH MUTISO","MUSWII","","1945-04-16 00:00:00","71","Adult","","MALE","NO","53","0","0","","MUTITU PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2009-04-16","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-16","Active","NO","","","","","","2013-01-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-16","35","0","52","0","N/A","cotrimoxazole"
-"","40705000420m","cristine","nduku","","1973-05-14","42","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2010-06-14","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2010-06-14","Lost to follow-up","NO","","","","","","2013-02-14","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2012-11-16","-815","0","50","0","N/A","cotrimoxazole"
-"","40705000424","muthini","munyiva","","1996-04-24 00:00:00","19","Adult","","MALE","NO","48","154","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-24","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-24","Active","NO","","","","","","2012-11-05","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","25","0","N/A","cotrimoxazole"
-"","40705000425","josephine","nzioka","","1957-04-24 00:00:00","59","Adult","","FEMALE","NO","57","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-24","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-04-24","Active","NO","","","","","","2012-12-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","49","0","N/A","cotrimoxazole"
-"","40705000428","carolyne","mbuku musyoki","","1979-04-28 00:00:00","36","Adult","","FEMALE","NO","58","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-28","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-06-03","NO","","OI ONLY","2012-03-05","-1071","0","62","0","N/A","cotrimoxazole"
-"","40705000429","daniel mutune","","","1965-03-29 00:00:00","51","Adult","","MALE","NO","45.4","0","0","","","","","","","NO","NO","NO","2011-03-29","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-03-29","Active","NO","","","","","","2013-03-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","45","0","N/A","cotrimoxazole"
-"","40705000433","muendo","makusa","","1982-05-01 00:00:00","33","Adult","","MALE","NO","48","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-07-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-04-29","-286","0","48","0","N/A","cotrimoxazole"
-"","40705000435","muia","ndungwa","","2004-05-04 00:00:00","11","Paediatric","","MALE","NO","29","116","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-05-04","Active","NO","","","","","","2013-02-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","19","0","N/A","cotrimoxazole"
-"","40705000439","mary","maingi","","1961-05-06 00:00:00","55","Adult","","FEMALE","NO","61","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-05-06","Active","NO","","","","","","2013-03-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","51","0","N/A","cotrimoxazole"
-"","40705000440","chris","mumo","","2007-05-06 00:00:00","8","Paediatric","","MALE","NO","23.7","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-06","OUTPATIENT","GOK","ART","CF3A (D4t + 3TC + NVP","2009-05-06","Active","NO","","","","","","2013-01-03","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-15","-25","0","12","0","N/A","cotrimoxazole"
-"","40705000441","samuel","mulili","","1951-05-11 00:00:00","65","Adult","","MALE","NO","56","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-11","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-09-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-07-02","-587","0","57","0","N/A","cotrimoxazole"
-"","40705000442","regina","mueni masila","","1960-05-11 00:00:00","56","Adult","","FEMALE","NO","63.5","157","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-11","OUTPATIENT","GOK","ART","OI ONLY","2009-05-11","Active","NO","","","","","","2009-05-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-15","-25","0","57","0","N/A","cotrimoxazole"
-"","40705000443","joyce","ndunge muasa","","1970-04-13 00:00:00","45","Adult","","FEMALE","NO","67.8","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-04-13","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2009-04-13","Active","NO","","","","","","2012-12-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","60.5","0","N/A","cotrimoxazole"
-"","40705000444","margret","nzilani mule","","1984-05-14 00:00:00","31","Adult","","FEMALE","NO","49","156","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-14","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-05-14","Active","NO","","","","","","2012-12-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-19","-21","0","41","0","N/A","cotrimoxazole"
-"","40705000445","monica","ndunge","","1974-05-15 00:00:00","41","Adult","","FEMALE","NO","45.5","152","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-15","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-05-15","Lost to follow-up","NO","","","","","","2014-09-09","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2014-06-11","-243","0","42.5","0","N/A","cotrimoxazole"
-"","40705000449","mwongeli","nzilani mulani","","2007-05-22 00:00:00","8","Paediatric","","FEMALE","NO","21","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-05-22","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-19","-21","0","8.9","0","N/A","cotrimoxazole"
-"","40705000450","jane","kaluki","","1960-05-25 00:00:00","56","Adult","","FEMALE","NO","52","152","0","","","","","","","NO","NO","NO","2009-05-25","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2009-05-25","Active","NO","","","","","","2012-12-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","47","0","N/A","cotrimoxazole"
-"","40705000451","sammy","manzia","","2004-05-26 00:00:00","11","Paediatric","","MALE","NO","19","0","0","","","","","ctx/multivitr","","NO","NO","NO","2009-05-26","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-05-26","NO","","ABC + 3TC + EFV (< 15YRS PAED)","2015-01-05","-35","0","12","0","N/A","cotrimoxazole"
-"","40705000454","virginia","munyiva mwanzia","","1981-05-26 00:00:00","34","Adult","","FEMALE","NO","63.7","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-26","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-05-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-05","-4","0","50","0","N/A","cotrimoxazole"
-"","40705000456","jane","kaluki","","1960-05-25 00:00:00","56","Adult","","FEMALE","NO","40","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-25","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-05-25","Lost to follow-up","NO","","","","","","2011-06-16","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-18","-1424","0","40","0","N/A","cotrimoxazole"
-"","40705000457","agnes","kanini kiilu","","1966-06-01 00:00:00","49","Adult","","FEMALE","NO","48","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-01","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-06-01","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-05","-4","0","70","0","N/A","cotrimoxazole"
-"","40705000458","phyllis","mueni mutuku","","1960-05-22 00:00:00","56","Adult","","FEMALE","NO","57.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-05-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-05-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","48.5","0","N/A","cotrimoxazole"
-"","40705000459","andrew","kimuyu maku","","1955-06-02 00:00:00","61","Adult","","MALE","NO","56.7","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-06-02","Active","NO","","","","","","2013-04-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","52.5","0","N/A","cotrimoxazole"
-"","40705000460","damaris","zakayo","mukonyo","1985-02-10","30","Adult","426","FEMALE","NO","42.5","159","0","729703982","kikima","","","","","NO","NO","NO","2012-07-27","OUTPATIENT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-18","-874","153","45","0","N/A","cotrimoxazole"
-"","40705000461","margret","ngina","","1974-06-05 00:00:00","41","Adult","","FEMALE","NO","81","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-06-05","Active","NO","","","","","","2013-03-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-29","-11","0","52.2","0","N/A","cotrimoxazole"
-"","40705000465","rose","mutethya","","1964-06-06 00:00:00","51","Adult","","FEMALE","NO","49","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-06","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-06-06","Active","NO","","","","","","2013-02-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-07","-33","0","48","0","N/A","cotrimoxazole"
-"","40705000469","dorothy","mwikali john","","1947-04-27 00:00:00","69","Adult","","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2011-04-27","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-11-14","NO","","OI ONLY","2011-08-16","-1273","0","60","0","N/A","cotrimoxazole"
-"","40705000472","regina","katina mutuku","","1967-05-22 00:00:00","48","Adult","","FEMALE","NO","76","162","0","","mavindu","","","septrin, m/vit","","NO","NO","NO","2009-05-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-05-22","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-27","-13","0","65","0","N/A","cotrimoxazole"
-"","40705000473","jane","mwikali kioko","","1974-06-19 00:00:00","41","Adult","","FEMALE","NO","57","167","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-06-19","Active","NO","","","","","","2013-04-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-09","28","0","45","0","N/A","cotrimoxazole"
-"","40705000478","CHRISTINE MUENI","KIMEU","","1963-03-25 00:00:00","53","Adult","","FEMALE","NO","63.4","0","0","","KYUU SEC","","","","","NO","NO","NO","2011-03-25","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-11","30","0","64","0","N/A","cotrimoxazole"
-"","40705000480","stella","ndunge kavoi","","1984-06-29 00:00:00","31","Adult","","FEMALE","NO","30","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-29","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-06-29","Lost to follow-up","NO","","","","","","2014-03-23","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2013-12-23","-413","0","72.5","0","N/A","cotrimoxazole"
-"","40705000484","dorothy","katungwa mwanthi","","1958-07-14 00:00:00","57","Adult","","FEMALE","NO","57","157","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-14","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-07-14","Active","NO","","","","","","2012-12-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","0","55","0","N/A","cotrimoxazole"
-"","40705000485","faith","mueni mutune","","1987-07-15 00:00:00","28","Adult","","FEMALE","NO","60","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-07-15","Lost to follow-up","NO","","","","","","2011-06-16","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-18","-1424","0","60","0","N/A","cotrimoxazole"
-"","40705000488","francis","muisu ngumbau","","1975-07-21 00:00:00","40","Adult","","MALE","NO","46","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-21","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-07-21","Active","NO","","","","","","2012-10-18","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-19","10","0","52","0","N/A","cotrimoxazole"
-"","40705000489","monicah","mbithe muendo","","1974-07-21 00:00:00","41","Adult","","FEMALE","NO","48.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-07-21","Active","NO","","","","","","2013-02-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","42","0","N/A","cotrimoxazole"
-"","40705000490","ann","nduku ikuti","","1970-06-08 00:00:00","45","Adult","","FEMALE","NO","48","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-06-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-11","NO","","OI ONLY","2011-07-13","-1307","0","45","0","N/A","cotrimoxazole"
-"","40705000491","beatrace","ndinda mbevi","","1979-07-27 00:00:00","36","Adult","","FEMALE","NO","40","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-27","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2009-07-27","Lost to follow-up","NO","","","","","","2011-06-16","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-18","-1424","0","40","0","N/A","cotrimoxazole"
-"","40705000493","beatrice ndinda","","","1976-03-29 00:00:00","39","Adult","","FEMALE","NO","40","0","0","","","","","","","NO","NO","NO","2011-03-29","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-29","Transfer out","NO","","","","","","2011-03-29","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-05-25","-1356","0","39.5","0","N/A","cotrimoxazole"
-"","40705000494","tabitha","muindi","","1960-11-28 00:00:00","55","Adult","","FEMALE","NO","50","0","0","","","","","septrin, m/vit","","NO","NO","NO","2006-11-28","IN PATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-11-28","Lost to follow-up","NO","","","","","","2011-06-16","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-03-18","-1424","0","50","0","N/A","cotrimoxazole"
-"","40705000495","kasyali","mutua","","1999-07-28 00:00:00","16","Adult","","MALE","NO","46","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-28","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2009-07-28","Lost to follow-up","NO","","","","","","2014-06-12","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-03-14","-332","0","29","0","N/A","cotrimoxazole"
-"","40705000497","james","mutuku sammy","","1979-07-28 00:00:00","36","Adult","","MALE","NO","57.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-07-28","Lost to follow-up","NO","","","","","","2012-11-22","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-08-24","-899","0","56","0","N/A","cotrimoxazole"
-"","40705000498","theresia","munini kioko","","1974-07-30 00:00:00","41","Adult","","FEMALE","NO","58","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-30","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-07-30","Lost to follow-up","NO","","","","","","2012-11-05","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-08-07","-916","0","44.5","0","N/A","cotrimoxazole"
-"","40705000501","nthenya","kyalo","","2004-10-29 00:00:00","10","Paediatric","","FEMALE","NO","16","0","0","","","","","","","NO","NO","NO","2010-10-29","CASUALTY","GOK","ART","OI ONLY","2010-10-29","Lost to follow-up","NO","","","","","","2011-02-24","NO","","CF2A(ABC + 3TC + NVP )","2010-11-26","-1536","0","16","0","N/A","cotrimoxazole"
-"","40705000503","winfred","mainga","","1972-08-13 00:00:00","43","Adult","","FEMALE","NO","45.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-13","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-22","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-09-23","-1235","0","50","0","N/A","cotrimoxazole"
-"","40705000504","sabina","ndunge muendo","","1978-08-17 00:00:00","37","Adult","","FEMALE","NO","56.8","161","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-17","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-08-17","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-17","36","0","41","0","N/A","cotrimoxazole"
-"","40705000507","NDUNGE","MUTUA","","1987-10-01 00:00:00","28","Adult","","FEMALE","NO","42.2","0","0","","","","","","","NO","NO","NO","2010-10-01","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2010-10-01","Lost to follow-up","NO","","","","","","2014-07-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-04-02","-313","0","52","0","N/A","cotrimoxazole"
-"","40705000510","kioko","mutinda","","2003-08-21 00:00:00","12","Paediatric","","MALE","NO","25","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-06-04","NO","","CF2A(ABC + 3TC + NVP )","2012-03-06","-1070","0","22","0","N/A","cotrimoxazole"
-"","40705000511","mirrium mbithe","maithya","","1991-08-24 00:00:00","24","Adult","","FEMALE","NO","54","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-24","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-08-24","Lost to follow-up","NO","","","","","","2011-12-08","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-09-09","-1249","0","59.5","0","N/A","cotrimoxazole"
-"","40705000512","serah","mutisya","","1958-08-28 00:00:00","57","Adult","","FEMALE","NO","56","148","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-08-28","Active","NO","","","","","","2012-12-27","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-08","58","0","53.3","0","N/A","cotrimoxazole"
-"","40705000513","annah mwikali","musembi","","1967-03-15 00:00:00","49","Adult","","FEMALE","NO","54","0","0","","kikima sec","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-15","Active","NO","","","","","","2012-11-11","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-27","-13","0","53","0","N/A","cotrimoxazole"
-"","40705000514","ann","mwikali mwongeli","","1983-09-03 00:00:00","32","Adult","","FEMALE","NO","33.7","156","0","","","","","septrin, m/vit","","NO","NO","NO","2009-09-03","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-09-03","Lost to follow-up","NO","","","","","","2014-01-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-10-03","-494","0","38","0","N/A","cotrimoxazole"
-"","40705000518","elizabeth","nduku muendo","","1954-09-11 00:00:00","61","Adult","","FEMALE","NO","47.1","0.0147","0","","","","","septrin, m/vit","","NO","NO","NO","2009-09-11","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-09-11","Active","NO","","","","","","2013-02-18","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-12-18","-53","0","43","0","N/A","cotrimoxazole"
-"","40705000520","muthoka","mbevi musyoka","","2005-09-15 00:00:00","10","Paediatric"," ","MALE","NO","20","0","0","","","","","septrin,m-vit",",","NO","NO","NO","2009-09-15","OUTPATIENT","","ART","ABC + 3TC + NVP (< 15YRS PAED)","2009-09-15","Active","NO","","0","","","","2012-12-02","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-16","-24","0","11.5","0","N/A","cotrimoxazole"
-"","40705000524","vaati","mutiso munyao","","1998-10-05 00:00:00","17","Adult","","MALE","NO","33","135","0","","","","","","","NO","NO","NO","2009-10-05","TRANSFER IN","GOK","ART","ABC + 3TC + NVP","2009-10-05","Active","NO","","","","","","2013-02-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-11-20","-81","0","23","0","N/A","cotrimoxazole"
-"","40705000526","esther","mwikali","","1943-08-06 00:00:00","73","Adult","","FEMALE","NO","37.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-08-06","Transfer out","NO","","","","","","2009-08-06","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-19","-1423","0","37.5","0","N/A","cotrimoxazole"
-"","40705000527","john","mbevi MULEE","","1973-10-13 00:00:00","42","Adult","","MALE","NO","55.5","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-10-13","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-10-13","Active","NO","","","","","","2013-03-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","52.5","0","N/A","cotrimoxazole"
-"","40705000528","AGNES","NDINDA MWIKALI","","1972-09-18 00:00:00","43","Adult","","FEMALE","NO","69","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-09-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-09-18","Active","NO","","","","","","2012-12-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-17","8","0","66.4","0","N/A","cotrimoxazole"
-"","40705000529","JANET","KAMANTHE JOEL","","1971-10-19 00:00:00","44","Adult","","FEMALE","NO","69","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-10-19","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-10-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","47","0","N/A","cotrimoxazole"
-"","40705000531","PIUS","KIMANTHI","","1960-10-27 00:00:00","55","Adult","","MALE","NO","64","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-10-27","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-10-27","Active","NO","","","","","","2013-03-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-08","-32","0","52","0","N/A","cotrimoxazole"
-"","40705000533","MARY","MUKENE JOHN","","1974-01-15 00:00:00","42","Adult","","FEMALE","NO","39","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-01-15","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-17","NO","","OI ONLY","2011-03-19","-1423","0","39","0","N/A","cotrimoxazole"
-"","40705000534","FAITH","MWENDE NYAMAI","","1984-07-15 00:00:00","31","Adult","","FEMALE","NO","56.8","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-07-15","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-07-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","52.5","0","N/A","cotrimoxazole"
-"","40705000537","FRANSCISCA","KELI NZIOKA","","1983-10-28 00:00:00","32","Adult","","FEMALE","NO","41","143","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-10-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-10-28","Lost to follow-up","NO","","","","","","2014-07-13","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-04-14","-301","0","34.5","0","N/A","cotrimoxazole"
-"","40705000539","NDUKU","MBITHI","","1979-11-06 00:00:00","36","Adult","","FEMALE","NO","48","147","0","","","","","SEPTRIN, M/VIT","","YES","NO","NO","2009-11-06","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-11-06","Lost to follow-up","NO","","","","","","2014-12-23","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-09-24","-138","0","47","0","N/A","cotrimoxazole"
-"","40705000545","JOSEPHINE","NTHENYA","","1970-11-19 00:00:00","45","Adult","","FEMALE","NO","47","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-19","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-11-19","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-03","22","0","42","0","N/A","cotrimoxazole"
-"","40705000546","SUSAN","MUENI","","1945-11-23 00:00:00","70","Adult","","FEMALE","NO","60","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-23","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-11-23","Active","NO","","","","","","2012-11-26","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-10","29","0","64","0","N/A","cotrimoxazole"
-"","40705000547","ZAKAYO","MBAKA","","1966-11-23 00:00:00","49","Adult","","MALE","NO","61","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-23","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-11-23","Lost to follow-up","NO","","","","","","2012-06-25","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-03-27","-1049","0","61","0","N/A","cotrimoxazole"
-"","40705000548","NGANGI","KAVINYA","","1956-11-23 00:00:00","59","Adult","","MALE","NO","50","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-23","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2009-11-23","Active","NO","","","","","","2013-03-11","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-06","-34","0","48.5","0","N/A","cotrimoxazole"
-"","40705000550","JULIANA","MWIKALI MUTINDA","","1983-11-24 00:00:00","32","Adult","","FEMALE","NO","45.2","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-24","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-11-24","Lost to follow-up","NO","","","","","","2013-10-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-07-26","-563","0","42.5","0","N/A","cotrimoxazole"
-"","40705000552","EUNICE","MINOO KIMATU","","1982-08-20 00:00:00","33","Adult","","FEMALE","NO","57","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-08-20","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-08-20","Lost to follow-up","NO","","","","","","2012-11-05","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-08-07","-916","0","57","0","N/A","cotrimoxazole"
-"","40705000553","KAVATA","MUTUA","","1952-11-30 00:00:00","63","Adult","","FEMALE","NO","56","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2009-11-30","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-11-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","44","0","N/A","cotrimoxazole"
-"","40705000556","JANET","mutheu","","1984-11-30 00:00:00","31","Adult","","FEMALE","YES","55.6","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-11-30","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-11-30","Lost to follow-up","NO","","","","","","2013-11-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-08-30","-528","0","36.5","0","N/A","cotrimoxazole"
-"","40705000557","kennedy","mumo","","2007-11-30 00:00:00","7","Paediatric","","MALE","NO","14","60","0","","","","","septrin, m/vit","","NO","NO","NO","2009-11-30","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-12-12","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2013-09-13","-514","0","6.8","0","N/A","cotrimoxazole"
-"","40705000558","michael","muide joshua","","1970-12-01 00:00:00","45","Adult","","MALE","NO","53","0","0","","","","","septrin,mvit","","NO","NO","NO","2009-12-01","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2009-12-01","Transfer out","NO","","","","","","2009-12-01","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2011-03-19","-1423","0","53","0","N/A","cotrimoxazole"
-"","40705000561","emma","kathina","","1980-12-02 00:00:00","35","Adult","","FEMALE","NO","61.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-02","Lost to follow-up","NO","","","","","","2015-01-13","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-10-15","-117","0","40.5","0","N/A","cotrimoxazole"
-"","40705000562","esther","nzisa mutua","","1973-12-03 00:00:00","42","Adult","","FEMALE","NO","56","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-24","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-26","-1294","0","56","0","N/A","cotrimoxazole"
-"","40705000563","faith","njeri kilonzo","","1974-12-04 00:00:00","41","Adult","","FEMALE","NO","12","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-04","Lost to follow-up","NO","","","","","","2012-05-24","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-02-24","-1081","0","42.1","0","N/A","cotrimoxazole"
-"","40705000565","regina"," mulinge","ndinda","1963-12-07 00:00:00","52","Adult","","FEMALE","NO","58","158","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-07","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-07","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","47","0","N/A","cotrimoxazole"
-"","40705000567","dorcus","ndinda kilonzo","","1985-02-03 00:00:00","30","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2012-02-03","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-02-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-06","-3","0","41","0","N/A","cotrimoxazole"
-"","40705000569","PRISCILLA NTHENYA","KYALO","","1970-12-10 00:00:00","45","Adult","","FEMALE","NO","53","0","0","","MUTWII PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2009-12-10","TRANSFER IN","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2009-12-10","Lost to follow-up","NO","","","","","","2012-07-31","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-05-02","-1013","0","46","0","N/A","cotrimoxazole"
-"","40705000570","patricia","mwanzia mwania","","1989-03-18 00:00:00","26","Adult","","FEMALE","NO","70","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-03-18","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-14","NO","","OI ONLY","2011-04-15","-1396","0","70","0","N/A","cotrimoxazole"
-"","40705000571","AGNES MBITHE","MUNYAO","","1973-12-12 00:00:00","42","Adult","","FEMALE","NO","47.5","75","0","","MWENYEANI PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2009-12-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-12","Active","NO","","","","","","2012-09-13","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","46","0","N/A","cotrimoxazole"
-"","40705000573","rhodah"," luka","ngina","1971-12-02 00:00:00","44","Adult","","FEMALE","NO","53.9","148","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-02","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-02","Active","NO","","","","","","2012-12-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-18","9","0","41.5","0","N/A","cotrimoxazole"
-"","40705000574","josephine","mumbua musau","","1985-08-16 00:00:00","30","Adult","","FEMALE","NO","71","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-08-16","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2009-08-16","NO","","OI ONLY","2011-04-19","-1392","0","63","0","N/A","cotrimoxazole"
-"","40705000576","annacitacia","mumo","","1979-12-24 00:00:00","36","Adult","","FEMALE","NO","54","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-24","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-24","Lost to follow-up","NO","","","","","","2011-06-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-20","-1422","0","54","0","N/A","cotrimoxazole"
-"","40705000577","rodah","kavindu mbithi","","1982-12-28 00:00:00","33","Adult","","FEMALE","NO","53","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-28","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-28","Lost to follow-up","NO","","","","","","2011-06-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-20","-1422","0","53","0","N/A","cotrimoxazole"
-"","40705000578","christine","ndungwa kimeu","","1981-12-29 00:00:00","34","Adult","","FEMALE","NO","51","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-12-29","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-12-29","Active","NO","","","","","","2012-03-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-10","29","0","51","0","N/A","cotrimoxazole"
-"","40705000580","janet","nthenya mutie","","1978-07-01 00:00:00","37","Adult","","FEMALE","NO","53","0","0","","","","","septrin, m/vit","","NO","NO","NO","2009-07-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2009-07-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-01-24","-1112","0","46","0","N/A","cotrimoxazole"
-"","40705000581","john","mwendwa muema","","1993-12-29 00:00:00","21","Adult","","MALE","NO","36","0","0","","p o box 64 kikima","","","dapsone/m/vit","","NO","NO","NO","2009-12-29","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2009-12-29","Deceased","NO","","","","","","2009-12-29","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-20","-1422","0","36","0","N/A","cotrimoxazole"
-"","40705000582","lydiah","kithei stephen","","1991-01-04 00:00:00","24","Adult","","FEMALE","NO","56","150","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-01-04","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-19","10","0","53","0","N/A","cotrimoxazole"
-"","40705000584","mutinda","kioko mutua","","1996-01-05 00:00:00","19","Adult","","MALE","NO","50.7","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-05","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2010-01-05","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","32","0","N/A","cotrimoxazole"
-"","40705000586","alice"," nthiwa","mueni","1965-01-11 00:00:00","51","Adult","","FEMALE","NO","53","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-11","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-01-11","Active","NO","","","","","","2012-12-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-10","1","0","54","0","N/A","cotrimoxazole"
-"","40705000589","eunice","mulekyo kimuyu","","1970-01-21 00:00:00","46","Adult","","FEMALE","NO","47","0","0","","","","","SEPTRIN, M/VIT","","NO","NO","NO","2010-01-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2010-01-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","45","0","N/A","cotrimoxazole"
-"","40705000590","josephine","mueni","","1968-01-15 00:00:00","48","Adult","","FEMALE","NO","49","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-01-15","Active","NO","","","","","","2012-11-06","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-28","-12","0","46","0","N/A","cotrimoxazole"
-"","40705000591","francsicah","mbeneka mutuku","","1963-01-26 00:00:00","53","Adult","","FEMALE","NO","61.6","0","0","","","","","","","NO","NO","NO","2010-01-26","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-01-26","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","52.5","0","N/A","cotrimoxazole"
-"","40705000594","maureen","kamanthe","","2006-01-18 00:00:00","9","Paediatric","","FEMALE","NO","11","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-18","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-18","NO","","OI ONLY","2011-03-20","-1422","0","11","0","N/A","cotrimoxazole"
-"","40705000595","carolyne","muthoni muteti","","1988-01-18 00:00:00","27","Adult","","FEMALE","NO","53","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-01-18","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-26","NO","","OI ONLY","2011-09-27","-1231","0","53","0","N/A","cotrimoxazole"
-"","40705000596","recho","nduku nthiwa","","1981-02-04 00:00:00","35","Adult","","FEMALE","NO","47","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-02-04","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-02-04","Lost to follow-up","NO","","","","","","2012-08-17","NO","","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2012-05-19","-996","0","59","0","N/A","cotrimoxazole"
-"","40705000599","wanza","mueni muli","","2001-02-11 00:00:00","14","Paediatric","","FEMALE","NO","35","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-02-11","OUTPATIENT","GOK","ART","C1C (d4T + 3TC + NVP [20 - <30 kg])","2010-02-11","Active","NO","","","","","","2013-03-14","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-10","1","0","27","0","N/A","cotrimoxazole"
-"","40705000601","stella mbatha","kitaka","","1984-02-09 00:00:00","31","Adult","","FEMALE","NO","47","0","0","","mutito pry sch","","","ctx m/vit","","NO","NO","NO","2010-02-09","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-02-09","Deceased","NO","","","","","","2010-02-09","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2012-03-30","-1046","0","41","0","N/A","cotrimoxazole"
-"","40705000605","william musili","musyoki","","1965-12-16 00:00:00","50","Adult","","MALE","NO","58","0","0","","69 kikima","","","ctx m/vit","","NO","NO","NO","2010-12-16","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2010-12-16","Active","NO","","","","","","2013-02-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-25","16","0","55","0","N/A","cotrimoxazole"
-"","40705000606","mutiku","nthoki","","2001-12-23 00:00:00","13","Paediatric"," ","MALE","NO","27.6","100","0","","kilyungi pri sch","","","m-tctx",",","NO","NO","NO","2010-12-23","OUTPATIENT","","ART","AZT + 3TC + NVP (< 15YRS PAED)","2010-12-23","Active","NO","","0","","","","2010-12-23","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","100","18","0","N/A","cotrimoxazole"
-"","40705000607","virginia","mwikali","","1987-02-21 00:00:00","28","Adult","","FEMALE","NO","48","0","0","","utangwa","","","ctx m/vit","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-13","4","0","45","0","N/A","cotrimoxazole"
-"","40705000608","regina mukulo","ndumbu","","1611-02-21 00:00:00","410","Adult","","FEMALE","NO","43.9","0","0","","utumoni pry sch","","","ctx m/vit","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-02-21","Active","NO","","","","","","2012-12-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-24","15","0","46","0","N/A","cotrimoxazole"
-"","40705000611","joseph","mithiani","","1973-02-21 00:00:00","43","Adult","","MALE","NO","54","164","0","","nziuni","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2011-02-21","Active","NO","","","","","","2013-03-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-08","58","0","54","0","N/A","cotrimoxazole"
-"","40705000612","mwende","muoki zakaria","","2003-03-18 00:00:00","12","Paediatric","","FEMALE","NO","34","0","0","","kithungo village","","","septrin, m/vit","","NO","NO","NO","2010-03-18","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2010-03-18","NO","","OI Medicines","2015-01-15","-25","0","19.5","0","N/A","cotrimoxazole"
-"","40705000614","mary","musyoka"," m","1963-02-21 00:00:00","53","Adult","","FEMALE","NO","45","163","0","","727148623","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-02-21","Active","NO","","","","","","2012-12-27","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-03-17","36","0","41","0","N/A","cotrimoxazole"
-"","40705000617","josephine","nthenya mutuku","","1983-03-16 00:00:00","32","Adult","","FEMALE","NO","67.5","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-03-16","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-03-16","Active","NO","","","","","","2013-01-17","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-04-07","57","0","44","0","N/A","cotrimoxazole"
-"","40705000618","ngusye","muoki zacharia","","2007-03-11 00:00:00","8","Paediatric","","MALE","NO","19","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-03-11","TRANSFER IN","GOK","ART","OI ONLY","","Active","NO","","","","","","2010-03-11","NO","","ABC + 3TC + EFV (< 15YRS PAED)","2015-02-05","-4","0","10","0","N/A","cotrimoxazole"
-"","40705000619","jckline","mbatha muoki","","1976-03-30 00:00:00","39","Adult","","FEMALE","NO","39","0","0","","","","","septrin, m/vit","","NO","NO","NO","2010-03-30","OUTPATIENT","GOK","ART","C4D (AZT + 3TC + NVP [30 - <40 kg])","2010-03-30","Active","NO","","","","","","2012-11-01","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-11-21","-80","0","37","0","N/A","cotrimoxazole"
-"","40705000620","phillip musau","kavou","","1982-02-21 00:00:00","33","Adult","","MALE","NO","54","159","0","","utumoni pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-02-21","Active","NO","","","","","","2013-03-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","49","0","N/A","cotrimoxazole"
-"","40705000621","john mwatu","","","1980-03-22 00:00:00","35","Adult","","MALE","NO","64","173","0","","","","","multivit/ctx","","NO","NO","NO","2010-03-22","OUTPATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2010-03-22","Active","NO","","","","","","2012-12-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-07","-33","0","55","0","N/A","cotrimoxazole"
-"","40705000622","elizabeth kalewa","ndambuki","","1973-02-21 00:00:00","43","Adult","","FEMALE","NO","56","151","0","","mutito","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-02-21","Active","NO","","","","","","2012-12-30","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-05","-4","0","56","0","N/A","cotrimoxazole"
-"","40705000626","mutua mutuku","","","2009-02-21 00:00:00","6","Paediatric","","MALE","NO","21.7","60","0","","kyangoma pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-15","-25","60","13","0","N/A","cotrimoxazole"
-"","40705000627","elizabeth k","mutuku","","1990-02-21 00:00:00","25","Adult","","FEMALE","NO","63","0","0","","nzeveni pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","59","0","N/A","cotrimoxazole"
-"","40705000628","mutuku","mutua","","2008-05-09","7","Paediatric","426","MALE","NO","19.2","0","0","","","","","","","NO","NO","NO","2013-07-19","OUTPATIENT","GOK","ART","ABC + 3TC + NVP (< 15YRS PAED)","2013-07-19","Lost to follow-up","NO","","","","","","2013-11-14","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2013-08-16","-542","0","19.2","0","N/A","cotrimoxazole"
-"","40705000629","mwende m","mativo","","1989-02-21 00:00:00","26","Adult","","FEMALE","NO","61","0","0","","713195717","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-02-21","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-05-12","-1369","0","61","0","N/A","cotrimoxazole"
-"","40705000630","johhn mulei","mativo","","1960-02-21 00:00:00","56","Adult","","MALE","NO","57","0","0","","uma pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-02-21","NO","","OI ONLY","2011-05-12","-1369","0","52","0","N/A","cotrimoxazole"
-"","40705000631","oliver nzilani","ndinda","","2006-02-21 00:00:00","9","Paediatric","","FEMALE","NO","25","60","0","","syiluni pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-08","-32","60","14","0","N/A","cotrimoxazole"
-"","40705000632","ann mwende","nzyioka","","1983-02-21 00:00:00","32","Adult","","FEMALE","NO","53","0","0","","727403508","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2011-02-21","Active","NO","","","","","","2012-05-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-05","-4","0","52","0","N/A","cotrimoxazole"
-"","40705000633","christine k","ngei","","1972-02-21 00:00:00","44","Adult","","FEMALE","NO","61.5","0","0","","kisueni pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-02-21","Lost to follow-up","NO","","","","","","2014-02-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-11-26","-440","0","55","0","N/A","cotrimoxazole"
-"","40705000635","benson king'oo","","","1973-02-21 00:00:00","43","Adult","","MALE","NO","43.5","0","0","","mung'eli pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-02-21","Lost to follow-up","NO","","","","","","2012-11-22","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-08-24","-899","0","50","0","N/A","cotrimoxazole"
-"","40705000636","esther kathini","","","1988-02-21 00:00:00","27","Adult","","FEMALE","NO","42","0","0","","syiluni pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-02-21","NO","","OI ONLY","2011-03-23","-1419","0","42","0","N/A","cotrimoxazole"
-"","40705000638","jacinta nthenya","mbolu","","1979-02-21 00:00:00","36","Adult","","FEMALE","NO","46","152","0","","715588535","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","46","0","N/A","cotrimoxazole"
-"","40705000641","fransisca mumbua","mulwa","","1969-02-21 00:00:00","47","Adult","","FEMALE","NO","60","0","0","","hetani pry sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","2011-02-21","Transfer out","NO","","","","","","2011-02-21","NO","","OI ONLY","2011-03-23","-1419","0","60","0","N/A","cotrimoxazole"
-"","40705000642","titus mulei","nzavi","","1974-02-21 00:00:00","42","Adult","","MALE","NO","53","0","0","","kilyingi pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-02-21","Active","NO","","","","","","2013-04-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","56","0","N/A","cotrimoxazole"
-"","40705000643","eric","keli ndambuki","","1966-06-07 00:00:00","49","Adult","","MALE","NO","53","0","0","","","","","","","NO","NO","NO","2010-06-07","IN PATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2010-06-07","Active","NO","","","","","","2012-12-17","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-01-01","-39","0","53","0","N/A","cotrimoxazole"
-"","40705000644","richard k","kilonzo","","1951-02-21 00:00:00","65","Adult","","MALE","NO","50","0","0","","713232822","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2011-02-21","Active","NO","","","","","","2012-12-17","NO","","AZT + 3TC + EFV (>15YRS ADULT)","2015-02-19","10","0","60","0","N/A","cotrimoxazole"
-"","40705000645","jane ndungwa","muendo","","1973-02-21 00:00:00","43","Adult","","FEMALE","NO","40","0","0","","musoa pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-07","-33","0","41","0","N/A","cotrimoxazole"
-"","40705000646","martha nthenya","mainga","","1981-02-21 00:00:00","34","Adult","","FEMALE","NO","69","0","0","","720950100","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-07-12","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-04-13","-1032","0","58","0","N/A","cotrimoxazole"
-"","40705000647","dorcus nduku","musyoki","","1988-02-21 00:00:00","27","Adult","","FEMALE","NO","55","0","0","","kyuu pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-05","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-09-06","-1252","0","55","0","N/A","cotrimoxazole"
-"","40705000649","josehpat muli","kithuka","","1979-02-21 00:00:00","36","Adult","","MALE","NO","84","0","0","","718286325","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-02-21","Active","NO","","","","","","2012-12-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-25","44","0","48","0","N/A","cotrimoxazole"
-"","40705000650","cosmas kasyoka","musyimi]","","1949-02-21 00:00:00","67","Adult","","MALE","NO","51.8","165","0","","kathangaini pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-02-21","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","50","0","N/A","cotrimoxazole"
-"","40705000651","ann wamuyu","benard","","1971-02-21 00:00:00","45","Adult","","FEMALE","NO","53.8","0","0","","6/7/10","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","55","0","N/A","cotrimoxazole"
-"","40705000653","john mwendwa","david","","1975-02-21 00:00:00","41","Adult","","MALE","NO","52.7","0","0","","matithini pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-02-21","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","49","0","N/A","cotrimoxazole"
-"","40705000654","patricia munyiva","nguti","","1950-02-21 00:00:00","66","Adult","","FEMALE","NO","52","0","0","","kithangaini","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-02-21","NO","","OI ONLY","2011-03-23","-1419","0","52","0","N/A","cotrimoxazole"
-"","40705000655","nthenya kiilu","mulwa","","1998-02-21 00:00:00","17","Adult","","FEMALE","NO","38","0","0","","kusyongari pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-06-21","NO","","OI ONLY","2011-03-23","-1419","0","38","0","N/A","cotrimoxazole"
-"","40705000656","rhoda wanza","","","1988-02-21 00:00:00","27","Adult","","FEMALE","NO","48","0","0","","712385465","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-12","NO","","OI ONLY","2012-01-13","-1123","0","47","0","N/A","cotrimoxazole"
-"","40705000657","faith muendi","","","2000-02-21 00:00:00","15","Adult","","FEMALE","NO","42.2","0","0","","sda kiveelyo","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-16","-24","0","26","0","N/A","cotrimoxazole"
-"","40705000658","josphine nduku","","","1976-02-21 00:00:00","40","Adult","","FEMALE","NO","85","158","0","","ndiseni pri sch","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-02-21","Active","NO","","","","","","2013-01-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-02","52","0","70","0","N/A","cotrimoxazole"
-"","40705000659","eunice mindo","muli","","1985-02-21 00:00:00","30","Adult","","FEMALE","NO","54","158","0","","727715113","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","AF1A (AZT/ZDV 300mg + 3TC 150mg + NVP 200mg)","2011-02-21","Active","NO","","","","","","2013-03-14","NO","","AZT + 3TC + NVP (< 15YRS PAED)","2015-02-04","-5","0","54","0","N/A","cotrimoxazole"
-"","40705000660","rhoda","benard","ngami","1963-02-21 00:00:00","53","Adult","","FEMALE","NO","54.9","155","0","","717580831","","","","","NO","NO","NO","2011-02-21","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-02-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","52","0","N/A","cotrimoxazole"
-"","40705000662","muthoka","nthenya","","2007-08-12 00:00:00","8","Paediatric","","MALE","NO","16.4","0","0","","","","","","","NO","NO","NO","2010-08-12","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2010-08-12","Active","NO","","","","","","2013-01-03","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","0","10","0","N/A","cotrimoxazole"
-"","40705000663","jennifer munyiva","mutua","","1989-08-12 00:00:00","26","Adult","","FEMALE","NO","39.9","148","0","","","","","","","NO","NO","NO","2010-08-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-08-12","Active","NO","","","","","","2013-01-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-13","-27","0","35","0","N/A","cotrimoxazole"
-"","40705000665","dian nduku","mbuvi","","2005-08-31 00:00:00","10","Paediatric","","FEMALE","NO","22","119","0","","734141259","","","","","NO","NO","NO","2010-08-31","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2010-08-31","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-10","1","100","16","0","N/A","cotrimoxazole"
-"","40705000666","agnes mbithe","kioko","","1975-03-07 00:00:00","41","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-22","NO","","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2012-07-24","-930","0","49","0","N/A","cotrimoxazole"
-"","40705000667","rose ndindi","noah","","1958-03-07 00:00:00","58","Adult","","FEMALE","NO","60","0","0","","726906261","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-06-19","NO","","OI ONLY","2012-03-21","-1055","0","61","0","N/A","cotrimoxazole"
-"","40705000668","pauline kamene","","","1970-03-07 00:00:00","46","Adult","","FEMALE","NO","54.7","0","0","","700908730","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","50","0","N/A","cotrimoxazole"
-"","40705000669","josephine kasisi","mutevu","","1961-03-07 00:00:00","55","Adult","","FEMALE","NO","83","150","0","","726398006","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Active","NO","","","","","","2012-09-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-11","2","150","74","0","N/A","cotrimoxazole"
-"","40705000670","rhoda kamene","kasomo","","1954-03-07 00:00:00","62","Adult","","MALE","NO","40","0","0","","nthaani pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Transfer out","NO","","","","","","2011-03-07","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-05-10","-1371","0","40","0","N/A","cotrimoxazole"
-"","40705000671","dorcus nthenya","kilonzo","","1986-03-07 00:00:00","29","Adult","","FEMALE","NO","45","0","0","","utala pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-06-04","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-03-06","-1070","0","49","0","N/A","cotrimoxazole"
-"","40705000672","ELIZABETH WAVINYA","MUTAVA","","1968-09-14 00:00:00","47","Adult","","FEMALE","NO","50","0","0","","","","","ctx/multivit","","NO","NO","NO","2010-09-14","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-09-14","Active","NO","","","","","","2013-03-14","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","52","0","N/A","cotrimoxazole"
-"","40705000673","denis","kyalo mutava","","2008-09-14 00:00:00","6","Paediatric","","MALE","NO","17.5","0","0","","","","","","","NO","NO","NO","2010-09-14","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2010-09-14","Active","NO","","","","","","2013-01-10","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-16","-24","0","10","0","N/A","cotrimoxazole"
-"","40705000674","christine mueni","murunga","","1964-03-07 00:00:00","52","Adult","","FEMALE","NO","47","0","0","","tanga","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Deceased","NO","","","","","","2011-03-07","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-05","-1315","0","47","0","N/A","cotrimoxazole"
-"","40705000676","dennis kyalo","kioko","","2002-03-07 00:00:00","13","Paediatric","","MALE","NO","25","100","0","","kyanguma pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-16","NO","","OI ONLY","2011-07-18","-1302","100","22","0","N/A","cotrimoxazole"
-"","40705000677","johnstone muthoka","musila","","1975-03-07 00:00:00","41","Adult","","MALE","NO","49.5","0","0","","mulooni pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Active","NO","","","","","","2013-01-07","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","49","0","N/A","cotrimoxazole"
-"","40705000678","judith","mueni","","1991-03-07 00:00:00","24","Adult","","FEMALE","NO","48","150","0","","7192209414","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-03-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-05","-4","0","44","0","N/A","cotrimoxazole"
-"","40705000679","janet","wanza masika","","1994-10-05 00:00:00","21","Adult","","FEMALE","NO","42","0","0","","","","","","","NO","NO","NO","2010-10-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-05","Transfer out","NO","","","","","","2010-10-05","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-06-14","-1336","0","42.5","0","N/A","cotrimoxazole"
-"","40705000680","faith nthoki","mutuku","","1987-03-07 00:00:00","28","Adult","","FEMALE","NO","35","0","0","","muraa pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-08-11","NO","","OI ONLY","2011-05-13","-1368","0","42","0","N/A","cotrimoxazole"
-"","40705000681","monica mwikali","makumi","","1973-03-07 00:00:00","43","Adult","","FEMALE","NO","52","0","0","","kyai","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-05","NO","","OI ONLY","2011-04-06","-1405","0","52","0","N/A","cotrimoxazole"
-"","40705000682","stephen m","mwenga","","1969-03-07 00:00:00","47","Adult","","MALE","NO","40","0","0","","uthiuni","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-05","NO","","OI ONLY","2011-04-06","-1405","0","40","0","N/A","cotrimoxazole"
-"","40705000683","elizabeth ndunge","","","1981-03-07 00:00:00","34","Adult","","FEMALE","NO","46","161","0","","720642283","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-03-07","NO","","OI Medicines","2015-01-29","-11","0","48","0","N/A","cotrimoxazole"
-"","40705000684","stephen mwaluko","mwenga","","1969-03-07 00:00:00","47","Adult","","MALE","NO","54","0","0","","uri pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-03-07","Active","NO","","","","","","2013-02-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-12","3","0","46","0","N/A","cotrimoxazole"
-"","40705000685","grace mwelu","mbevi","","1943-03-07 00:00:00","73","Adult","","FEMALE","NO","56","0","0","","711954760","","","","","YES","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-03-07","Lost to follow-up","NO","","","","","","2013-02-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-11-07","-824","0","47","0","N/A","cotrimoxazole"
-"","40705000686","dominic kyalo","muendo","","1964-03-07 00:00:00","52","Adult"," ","MALE","NO","50.6","0","0","","ithemboni boys","","","",",","NO","NO","NO","2011-03-07","OUTPATIENT","","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-03-07","Active","NO","","0","","","","2012-12-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-21","-19","0","55","0","N/A","cotrimoxazole"
-"","40705000688","doris mumbua","ngonzi","","1970-03-07 00:00:00","46","Adult","","FEMALE","NO","42","0","0","","723469570","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-03-07","NO","","OI ONLY","2011-04-06","-1405","0","42","0","N/A","cotrimoxazole"
-"","40705000689","nehemah mumbe","","","2010-03-07 00:00:00","5","Paediatric","","FEMALE","NO","50","50","0","","713195717","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-09-26","NO","","AZT+3TC+NVP (>15YRS ADULT)","2013-06-28","-591","50","10","0","N/A","cotrimoxazole"
-"","40705000691","susan mutindi","kilonzo","","1983-03-07 00:00:00","32","Adult","","FEMALE","NO","67","0","0","","sdyathani pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-05","NO","","OI ONLY","2011-04-06","-1405","0","67","0","N/A","cotrimoxazole"
-"","40705000693","javason mutulili","nyamai","","1969-03-07 00:00:00","47","Adult","","MALE","NO","46","159","0","","kyamunyae pri sch","","","","","YES","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-03-07","Active","NO","","","","","","2013-01-07","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-14","-26","0","47","0","N/A","cotrimoxazole"
-"","40705000694","jackline wayua","mutinda","","1984-02-04 00:00:00","31","Adult","","FEMALE","NO","57","50","0",""," uthiuni","","","","","NO","NO","NO","2011-02-04","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-01-24","NO","","OI ONLY","2011-10-26","-1202","50","57","0","N/A","cotrimoxazole"
-"","40705000695","charles","mwania","mutinda","1971-03-07 00:00:00","45","Adult","","MALE","NO","61","0","0","","uma pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2011-03-07","Lost to follow-up","NO","","","","","","2014-10-28","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-30","-194","0","58","0","N/A","cotrimoxazole"
-"","40705000696","alice mumbi","mutunga","","1989-03-07 00:00:00","26","Adult","","FEMALE","NO","43","0","0","","mulaitini pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Lost to follow-up","NO","","","","","","2011-07-05","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-04-06","-1405","0","43","0","N/A","cotrimoxazole"
-"","40705000697","benson wambua","","","1982-03-07 00:00:00","33","Adult","","MALE","NO","46","0","0","","726173111","","","","","YES","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-03-07","Lost to follow-up","NO","","","","","","2011-07-05","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-04-06","-1405","0","46","0","N/A","cotrimoxazole"
-"","40705000698","ann ndunge","mutisya","","1985-03-07 00:00:00","30","Adult","","FEMALE","NO","68.7","0","0","","kyuu pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-03-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-07","-33","0","60","0","N/A","cotrimoxazole"
-"","40705000699","ziporah nzilani","muinde","","1977-03-07 00:00:00","38","Adult","","FEMALE","NO","42","0","0","","uma pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-05","NO","","OI ONLY","2011-04-06","-1405","0","42","0","N/A","cotrimoxazole"
-"","40705000700","catherine ndunge","musyoki","","2004-03-07 00:00:00","11","Paediatric","","FEMALE","NO","20","100","0","","uma pry scxh","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-05","NO","","OI ONLY","2011-04-06","-1405","100","20","0","N/A","cotrimoxazole"
-"","40705000701","musyoki ndunge","kilanga","","2009-03-08 00:00:00","6","Paediatric","","MALE","NO","16.5","60","0","","uuta aic","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2011-03-08","Active","NO","","","","","","2013-03-07","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-13","-27","60","6.6","0","N/A","cotrimoxazole"
-"","40705000702","dorothy loko","mutuku","","1971-03-08 00:00:00","45","Adult","","FEMALE","NO","97","0","0","","nzeveni pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-25","16","0","92","0","N/A","cotrimoxazole"
-"","40705000705","benjamin mutinda","ndambuki","","1959-03-08 00:00:00","57","Adult","","MALE","NO","50","0","0","","kithungo pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-08","Lost to follow-up","NO","","","","","","2012-07-23","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-04-24","-1021","0","54","0","N/A","cotrimoxazole"
-"","40705000706","eunice mueni","kyalo","","1986-03-08 00:00:00","29","Adult","","FEMALE","NO","49","0","0","","utumoni pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-08","Transfer out","NO","","","","","","2011-03-08","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-04-07","-1404","0","49","0","N/A","cotrimoxazole"
-"","40705000707","agnes mbutu","mumo","","1954-03-08 00:00:00","62","Adult","","FEMALE","NO","81.5","0","0","","yatwa pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-12-09","-62","0","72","0","N/A","cotrimoxazole"
-"","40705000708","francis ngei","nthatu","","1965-03-08 00:00:00","51","Adult","","MALE","NO","58","0","0","","ukala pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-03-08","NO","","OI ONLY","2011-04-07","-1404","0","58","0","N/A","cotrimoxazole"
-"","40705000709","lucia ndsuku","kioko","","1998-03-08 00:00:00","17","Adult","","FEMALE","NO","18.5","0","0","","ukala pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","CF2B(ABC+3TC+EFV)","2011-03-08","Lost to follow-up","NO","","","","","","2011-07-06","NO","","CF2B(ABC+3TC+EFV)","2011-04-07","-1404","0","18.5","0","N/A","cotrimoxazole"
-"","40705000710","muthiuna muta","","","2004-03-08 00:00:00","11","Paediatric","","MALE","NO","18.5","0","0","","kikima sec","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-08-06","NO","","CF2A(ABC + 3TC + NVP )","2012-05-08","-1007","0","16.5","0","N/A","cotrimoxazole"
-"","40705000713","christine syombua","mutua","","1981-03-08 00:00:00","34","Adult","","FEMALE","NO","48","152","0","","uma pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","46","0","N/A","cotrimoxazole"
-"","40705000714","diana m","wambua","","1981-03-08 00:00:00","34","Adult","","FEMALE","NO","36","0","0","","mutwii pri sc","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-10","1","0","50","0","N/A","cotrimoxazole"
-"","40705000717","elizabeth syomiti","muthama","","1965-01-25 00:00:00","51","Adult","","FEMALE","NO","39.5","153","0","","nzueni primary","","","ctx/multivit","","NO","NO","NO","2011-01-25","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-01-25","Active","NO","","","","","","2013-02-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-05","-4","0","35","0","N/A","cotrimoxazole"
-"","40705000719","ruth amina","muli","","1968-03-08 00:00:00","48","Adult","","FEMALE","NO","33","0","0","","ithemboni girls","","","","","YES","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-03-08","NO","","OI ONLY","2011-04-07","-1404","0","33","0","N/A","cotrimoxazole"
-"","40705000720","mutuku mutua","","","2009-03-08 00:00:00","6","Paediatric","","MALE","NO","16","60","0","","matiithiini pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-05","-4","60","11","0","N/A","cotrimoxazole"
-"","40705000721","james mwanza","muendo","","1980-03-08 00:00:00","35","Adult","","MALE","NO","45","0","0","","kilyungi pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-03-08","NO","","OI ONLY","2011-04-07","-1404","0","45","0","N/A","cotrimoxazole"
-"","40705000723","josphine kamutu","kimatru","","1963-03-08 00:00:00","53","Adult","","FEMALE","NO","34","0","0","","kaseki pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","0","30","0","N/A","cotrimoxazole"
-"","40705000724","boniface ndolo","mutua","","1974-02-01 00:00:00","42","Adult","","MALE","NO","76","0","0","","syathani pri.","","","multivit/ctx","","NO","NO","NO","2011-02-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-22","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-09-23","-1235","0","50","0","N/A","cotrimoxazole"
-"","40705000725","regina","musenya ndolo","","1971-02-01 00:00:00","45","Adult","","FEMALE","NO","61","0","0","","145 kikima","","","","","NO","NO","NO","2011-02-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-02-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-29","-11","0","53","0","N/A","cotrimoxazole"
-"","40705000726","esther kalewa","masesi","","1973-03-08 00:00:00","43","Adult","","FEMALE","NO","38","0","0","","deb pri","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-11-19","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-21","-537","0","37","0","N/A","cotrimoxazole"
-"","40705000727","margaret nthenya","mwanthi","","1976-03-08 00:00:00","39","Adult","","FEMALE","NO","46","0","0","","syiluni","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","51","0","N/A","cotrimoxazole"
-"","40705000728","ann nthenya","muli","","1972-03-08 00:00:00","44","Adult","","FEMALE","NO","50","0","0","","719840174","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","50","0","N/A","cotrimoxazole"
-"","40705000729","dorcas","wanza ndeti","","1971-02-10 00:00:00","45","Adult","","FEMALE","NO","38.8","0","0","","box 96 kikima","","","","","NO","NO","NO","2011-02-10","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-05-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-02-24","-350","0","46.5","0","N/A","cotrimoxazole"
-"","40705000730","mashaka","syomiti","","2006-02-15 00:00:00","9","Paediatric","","FEMALE","NO","17.4","0","0","","","","","","","NO","NO","NO","2011-02-15","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2011-02-15","Active","NO","","","","","","2013-02-04","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-05","-4","0","12.5","0","N/A","cotrimoxazole"
-"","40705000731","richard mutua","mutisya","","1960-03-08 00:00:00","56","Adult","","MALE","NO","52","0","0","","utumoni pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","2011-03-08","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-15","-25","0","50","0","N/A","cotrimoxazole"
-"","40705000732","KELI NGEWA","","","1968-03-15 00:00:00","48","Adult","","MALE","NO","47","0","0","","ITHEMBONI PRI SCH","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-07-13","NO","","AF1B (AZT/ZDV 300mg + 3TC 150mg + EFV 600mg)","2012-04-14","-1031","0","45","0","N/A","cotrimoxazole"
-"","40705000733","ann mueni","mutua","","1976-03-08 00:00:00","39","Adult","","FEMALE","NO","36","0","0","","mbooni boys","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-02-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-11-06","-825","0","50","0","N/A","cotrimoxazole"
-"","40705000734","tabitha mbatha","muendo","","1969-03-08 00:00:00","47","Adult","","FEMALE","NO","50","0","0","","kinyee pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-03-08","NO","","OI ONLY","2011-04-07","-1404","0","50","0","N/A","cotrimoxazole"
-"","40705000735","elizabeth mwikali","kilonzo","","1982-03-08 00:00:00","33","Adult","","FEMALE","NO","28","0","0","","nzeveni pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2013-12-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2013-09-03","-524","0","87","0","N/A","cotrimoxazole"
-"","40705000824","mary syombua","mutiso","","1981-03-08 00:00:00","34","Adult"," ","FEMALE","NO","34","0","0","","mukaationi pri sc","","","",",","NO","NO","NO","2011-03-08","OUTPATIENT","","OI Only","OI ONLY","","Active","NO","","0","","","","2014-11-20","NO","","OI Medicines","2015-03-25","44","0","50","0","N/A","cotrimoxazole"
-"","40705000737","magdalene mueni","mutunga","","1958-03-08 00:00:00","58","Adult","","FEMALE","NO","44","0","0","","ithemboni boys","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-06","-34","0","50","0","N/A","cotrimoxazole"
-"","40705000738","PHYLIS MBULA","KASYALI","","1965-03-15 00:00:00","51","Adult","","FEMALE","NO","61","0","0","","MUTULA NGUU PRI","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-15","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-23","-17","0","56","0","N/A","cotrimoxazole"
-"","40705000739","MUIA KASYALI","","","2003-03-15 00:00:00","12","Paediatric","","MALE","NO","26.6","0","0","","NZEVENI","","","","","NO","NO","NO","2011-03-15","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-15","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","20","0","N/A","cotrimoxazole"
-"","40705000740","ann","","kalondu","1977-03-08 00:00:00","38","Adult","","FEMALE","NO","45","0","0","","kaliani pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-10-13","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-07-15","-209","0","50","0","N/A","cotrimoxazole"
-"","40705000741","judith mbula","amos munyao","","1975-03-03 00:00:00","41","Adult","","FEMALE","NO","42","0","0","","","","","ctx/multivit","","NO","NO","NO","2011-03-03","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-03-03","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-06-28","-1322","0","41","0","N/A","cotrimoxazole"
-"","40705000742","esther mueni","muendo","","1952-03-08 00:00:00","64","Adult","","FEMALE","NO","60","0","0","","muthinanio pri sch","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-03-08","NO","","OI ONLY","2011-04-07","-1404","0","60","0","N/A","cotrimoxazole"
-"","40705000743","jackson ndinda","mwithui","","1976-03-08 00:00:00","39","Adult","","MALE","NO","56.2","0","0","","712001423","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-03-08","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-04","23","0","60","0","N/A","cotrimoxazole"
-"","40705000744","jackline mbeneka","mwanza","","1983-02-04 00:00:00","32","Adult","","FEMALE","NO","46","0","0","","utangwa primary","","","cotrimoxazole/multivitamin","","NO","NO","NO","2011-02-04","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-03-03","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-12-03","-433","0","44","0","N/A","cotrimoxazole"
-"","407050007444ka","jackline mbeneka","mwanza","","1983-02-04 00:00:00","32","Adult","","FEMALE","NO","44","0","0","","utangwa primary","","","ctx/multivit","","NO","NO","NO","2011-02-04","OUTPATIENT","GOK","OI Only","OI ONLY","","Stopped due to duplication","NO","","","","","","2011-02-04","NO","","OI ONLY","2011-04-26","-1385","0","44","0","N/A","cotrimoxazole"
-"","40705000745","richard","kioko muia","","1981-03-08 00:00:00","34","Adult","","MALE","NO","42.5","0","0","","","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-07-04","NO","","OI ONLY","2011-04-05","-1406","0","42.5","0","N/A","cotrimoxazole"
-"","40705000746","calcaster","mukoyo kivuva","","1989-03-08 00:00:00","26","Adult","","FEMALE","NO","55.5","0","0","","","","","","","NO","NO","NO","2011-03-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-26","NO","","OI ONLY","2011-09-27","-1231","0","54.5","0","N/A","cotrimoxazole"
-"","40705000747","agnea mbetye","wambua","","1977-03-14 00:00:00","38","Adult","","FEMALE","NO","47","156","0","","714719283","","","","","NO","NO","NO","2011-03-14","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-14","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","46","0","N/A","cotrimoxazole"
-"","40705000748","catherine","muoki","","1964-01-25 00:00:00","52","Adult","","FEMALE","NO","54","0","0","","","","","","","YES","NO","NO","2011-01-25","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-01-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-08","-32","0","44","0","N/A","cotrimoxazole"
-"","40705000749","christine","nzilani muendo","","1966-03-16 00:00:00","50","Adult","","FEMALE","NO","56","0","0","","","","","","","NO","NO","NO","2011-03-16","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-12-12","NO","","OI ONLY","2011-09-13","-1245","0","46.5","0","N/A","cotrimoxazole"
-"","40705000750","christine nzilani","","","1957-03-28 00:00:00","59","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2011-03-28","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-28","Lost to follow-up","NO","","","","","","2011-07-10","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-04-11","-1400","0","44","0","N/A","cotrimoxazole"
-"","40705000751","pauline mwende","sammy","","1976-02-06 00:00:00","40","Adult","","FEMALE","NO","39.3","0","0","","","","","","","NO","NO","NO","2012-02-06","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-02-06","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-13","-27","0","36","0","N/A","cotrimoxazole"
-"","40705000752","esther mueni","","","1954-03-25 00:00:00","62","Adult","","FEMALE","NO","58","0","0","","yatwa primary","","","cotrimoxazole","","NO","NO","NO","2011-03-25","OUTPATIENT","GOK","ART","OI ONLY","2011-03-25","Active","NO","","","","","","2011-03-25","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-04-08","58","0","45","0","N/A","cotrimoxazole"
-"","40705000753","mary kariri","mutuku","","1974-03-29 00:00:00","41","Adult","","FEMALE","NO","47","0","0","","utangwa","","","","","NO","NO","NO","2010-03-29","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-03-29","Active","NO","","","","","","2013-02-04","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-24","15","0","40","0","N/A","cotrimoxazole"
-"","40705000755","ann kanyira","","","1972-01-12 00:00:00","44","Adult","","FEMALE","NO","54.9","0","0","","","","","","","NO","NO","NO","2012-01-12","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-01-12","Lost to follow-up","NO","","","","","","2015-02-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-11-11","-90","0","50.5","0","N/A","cotrimoxazole"
-"","40705000756","karindu kimuyu","","","1976-07-01 00:00:00","39","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2011-07-01","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-07-01","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-04","23","0","43","0","N/A","cotrimoxazole"
-"","40705000757","mary minoo","muema","","1953-06-20 00:00:00","63","Adult","","FEMALE","NO","55","0","0","","ukala pri sch","","","","","NO","NO","NO","2011-06-20","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2014-04-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-01-30","-375","0","54","0","N/A","cotrimoxazole"
-"","40705000759","PATRICK MUNYAO","MUTUA","","1981-04-11 00:00:00","34","Adult","","MALE","NO","72","0","0","","ITHEMBONI GIRLS","","","CTX/MULTIVIT","","NO","NO","NO","2011-04-11","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-04-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","50","0","N/A","cotrimoxazole"
-"","40705000760","eunice mumbua","mutuku","","1963-04-08 00:00:00","53","Adult","","FEMALE","NO","82","0","0","","mbooni boys","","","ctx/multivit","","YES","NO","NO","2011-04-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-04-08","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-08","-32","0","66","0","N/A","cotrimoxazole"
-"","40705000761","SAMSON MUTINDA","WAMBUA","","1982-04-12 00:00:00","33","Adult","","MALE","NO","59","0","0","","717151467","","","CTX/MULTIVITAMIN","","NO","NO","NO","2011-04-12","","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-01-29","NO","","OI ONLY","2011-10-31","-1197","0","59","0","N/A","cotrimoxazole"
-"","40705000762","jonathan mutinda","maweu","","1979-04-01 00:00:00","36","Adult","","MALE","NO","55.5","167","0","","ndueni primary","","","cotrimoxazole/mulltivit","","NO","NO","NO","2011-04-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-27","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-09-28","-864","0","65","0","N/A","cotrimoxazole"
-"","40705000763","dorothy","mbatha mulwa","","2005-04-14 00:00:00","10","Paediatric","","FEMALE","NO","21.9","0","0","","","","","","","NO","NO","NO","2011-04-14","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-04-14","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-05","-4","0","11","0","N/A","cotrimoxazole"
-"","40705000764","ester","wanzuu muvea","","1964-04-19 00:00:00","52","Adult","","FEMALE","NO","33","157","0","","","","","","","NO","NO","NO","2011-04-19","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-11-29","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2012-08-31","-892","0","42","0","N/A","cotrimoxazole"
-"","40705000765","mutinda","keli","","2006-04-26 00:00:00","9","Paediatric","","MALE","NO","25","0","0","","","","","","","NO","NO","NO","2011-04-26","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-04-26","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","17","0","N/A","cotrimoxazole"
-"","40705000766","juliana","karimi","","1966-03-30 00:00:00","50","Adult","","FEMALE","NO","64.8","0","0","","kikima","","","cotrimoxazole/multivit","","NO","NO","NO","2011-03-30","OUTPATIENT","GOK","ART","OI ONLY","2011-03-30","Active","NO","","","","","","2011-03-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","60","0","N/A","cotrimoxazole"
-"","40705000767","janet","mwikali mutisya","","1976-04-26 00:00:00","39","Adult","","FEMALE","NO","43","0","0","","","","","","","NO","NO","NO","2011-04-26","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-04-26","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-05","-1315","0","44","0","N/A","cotrimoxazole"
-"","40705000768","grace","mbithe musyoka","","1981-04-26 00:00:00","34","Adult","","FEMALE","NO","31","0","0","","","","","","","NO","NO","NO","2011-04-26","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-04-26","NO","","OI ONLY","2011-05-23","-1358","0","31","0","N/A","cotrimoxazole"
-"","40705000769","dorothy","mwikali john","","1964-03-07 00:00:00","52","Adult","","FEMALE","NO","63.6","160","0","","itetani pri sch","","","","","NO","NO","NO","2011-03-07","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-03-07","Active","NO","","","","","","2012-12-17","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","40.5","0","N/A","cotrimoxazole"
-"","40705000770","joyce","wanza mutinda","","1984-05-01 00:00:00","31","Adult","","FEMALE","NO","31","0","0","","","","","","","NO","NO","NO","2011-05-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-05-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-06-09","-1341","0","33","0","N/A","cotrimoxazole"
-"","40705000771","eunice mwikali","","","1979-06-22 00:00:00","36","Adult","","FEMALE","NO","49.7","0","0","","725005360","","","","","NO","NO","NO","2011-06-22","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","47","0","N/A","cotrimoxazole"
-"","40705000772","christine","wambui muthini","","1985-05-06 00:00:00","30","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-05-06","OUTPATIENT","GOK","OI Only","OI ONLY","","Transfer out","NO","","","","","","2011-05-06","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-07-20","-1300","0","50","0","N/A","cotrimoxazole"
-"","40705000774","anne","mueni mulei","","1984-01-11 00:00:00","32","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-01-11","TRANSFER IN","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-01-11","Lost to follow-up","NO","","","","","","2012-02-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-11-03","-1194","0","50","0","N/A","cotrimoxazole"
-"","40705000775","cecillia ndanu","mbuvi","","2008-05-11 00:00:00","7","Paediatric","","FEMALE","NO","14","93.5","0","","","","","","","NO","NO","NO","2011-05-11","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2011-05-11","Active","NO","","","","","","2012-12-02","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-10","1","0","8","0","N/A","cotrimoxazole"
-"","40705000777","rosalia kanini","kiluni","","1961-05-16 00:00:00","55","Adult","","FEMALE","NO","42.9","0","0","","","","","","","NO","NO","NO","2011-05-16","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-05-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","37","0","N/A","cotrimoxazole"
-"","40705000778","esther kanini","","mutinda","1974-06-09 00:00:00","41","Adult","","FEMALE","NO","67.7","156","0","","247 kikima","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","ART","OI ONLY","2011-06-09","Active","NO","","","","","","2012-12-10","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","59","0","N/A","cotrimoxazole"
-"","40705000779","joseph","kyama muya","","1955-05-17 00:00:00","61","Adult","","MALE","NO","54","0","0","","","","","","","NO","NO","NO","2011-05-17","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-05-28","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-02-28","-1077","0","50","0","N/A","cotrimoxazole"
-"","40705000780","mary muthina","mutua","","1973-06-09 00:00:00","42","Adult","","FEMALE","NO","45","0","0","","nzeveni pri sch","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-05","NO","","OI ONLY","2011-07-07","-1313","0","45","0","N/A","cotrimoxazole"
-"","40705000781","reginah muteti","mbithi","","1958-06-09 00:00:00","57","Adult","","FEMALE","NO","60.8","0","0","","ivutini pri","","","","","NO","NO","NO","2011-06-09","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-09","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-11","2","0","53","0","N/A","cotrimoxazole"
-"","40705000782","faith mbula","nyamai","","2007-05-26 00:00:00","8","Paediatric","","FEMALE","NO","30.3","122.2","0","","","","","","","NO","NO","NO","2011-05-26","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2011-05-26","Active","NO","","","","","","2013-03-11","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-10","1","0","16","0","N/A","cotrimoxazole"
-"","40705000783","faith ndunge","nyamai","","2009-05-26 00:00:00","6","Paediatric","","FEMALE","NO","19","101.8","0","","","","","","","NO","NO","NO","2011-05-26","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2011-05-26","Active","NO","","","","","","2013-03-11","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-02-10","1","0","10","0","N/A","cotrimoxazole"
-"","40705000784","rose mbithe","kyule","","1951-06-20 00:00:00","65","Adult","","FEMALE","NO","43","0","0","","mutitu pri sch","","","","","NO","NO","NO","2011-06-20","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-20","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","60","0","N/A","cotrimoxazole"
-"","40705000785","sila kasyoka","","","1998-06-28 00:00:00","17","Adult","","MALE","NO","41","0","0","","725657445","","","","","NO","NO","NO","2011-06-28","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2011-06-28","Lost to follow-up","NO","","","","","","2015-02-04","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-11-06","-95","0","29","0","N/A","cotrimoxazole"
-"","40705000793","jackline mukui","mwaliko","","2005-06-07 00:00:00","10","Paediatric","","FEMALE","NO","27","0","0","","uvi pri","","","","","NO","NO","NO","2011-06-07","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-07","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","17","0","N/A","cotrimoxazole"
-"","40705000794","caroline karimi","keli","","1976-06-22 00:00:00","39","Adult","","FEMALE","NO","53","0","0","","716729913","","","","","NO","NO","NO","2011-06-22","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-11-07","NO","","OI ONLY","2011-08-09","-1280","0","50","0","N/A","cotrimoxazole"
-"","40705000796","consolata wambua","","","2010-07-01 00:00:00","5","Paediatric","","FEMALE","NO","8","50","0","","umma pry sch","","","","","NO","NO","NO","2011-07-01","OUTPATIENT","GOK","ART","C9C(ABC + 3TC + NVP )","2011-07-01","Lost to follow-up","NO","","","","","","2012-01-02","NO","","CF2A(ABC + 3TC + NVP )","2011-10-04","-1224","50","6","0","N/A","cotrimoxazole"
-"","40705000797","jacinta syombua","john","","1978-06-28 00:00:00","37","Adult","","FEMALE","NO","59","0","0","","715199993","","","","","NO","NO","NO","2011-06-28","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-24","15","0","61","0","N/A","cotrimoxazole"
-"","40705000798","elizabeth kinyua","","","1978-06-28 00:00:00","37","Adult","","FEMALE","NO","54","0","0","","utangwa","","","","","NO","NO","NO","2011-06-28","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-11-01","NO","","OI ONLY","2011-08-03","-1286","0","40","0","N/A","cotrimoxazole"
-"","40705000799","penninah","nthoki mwalyo","","1981-06-27 00:00:00","34","Adult","","FEMALE","NO","53.2","0","0","","","","","","","NO","NO","NO","2011-06-27","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-06-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-03-10","29","0","43","0","N/A","cotrimoxazole"
-"","40705000800","peter kiilu","","","1958-06-08 00:00:00","58","Adult","","MALE","NO","63","0","0","","","","","","","NO","NO","NO","2011-06-08","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2011-10-27","NO","","OI ONLY","2011-07-29","-1291","0","63","0","N/A","cotrimoxazole"
-"","40705000802","patrick","muendo maitya","","1976-07-13 00:00:00","39","Adult","","MALE","NO","43","0","0","","","","","","","NO","NO","NO","2011-07-13","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-07-13","NO","","OI ONLY","2011-08-31","-1258","0","45","0","N/A","cotrimoxazole"
-"","40705000803","susan","ndumi muli","","1982-07-19 00:00:00","33","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-07-19","OUTPATIENT","GOK","ART","OI ONLY","2011-07-19","Lost to follow-up","NO","","","","","","2011-10-31","NO","","OI ONLY","2011-08-02","-1287","0","50","0","N/A","cotrimoxazole"
-"","40705000805","catherine","katumi","","1977-07-26 00:00:00","38","Adult","","FEMALE","NO","73.2","0","0","","","","","","","NO","NO","NO","2011-07-26","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-07-26","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-20","-20","0","71","0","N/A","cotrimoxazole"
-"","40705000806","minoo kimatu","","","2003-08-05 00:00:00","12","Paediatric","","FEMALE","NO","26","0","0","","715274100","","","","","NO","NO","NO","2011-08-05","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-08-05","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","19.5","0","N/A","cotrimoxazole"
-"","40705000807","jennifer","syombua mutisya","","1977-07-27 00:00:00","38","Adult","","FEMALE","NO","69","0","0","","","","","","","NO","NO","NO","2011-07-27","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-04","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2012-07-06","-948","0","64","0","N/A","cotrimoxazole"
-"","40705000808","ruth","kavindu","","1975-07-28 00:00:00","40","Adult","","FEMALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-07-28","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-05-31","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-03-02","-1074","0","50","0","N/A","cotrimoxazole"
-"","40705000809","mutuku","mbithi","","1972-07-29 00:00:00","43","Adult","","MALE","NO","52","0","0","","","","","","","NO","NO","NO","2011-07-29","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2011-07-29","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-13","-1154","0","48","0","N/A","cotrimoxazole"
-"","40705000810","anne","ndinda nthenge","","1978-03-10 00:00:00","37","Adult","","FEMALE","NO","35","0","0","","","","","","","NO","NO","NO","2011-03-10","OUTPATIENT","GOK","PEP","OI ONLY","2011-03-10","PEP end","NO","","","","","","2011-04-09","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-01-16","-389","0","49","0","N/A","cotrimoxazole"
-"","40705000811","juliana","nthiw'a","mbatha","1988-09-06 00:00:00","27","Adult","","FEMALE","NO","65","0","0","","","","","","","NO","NO","NO","2011-09-06","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-09-06","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-27","-13","0","57","0","N/A","cotrimoxazole"
-"","40705000812","jennifer","ndungwa mulu","","1975-08-01 00:00:00","40","Adult","","FEMALE","NO","43.9","139","0","","","","","","","NO","NO","NO","2011-08-01","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-08-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-29","-11","0","45","0","N/A","cotrimoxazole"
-"","40705000813","lilian","nduku","","1990-05-06","25","Adult","","FEMALE","NO","55","0","0","","","","","","","NO","NO","NO","2012-11-05","OUTPATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2012-11-05","Lost to follow-up","NO","","","","","","2014-12-30","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-10-01","-131","0","53","0","N/A","cotrimoxazole"
-"","40705000814","kyalo","paul kyove","","1978-08-09 00:00:00","37","Adult","","MALE","NO","64.3","0","0","","","","","","","NO","NO","NO","2011-08-09","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-08-09","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-02-25","16","0","62","0","N/A","cotrimoxazole"
-"","40705000815","JONATHAN NYAMAI","","","1959-09-03 00:00:00","56","Adult","","MALE","NO","61","0","0","","","","","","","NO","NO","NO","2011-09-03","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-09-03","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-04","-5","0","50","0","N/A","cotrimoxazole"
-"","40705000816","agnes mutheu","ngao","","1968-09-03 00:00:00","47","Adult","","FEMALE","NO","43","0","0","","","","","","","NO","NO","NO","2011-09-03","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-09-03","Lost to follow-up","NO","","","","","","2014-08-27","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-05-29","-256","0","40.5","0","N/A","cotrimoxazole"
-"","40705000817","DIANA KATUMI","NZIOKA","","1981-08-11 00:00:00","34","Adult","","FEMALE","NO","56","167","0","","710497821","","","CTX/MULTIVIT","","NO","NO","NO","2011-08-11","TRANSFER IN","GOK","ART","OI ONLY","2011-08-11","Active","NO","","","","","","2013-03-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-10","1","0","52","0","N/A","cotrimoxazole"
-"","40705000818","paul kivuva","muiaa","","1971-09-03 00:00:00","44","Adult"," ","MALE","NO","57","0","0","","","","","",",","NO","NO","NO","2011-09-03","OUTPATIENT","","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-09-03","Active","NO","","0","","","","2014-04-24","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-17","8","0","16.5","0","N/A","Dapsone"
-"","40705000820","serah","syokau kiio","","1951-07-28 00:00:00","64","Adult","","FEMALE","NO","36","0","0","","","","","","","NO","NO","NO","2011-07-28","OUTPATIENT","GOK","ART","OI ONLY","2011-07-28","Lost to follow-up","NO","","","","","","2014-11-23","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2014-08-25","-168","0","31","0","N/A","cotrimoxazole"
-"","40705000821","christine","syombua","","1976-08-16 00:00:00","39","Adult","","FEMALE","NO","51","160","0","","","","","","","NO","NO","NO","2011-08-16","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-08-16","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","0","48","0","N/A","cotrimoxazole"
-"","40705000823","nthenya","elizabeth","","1983-06-08","32","Adult","","FEMALE","NO","62","0","0","","","","","","","NO","NO","NO","2013-06-04","OUTPATIENT","GOK","OI Only","OI Medicines","","Active","NO","","","","","","2013-06-04","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-27","-13","0","58","0","N/A","cotrimoxazole"
-"","40705000825","joseph","muendo musau","","2002-08-23 00:00:00","13","Paediatric","","MALE","NO","26","0","0","","","","","","","NO","NO","NO","2011-08-23","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-08-23","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-13","-27","0","18","0","N/A","cotrimoxazole"
-"","40705000826","faith","mwanzia","","1986-05-12","29","Adult","","FEMALE","NO","52.8","0","0","","","","","","","NO","NO","NO","2011-06-09","IN PATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2011-06-09","Active","NO","","","","","","2013-10-01","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-11","30","0","50.4","0","N/A","cotrimoxazole"
-"","40705000827","erastus muli","","","1975-08-30 00:00:00","40","Adult","","MALE","NO","44","0","0","","","","","","","NO","NO","NO","2011-08-30","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-03","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-09-04","-888","0","50","0","N/A","cotrimoxazole"
-"","40705000828","veronica","muli","MUENDI","1976-08-30 00:00:00","39","Adult","","FEMALE","NO","56.5","0","0","","","","","","","NO","NO","NO","2011-08-30","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-08-30","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-18","9","0","45","0","N/A","cotrimoxazole"
-"","40705000831","SALOME","MUTINDA","MBULA","1976-09-05 00:00:00","39","Adult","","FEMALE","NO","56","0","0","","713112865","","","CTX/M/TVIT","","NO","NO","NO","2011-09-05","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-09-05","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-08","-32","0","61","0","N/A","cotrimoxazole"
-"","40705000833","stephen","mwikali","mutua","1993-02-23 00:00:00","22","Adult","","MALE","NO","58","0","0","","","","","","","NO","NO","NO","2012-02-23","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-10-29","NO","","OI ONLY","2012-07-31","-923","0","57","0","N/A","cotrimoxazole"
-"","40705000834","mary","mbatha","munyao","1998-01-19 00:00:00","17","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2012-01-19","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2012-01-19","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-12","3","0","30","0","N/A","cotrimoxazole"
-"","40705000836","NGINA","KYALO","","1986-09-19 00:00:00","29","Adult","","FEMALE","YES","55","0","0","","UTANGWA","","","CTX/MULTIVIT","","NO","NO","NO","2011-09-19","OUTPATIENT","GOK","PMTCT","PMTCT 3M (AZT 300mg BD (from week 28-40); then NVP 200mg stat + 2 tabs of AZT/3TC 300/150mg stat during labour; then 1 tab of AZT / 3TC 300/150mg BD for one week post-partum)","2011-09-19","Lost to follow-up","NO","","","","","","2012-02-16","NO","","PMTCT 3M (AZT 300mg BD (from week 28-40); then NVP 200mg stat + 2 tabs of AZT/3TC 300/150mg stat during labour; then 1 tab of AZT / 3TC 300/150mg BD for one week post-partum)","2011-11-18","-1179","0","55","0","N/A","cotrimoxazole"
-"","40705000837","DAVID","MULEE","wambuA","1997-09-20 00:00:00","18","Adult","","MALE","NO","25","0","0","","KYANGOMA PRIMARY","","","CTX/MULTIVIT","","NO","NO","NO","2011-09-20","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-12","NO","","OI ONLY","2012-01-13","-1123","0","23","0","N/A","cotrimoxazole"
-"","40705000839","rhoda","","mbithe","2005-10-25 00:00:00","9","Paediatric","","FEMALE","NO","21.6","113","0","","","","","","","NO","NO","NO","2011-10-25","OUTPATIENT","GOK","ART","CF2A(ABC + 3TC + NVP )","2011-10-25","Lost to follow-up","NO","","","","","","2013-12-01","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2013-09-02","-525","0","17.5","0","N/A","cotrimoxazole"
-"","40705000840","rose","mbaluka","kavata","1962-09-28 00:00:00","53","Adult","","FEMALE","NO","47","0","0","","","","","","","NO","NO","NO","2009-09-28","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2009-09-28","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","37","0","N/A","cotrimoxazole"
-"","40705000841","francis","muthiani","musembi","1942-09-28 00:00:00","73","Adult","","MALE","NO","35","0","0","","","","","","","NO","NO","NO","2009-09-28","OUTPATIENT","GOK","OI Only","OI ONLY","","Deceased","NO","","","","","","2009-09-28","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-02-14","-1091","0","60","0","N/A","cotrimoxazole"
-"","40705000842","teresia","muendo","","1964-10-11 00:00:00","51","Adult","","FEMALE","NO","52","0","0","","","","","","","NO","NO","NO","2011-10-11","OUTPATIENT","GOK","ART","OI ONLY","2011-10-11","Active","NO","","","","","","2011-10-11","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-12","3","0","47","0","N/A","cotrimoxazole"
-"","40705000845","jacinta","mwende","","1980-04-04","35","Adult","","FEMALE","NO","48","0","0","","","","","","","NO","NO","NO","2011-09-27","TRANSIT","GOK","OI Only","OI Medicines","","Lost to follow-up","NO","","","","","","2013-02-05","NO","","OI Medicines","2012-11-07","-824","0","48","0","N/A","cotrimoxazole"
-"","40705000846","daniel","mutuku","mbaluka","1959-10-05 00:00:00","56","Adult","","MALE","NO","62","0","0","","24 kikima","","","","","YES","NO","NO","2011-10-05","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-10-05","Deceased","NO","","","","","","2011-10-05","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-14","-1153","0","62","0","N/A","cotrimoxazole"
-"","40705000847","mirrium","kisila","m","1990-01-02","25","Adult","","FEMALE","NO","52.3","0","0","","","","","","","NO","NO","NO","2013-02-01","OUTPATIENT","GOK","ART","TDF + 3TC + NVP (>15YRS ADULT)","2013-02-01","Active","NO","","","","","","2014-01-02","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-10","29","0","56.6","0","N/A","cotrimoxazole"
-"","40705000850","penina","","kanini","1964-10-14 00:00:00","51","Adult","","FEMALE","NO","44","0","0","","","","","","","NO","NO","NO","2011-10-14","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-04-19","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-01-20","-1116","0","48","0","N/A","cotrimoxazole"
-"","40705000851","NTHOKI","NYAMAI","","2000-10-13 00:00:00","15","Adult","","FEMALE","NO","34","135","0","","711921809","","","CTX/MULTIVIT","","NO","NO","NO","2011-10-13","OUTPATIENT","GOK","ART","OI ONLY","","Active","NO","","","","","","2011-10-13","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-01-15","-25","0","24","0","N/A","cotrimoxazole"
-"","40705000852","JAMES","NZOLA"," KIOKO","1965-10-18 00:00:00","50","Adult","","MALE","NO","82","0","0","","712522410","","","COTRIMOXAZOLE/MULTIVIT","","NO","NO","NO","2011-10-18","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-10-18","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-08","-32","0","83","0","N/A","cotrimoxazole"
-"","40705000853","NGULA","MATHEKA","KITIVO","1969-10-11 00:00:00","46","Adult","","MALE","NO","52","0","0","","MUTITU","","","CTX/MULTIVIT","","NO","NO","NO","2011-10-11","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-03-15","NO","","OI ONLY","2011-12-16","-1151","0","49","0","N/A","cotrimoxazole"
-"","40705000854","CATHERINE","MUEKE","MUMO","1973-10-04 00:00:00","42","Adult","","FEMALE","NO","55","0","0","","736348526","","","COTRIMOXAZOLE/MULTIVIT","","NO","NO","NO","2011-10-04","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-12-10","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-09-11","-881","0","62","0","N/A","cotrimoxazole"
-"","40705000855","BONFACE","MULI","MWANZIA","1987-10-21 00:00:00","28","Adult","","MALE","NO","58","0","0","","739544539","","","CTX/MULTIVIT","","NO","NO","NO","2011-10-21","OUTPATIENT","GOK","OI Only","OI ONLY","","Lost to follow-up","NO","","","","","","2012-02-29","NO","","OI ONLY","2011-12-01","-1166","0","58","0","N/A","cotrimoxazole"
-"","40705000857","zipporah","david","","1979-11-25 00:00:00","36","Adult","","FEMALE","NO","63","0","0","","","","","","","NO","NO","NO","2011-11-25","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-11-25","Active","NO","","","","","","2012-12-24","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-12","3","0","60","0","N/A","cotrimoxazole"
-"","40705000860","vinent","","mutinda","1976-12-20 00:00:00","39","Adult","","MALE","NO","50.5","0","0","","","","","","","NO","NO","NO","2011-12-20","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-20","Active","NO","","","","","","2012-11-29","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","48.5","0","N/A","cotrimoxazole"
-"","40705000861","benjamin","muia","kioko","1971-11-22 00:00:00","44","Adult","","MALE","NO","57","158","0","","","","","","","NO","NO","NO","2011-11-22","OUTPATIENT","GOK","OI Only","OI ONLY","","Active","NO","","","","","","2011-11-22","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-27","-13","0","45","0","N/A","cotrimoxazole"
-"","40705000862","james kioko","nzola","","1955-11-29 00:00:00","60","Adult","","FEMALE","NO","70","170","0","","","","","","","NO","NO","NO","2011-11-29","OUTPATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-11-29","Stopped due to duplication","NO","","","","","","2012-03-26","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-12-27","-1140","170","70","0","N/A","cotrimoxazole"
-"","40705000885","sammy","musyoka","","1966-11-25 00:00:00","49","Adult","","MALE","NO","53","0","0","","","","","","","NO","NO","NO","2011-11-25","OUTPATIENT","GOK","ART","AF2B(TDF300MG+3TC150MG+EFV600MG)","2011-11-25","Lost to follow-up","NO","","","","","","2012-04-30","NO","","AF2B(TDF300MG+3TC150MG+EFV600MG)","2012-01-31","-1105","0","51","0","N/A","cotrimoxazole"
-"","4070500104","SUSAN","MUTINDI","","1949-05-21 00:00:00","67","Adult","","FEMALE","NO","52","0","0","","","","","SEPTRIN,M/VIT","","NO","NO","NO","2007-05-21","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-05-21","Stopped due to duplication","NO","","","","","","2007-05-21","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","52","0","N/A","cotrimoxazole"
-"","4070500107","ELIZABETH","MUTHIANI","","1980-04-12 00:00:00","35","Adult","","FEMALE","NO","47","0","0","","","","","M/VIT, P/CET, PIRITON","","NO","NO","NO","2007-04-12","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-04-12","Stopped due to duplication","NO","","","","","","2007-04-12","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","47","0","N/A","cotrimoxazole"
-"","4070500108","REGINA"," WAMBUA","NTHENYA","1975-04-08 00:00:00","40","Adult","","FEMALE","NO","59","0","0","","","","","BRUFEN, PIRITON, P/CET","","NO","NO","NO","2007-04-08","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-04-08","Stopped due to duplication","NO","","","","","","2007-04-08","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","59","0","N/A","cotrimoxazole"
-"","4070500113","VERONICA"," KASIMU","MWIKALI","1989-09-06 00:00:00","26","Adult","","FEMALE","NO","66","0","0","","","","","","","NO","NO","NO","2009-09-06","OUTPATIENT","GOK","ART","1B (d4T 40mg + 3TC 150mg + NVP 200mg [> 60Kg])","2009-09-06","Lost to follow-up","NO","","","","","","2011-08-29","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-05-31","-1350","0","62","0","N/A","cotrimoxazole"
-"","4070500115","MARY","PENINAH MUOKA","","1973-07-07 00:00:00","42","Adult","","FEMALE","NO","54","0","0","","","","","PIRITON, M/VIT, P/CET","","NO","NO","NO","2006-07-07","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2006-07-07","Stopped due to duplication","NO","","","","","","2006-07-07","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-10-08","-1585","0","54","0","N/A","cotrimoxazole"
-"","4070500116","PHYLLIS"," MUTUNGE","MWELU","1962-06-13 00:00:00","53","Adult","","FEMALE","NO","68","0","0","","","","","M/VIT, P/CET,","","NO","NO","NO","2007-06-13","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-06-13","Stopped due to duplication","NO","","","","","","2007-06-13","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","68","0","N/A","cotrimoxazole"
-"","4070500119","MARTHA","MUTANU NDAVI","","1957-07-30 00:00:00","58","Adult","","FEMALE","NO","45","0","0","","","","","M/VITS","","YES","NO","NO","2007-07-30","TRANSFER IN","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-07-30","Stopped due to duplication","NO","","","","","","2007-07-30","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-10-08","-1585","0","45","0","N/A","cotrimoxazole"
-"","4070500120","MUOKA","MUEMA","","1960-04-07 00:00:00","56","Adult","","MALE","NO","52","0","0",""," 0713 985282","","","FLUCONAZOLE , M/VIT","","YES","NO","NO","2005-04-07","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2005-04-07","Stopped due to duplication","NO","","","","","","2005-04-07","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","52","0","N/A","cotrimoxazole"
-"","4070500122","MUNYAO","KANINI","","2000-08-01 00:00:00","15","Adult","","MALE","NO","20","0","0","","","","","M/VIT, SRP FLAGYL.","","YES","NO","NO","2007-08-01","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-08-01","Stopped due to duplication","NO","","","","","","2007-08-01","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","20","0","N/A","cotrimoxazole"
-"","4070500124","RONALD","KYALO","","1966-07-09 00:00:00","49","Adult","","MALE","NO","70","0","0","","","","","PIRITON, M/VIT","","YES","NO","NO","2007-07-09","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-07-09","Stopped due to duplication","NO","","","","","","2007-07-09","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-10-08","-1585","0","70","0","N/A","cotrimoxazole"
-"","4070500125","SUSAN","NGINA MWALUKO","","1973-08-07 00:00:00","42","Adult","","FEMALE","NO","48.3","0","0","","","","","PIRITON. M/VIT","","YES","NO","NO","2007-08-07","OUTPATIENT","GOK","ART","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2007-08-07","Stopped due to duplication","NO","","","","","","2007-08-07","NO","","AF3B(D4t 30mg + 3TC 150mg + EFV 600mg [< 60Kg])","2010-10-08","-1585","0","48.3","0","N/A","cotrimoxazole"
-"","4070500138","WANZA","MUTHIANI","","1983-07-17 00:00:00","32","Adult","","FEMALE","NO","48","0","0","","","","","M/VIT,","","NO","NO","NO","2007-07-17","TRANSFER IN","GOK","OI Only","OI ONLY","","Stopped due to duplication","NO","","","","","","2007-07-17","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-05-03","-1378","0","48","0","N/A","cotrimoxazole"
-"","4070500141","JENNIFER","WAYUA MARTIN","","1983-07-31 00:00:00","32","Adult","","FEMALE","NO","50","0","0","","","","","M/VIT","","NO","NO","NO","2007-07-31","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-31","Stopped due to duplication","NO","","","","","","2007-07-31","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","50","0","N/A","cotrimoxazole"
-"","4070500143","NICHOLAS","LAY MUNUVE","","1965-07-07 00:00:00","50","Adult","","MALE","NO","49","0","0","","","","","M/VIT","","YES","NO","NO","2007-07-07","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-07-07","Stopped due to duplication","NO","","","","","","2007-07-07","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","49","0","N/A","cotrimoxazole"
-"","4070500144","JOSEPH","KIOKO KITONGA","","1973-09-18 00:00:00","42","Adult","","MALE","NO","45","0","0","","","","","M/VIT , PIRITON","","NO","NO","NO","2007-09-18","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-09-18","Stopped due to duplication","NO","","","","","","2007-09-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","45","0","N/A","cotrimoxazole"
-"","4070500153","JANET","MBITHE","","1985-12-18 00:00:00","30","Adult","","FEMALE","NO","58","0","0","","","","","","","YES","NO","NO","2007-12-18","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-12-18","Stopped due to duplication","NO","","","","","","2007-12-18","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","58","0","N/A","cotrimoxazole"
-"","4070500157","WINFRED","MUKONYO KELI","","1980-12-10 00:00:00","35","Adult","","FEMALE","NO","46.5","0","0","","","","","AMOXYL, BRUFEN,PIRITON","","NO","NO","NO","2007-12-10","OUTPATIENT","GOK","OI Only","OI ONLY","","Stopped due to duplication","NO","","","","","","2007-12-10","NO","","OI ONLY","2010-10-08","-1585","0","46.5","0","N/A","cotrimoxazole"
-"","4070500160","ANGELINA","MUTINDA","","1953-10-19 00:00:00","62","Adult","","FEMALE","NO","38","0","0","","","","","FLAGYL, PIRITON","","YES","NO","NO","2007-10-19","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2007-10-19","Stopped due to duplication","NO","","","","","","2007-10-19","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","38","0","N/A","cotrimoxazole"
-"","4070500161","EUNICE","MWIKALI MUTUKU","","1973-02-25 00:00:00","43","Adult","","FEMALE","NO","63","0","0","","","","","M/VIT, PIRITON","","NO","NO","NO","2008-02-25","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-25","Stopped due to duplication","NO","","","","","","2008-02-25","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","63","0","N/A","cotrimoxazole"
-"","4070500163","ROSE","MUVIKU KATIKU","","1955-02-15 00:00:00","61","Adult","","FEMALE","NO","58","0","0","","","","","M/VITS , COARTERM, BRUFEN, PIRITON.","","NO","NO","NO","2008-02-15","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-15","Stopped due to duplication","NO","","","","","","2008-02-15","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-08","-1585","0","58","0","N/A","cotrimoxazole"
-"","4070500165","CHARLES","MUTISYA NGUI","","1964-02-05 00:00:00","52","Adult","","MALE","NO","49","0","0","","","","","BRUFEN, COARTERM","","YES","NO","NO","2008-02-05","OUTPATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2008-02-05","Stopped due to duplication","NO","","","","","","2008-02-05","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-10-13","-1580","0","49","0","N/A","cotrimoxazole"
-"","40705004888","elizabeth","mulekyo"," mbithi","1947-02-23 00:00:00","69","Adult","","FEMALE","NO","46","0","0","","","","","","","NO","NO","NO","2005-02-23","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2005-02-23","Active","NO","","","","","","2013-01-21","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-03-24","43","0","110","0","N/A","cotrimoxazole"
-"","40705005504","NDUNGE","MUENDO","","1978-10-03 00:00:00","37","Adult","","FEMALE","NO","54","0","0","","","","","","","NO","NO","NO","2009-10-03","TRANSFER IN","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2009-10-03","Stopped due to duplication","NO","","","","","","2009-10-03","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2010-11-26","-1536","0","54","0","N/A","cotrimoxazole"
-"","4071002814","rhoda","mbaika kimweli","","1946-04-04 00:00:00","70","Adult","","FEMALE","NO","42","0","0","","","","","","","NO","NO","NO","2012-04-04","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-04-04","Lost to follow-up","NO","","","","","","2012-10-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2012-07-03","-951","0","47","0","N/A","cotrimoxazole"
-"","408","muoki","eunice","","1938-07-09","78","Adult","","FEMALE","NO","45","146","0","","","","","","","NO","NO","NO","2013-02-07","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-02-07","PEP end","NO","","","","","","2013-03-09","NO","","TDF + 3TC (Adult PEP Option 5)","2013-08-01","-557","146","45","0","N/A","cotrimoxazole"
-"","41304600329","carolyne","mwende musyoka","","1982-06-29 00:00:00","33","Adult","","FEMALE","NO","28","0","0","","","","","","","NO","NO","NO","2010-06-29","IN PATIENT","GOK","ART","AF2A(TDF300MG+3TC150MG+NVP200MG)","2010-06-29","Lost to follow-up","NO","","","","","","2011-09-01","NO","","AF2A(TDF300MG+3TC150MG+NVP200MG)","2011-06-03","-1347","0","50","0","N/A","cotrimoxazole"
-"","456m","mbuvi","david","","1958-12-25","57","Adult","","MALE","NO","50","0","0","","","","","","","NO","NO","NO","2011-12-10","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2011-12-10","Lost to follow-up","NO","","","","","","2013-11-06","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-08-08","-550","0","50","0","N/A","cotrimoxazole"
-"","6417/12","mercy mutua","","","1990-07-02 00:00:00","25","Adult","","FEMALE","NO","40","0","0","","","","","","","NO","NO","NO","2012-07-02","CASUALTY","GOK","PEP","PA1A(AZT 300mg + 3TC 150mg)","2012-07-02","PEP end","NO","","","","","","2012-08-01","NO","","PA1A(AZT 300mg + 3TC 150mg)","2012-07-30","-924","0","40","0","N/A","cotrimoxazole"
-"","7/7/2013","mutua","michael","","1976-02-05","40","Adult","426","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2013-07-07","OUTPATIENT","GOK","PEP","TDF + 3TC (Adult PEP Option 5)","2013-07-07","PEP end","NO","","","","","","2013-08-06","NO","","TDF + 3TC (Adult PEP Option 5)","2013-08-04","-554","0","56","0","N/A","cotrimoxazole"
-"","7860","kyalo","ndanu","","2010-08-05","5","Paediatric","426","FEMALE","NO","20","0","0","","","","","","","NO","NO","NO","2014-09-08","OUTPATIENT","GOK","PEP","AZT + 3TC + LPV/r (Paed PEP Option 1)","2014-09-08","PEP end","NO","","","","","","2014-10-08","NO","","AZT + 3TC + LPV/r (Paed PEP Option 1)","2014-10-06","-126","0","18","0","N/A","cotrimoxazole"
-"","8010010101319","DOMINIC MUTUKU","","","1960-03-25 00:00:00","56","Adult","","MALE","NO","36","0","0","","725990133","","","","","NO","NO","NO","2011-03-25","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-03-25","Deceased","NO","","","","","","2011-03-25","NO","","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2011-04-22","-1389","0","55","0","N/A","cotrimoxazole"
-"","80100300403","rosemary","mwongeli","","1978-05-15","37","Adult","","FEMALE","NO","32","0","0","","","","","","","NO","NO","NO","2009-01-30","TRANSFER IN","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2009-01-30","Lost to follow-up","NO","","","","","","2014-02-25","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2013-11-27","-439","0","50","0","N/A","cotrimoxazole"
-"","9610/11","david","muoka","mbuvi","1954-06-09","62","Adult","301","MALE","NO","49","0","0","713929452","mavindu","","","","","YES","NO","NO","2008-05-09","TRANSIT","GOK","ART","TDF + 3TC + EFV (>15YRS ADULT)","2009-06-05","Lost to follow-up","NO","","","","","","2014-07-07","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2014-04-08","-307","0","51","0","N/A","cotrimoxazole"
-"","k1256","muia","mwongeli","","2000-12-12","14","Paediatric","421","FEMALE","NO","36","0","0","","","","","","","NO","NO","NO","2013-02-15","OUTPATIENT","GOK","PEP","AZT + 3TC (Adult PEP Option 1)","2013-02-15","PEP end","NO","","","","","","2013-03-17","NO","","","2014-01-04","-401","0","36","0","N/A","cotrimoxazole"
-"","kdod845","dorcas","mbithe","","1958-02-06 00:00:00","58","Adult","","FEMALE","NO","57.6","0","0","","","","","","","NO","NO","NO","2012-02-06","IN PATIENT","GOK","ART","AF3A (D4t 30mg + 3TC 150mg + NVP 200mg [< 60Kg])","2012-02-06","Active","NO","","","","","","2014-01-28","NO","","AZT+3TC+NVP (>15YRS ADULT)","2014-11-12","-89","0","63","0","N/A","cotrimoxazole"
-"","KDRD845","MBITHE","DORCAS","wambua","1957-04-05","59","Adult","426","FEMALE","NO","59","0","0","720705843","kali","","","","","NO","NO","NO","2005-04-28","OUTPATIENT","GOK","ART","AZT+3TC+NVP (>15YRS ADULT)","2013-11-04","Active","NO","","","","","","2013-12-24","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-05","-4","0","59","0","N/A","cotrimoxazole"
-"","PEP","","HELLEN","MUTHEU","1963-02-02","53","Adult","426","FEMALE","NO","60","0","0","","","","","","","NO","NO","NO","2014-05-14","OUTPATIENT","GOK","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2014-05-14","PEP end","NO","","","","","","2014-06-13","NO","","","2014-06-13","-241","0","60","0","N/A","cotrimoxazole"
-"","pep1","christine","kumanda","nduku","1961-06-01","54","Adult","417","FEMALE","NO","60","0","0","","","","","","","NO","NO","YES","2012-07-30","CASUALTY","GOK","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2012-07-30","PEP end","NO","","","","","","2012-08-29","NO","","TDF + ABC + LPV/r (>15YRS ADULT)","2012-10-22","-840","0","60","0","N/A","cotrimoxazole"
-"","12508001159","kioko","kyalo","","5","","Paediatric","43","MALE","NO","42","0.0147","0","711827091","mbanya","","","","","NO","NO","NO","2014-11-20","OUTPATIENT","","ART","OI Medicines","","Active","NO","","0","","","","","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-22","-18","0.0147","42","0","N/A","cotrimoxazole"
-"","12508001160","muthina","ruth","muindi","1975","","Paediatric"," ","FEMALE","NO","45","2","0.15811388300842","","kyuu","","","","","NO","NO","NO","2014-11-20","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-08","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-20","-20","2","45","0.15811388300842","N/A",""
-"","12508001161","mwangangi","daniel","munyao","1953-11-21","62","Adult"," ","FEMALE","NO","56","54","0.91651513899117","","mbanya","","","","","NO","NO","NO","2014-11-21","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-19","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-28","-12","54","56","0.91651513899117","N/A",""
-"","12508001147","joseph","muya","kyama","1955-11-30","60","Adult","43","MALE","NO","51","0","0","","mbanya","","","","","NO","NO","NO","2014-11-22","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-23","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-06","-3","0","51","0","N/A",""
-"","12508001156","fransiscah","ngumbi","wanjiru","1967-11-30","48","Adult"," ","FEMALE","NO","45","0","0","","","","","","","NO","NO","NO","2014-11-22","OUTPATIENT","","ART","OI Medicines","","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-16","-24","0","45","0","N/A",""
-"","12508001150","JANE","MUENI","MUTISO","1986-10-12","29","Adult","268","FEMALE","NO","50","161","1.4953632037439","704467731","KIAMBWA PRIMARY SCHOOL","","","","","NO","NO","NO","2014-10-23","OUTPATIENT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-11-10","Active","NO","","0","","","Concordant","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-08","-32","161","50","1.4953632037439","N/A","Dapsone"
-"","12508001151","MUENI","MBITHE","MUTISO","2011-02-03","4","Paediatric","268","FEMALE","NO","14.5","96","0.61101009266078","704467731","KIAMBWA PRIMARY SCHOOL","","","","","NO","NO","NO","2014-11-10","OUTPATIENT","","ART","ABC + 3TC + NVP (< 15YRS PAED)","2014-11-10","Active","NO","","0","","","","","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-08","-32","96","14.5","0.61101009266078","N/A","cotrimoxazole"
-"","125080001036","ELIZABETH","MUNYAO","NGINA","1980-06-15","35","Adult","268","FEMALE","NO","47","156","1.4271183085738","","KIKIMA PRIMARY (DEB)","","","","","NO","NO","NO","2014-09-02","OUTPATIENT","","ART","TDF + 3TC + NVP (>15YRS ADULT)","2014-11-30","Active","NO","","0","","","","","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-02-06","-3","156","47","1.4271183085738","N/A","cotrimoxazole"
-"","12508001163","ESTHER","KYENZE","MBITHI","1971-06-15","44","Adult","268","FEMALE","NO","57.7","158","1.5816657885491","718657072","KYANGOMA PRIMARY SCHOOL","","","","","NO","NO","NO","2014-12-01","OUTPATIENT","","","OI Medicines","","Active","NO","","0","","","","","NO","","OI ONLY","2015-02-11","2","158","57.7","1.5816657885491","N/A","cotrimoxazole"
-"","10303010653","simon","mutie","thitu","1961-03-31","55","Adult","43","MALE","NO","56","0","0","","","","","","","NO","NO","NO","2014-12-02","TRANSFER IN","","ART","AZT+3TC+NVP (>15YRS ADULT)","2014-12-03","Active","NO","","0","","","","","NO","","AZT+3TC+NVP (>15YRS ADULT)","2015-02-24","15","0","56","0","Benane Health Centre",""
-"","12508001164","beatrice","makau","mbithe","1958-03-31","58","Adult","43","FEMALE","NO","48","0","0","","yatwa","","","","","NO","NO","NO","2014-12-03","OUTPATIENT","","ART","OI Medicines","","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-02-11","2","0","48","0","N/A",""
-"","12508001165","monicah","muema","mwende","2001-02-28","14","Paediatric","43","FEMALE","NO","35","0","0","","","","","","","NO","NO","NO","2014-12-04","OUTPATIENT","","OI Only","OI Medicines","","Active","NO","","0","","","","","NO","","OI Medicines","2015-03-13","32","0","35","0","N/A",""
-"","12508001166","alex","mutiso","ndolo","1979-02-28","36","Adult","43","MALE","NO","49","0","0","","","","","","","NO","NO","NO","2014-12-05","OUTPATIENT","","OI Only","OI Medicines","","Active","NO","","0","","","","","NO","","OI Medicines","2014-12-19","-52","0","49","0","N/A",""
-"","12508001070","mwangi","stephen","kanini","2012-10-31","2","Paediatric","43","MALE","NO","10.4","4","0.10540925533895","","","","","","","NO","NO","NO","2014-12-17","pmtct","","ART","ABC + 3TC + NVP (< 15YRS PAED)","2014-12-17","Active","NO","","0","","","","","NO","","ABC + 3TC + NVP (< 15YRS PAED)","2015-01-14","-26","4","10.4","0.10540925533895","N/A",""
-"","AY3954","WINFRED","MUMBI","","1985-06-15","30","Adult"," ","FEMALE","NO","54","168","1.5874507866388","","","","","","","NO","NO","NO","2014-12-23","OUTPATIENT","","ART","TDF + 3TC + LPV/r (>15YRS ADULT)","2014-12-23","Transit","NO","","0","","","","","NO","","TDF + 3TC + LPV/r (>15YRS ADULT)","2015-01-06","-34","168","54","1.5874507866388","N/A","cotrimoxazole"
-"","1","NDINDA","MUTUNGI","","1958-07-15","57","Adult"," ","FEMALE","NO","48","162","1.4696938456699","726638820","","","","","","NO","NO","NO","2014-12-30","OUTPATIENT","","PEP","TDF + 3TC + LPV/r (Adult PEP Option 6)","2014-12-31","PEP end","NO","","0","","","","","NO","","TDF + 3TC + LPV/r (Adult PEP Option 6)","2015-01-27","-13","162","48","1.4696938456699","N/A",""
-"","12508001169","WAENI","AGNETTA","MAINGA","1988-06-15","27","Adult","43","FEMALE","NO","62","159","1.6547910240672","723624199","","712782059","","",",","NO","NO","NO","2014-12-30","OUTPATIENT","","OI Only","OI Medicines","","Active","NO","","0","","","","","NO","","OI Medicines","2015-01-14","-26","159","62","1.6547910240672","N/A","cotrimoxazole"
-"","12508001170","JOHN","MUNUVE","MBUNZI","1969-06-15","46","Adult"," ","MALE","NO","55","169","1.6068430055374","702179400","","","","","","NO","NO","NO","2014-12-30","OUTPATIENT","","OI Only","OI Medicines","","Active","NO","","0","","","","","NO","","OI Medicines","2015-01-14","-26","169","55","1.6068430055374","N/A","cotrimoxazole"
-"","80100700104","DAVID","MUNYAO","","1967-07-15","48","Adult","268","MALE","NO","64.3","168","1.7281975195754","","","","","","","NO","NO","NO","2014-09-25","TRANSIT","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-12-31","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","2015-01-28","-12","168","64.3","1.7281975195754","N/A","cotrimoxazole"
-"","12787000795","JUSTUS","MULE","MUEMA","1978-06-15","37","Adult","268","MALE","NO","43.4","174","1.4416425816871","","","","","","","NO","NO","NO","2014-05-30","TRANSFER IN","","ART","TDF + 3TC + EFV (>15YRS ADULT)","2014-08-01","Active","NO","","0","","","","","NO","","TDF + 3TC + EFV (>15YRS ADULT)","","","174","43.4","1.4416425816871","Tawa Sub-Distrct Hospial","cotrimoxazole"
-"","12508001168","winifred","kamene","","1988-04-30","27","Adult","43","FEMALE","NO","49","156","1.4571661996263","","","","","","","NO","NO","NO","2015-01-14","OUTPATIENT","","ART","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-15","Active","NO","","0","","","","","NO","","TDF + 3TC + NVP (>15YRS ADULT)","2015-01-28","-12","156","49","1.4571661996263","N/A",""
-"DEMO","DEMO1","DEMO","DEMO","DEMO","1991-02-06","24","Adult","149","MALE","NO","54","183","1.6568041525781","","HERE WE ARE","","","","","NO","NO","NO","2015-02-09","IN PATIENT","","ART","AZT + 3TC + LPV/r (>15YRS ADULT)","2015-02-09","Active","NO","-1-","0","","","","","NO","","AZT + 3TC + LPV/r (>15YRS ADULT)","2015-02-24","15","183","54","1.6568041525781","N/A","Isoniazid"
diff --git a/Export/florence mbula ndunda (Labels).pdf b/Export/florence mbula ndunda (Labels).pdf
deleted file mode 100644
index f7522e1..0000000
Binary files a/Export/florence mbula ndunda (Labels).pdf and /dev/null differ
diff --git a/application/config/database.php b/application/config/database.php
index 009c1b5..7288d06 100644
--- a/application/config/database.php
+++ b/application/config/database.php
@@ -44,13 +44,11 @@
$active_record = TRUE;
$db['default']['hostname'] = 'localhost';
$db['default']['username'] = 'root';
-$db['default']['password'] = '';
-//$db['default']['database'] = 'testadt';
-$db['default']['database'] = 'casino_database';
-//$db['default']['database'] = 'karen_database';
+$db['default']['password'] = 'root';
+$db['default']['database'] = 'lvct';
$db['default']['dbdriver'] = 'mysql';
$db['default']['dbprefix'] = '';
-$db['default']['pconnect'] = TRUE;
+$db['default']['pconnect'] = FALSE;
$db['default']['db_debug'] = FALSE;
$db['default']['cache_on'] = FALSE;
$db['default']['cachedir'] = '';
@@ -60,6 +58,22 @@
$db['default']['autoinit'] = TRUE;
$db['default']['stricton'] = FALSE;
+$db['mirth_db']['hostname'] = 'localhost';
+$db['mirth_db']['username'] = 'root';
+$db['mirth_db']['password'] = 'root';
+$db['mirth_db']['database'] = 'mirth_adt_db';
+$db['mirth_db']['dbdriver'] = 'mysql';
+$db['mirth_db']['dbprefix'] = '';
+$db['mirth_db']['pconnect'] = FALSE;
+$db['mirth_db']['db_debug'] = FALSE;
+$db['mirth_db']['cache_on'] = FALSE;
+$db['mirth_db']['cachedir'] = '';
+$db['mirth_db']['char_set'] = 'utf8';
+$db['mirth_db']['dbcollat'] = 'utf8_general_ci';
+$db['mirth_db']['swap_pre'] = '';
+$db['mirth_db']['autoinit'] = TRUE;
+$db['mirth_db']['stricton'] = FALSE;
+
/* End of file database.php */
/**
diff --git a/application/config/github_updater.php b/application/config/github_updater.php
index 5acd19f..8ad5cd6 100644
--- a/application/config/github_updater.php
+++ b/application/config/github_updater.php
@@ -3,7 +3,7 @@
/**
* The user name of the git hub user who owns the repo
*/
-$config['github_user'] = 'KevinMarete';
+$config['github_user'] = 'OmondiKevin';
/**
* The repo on GitHub we will be updating from
@@ -21,7 +21,7 @@
* NOTE: You should only need to set this initially it will be
* automatically set by the library after subsequent updates.
*/
-$config['current_commit'] = '3f07f4ec1715e31aea69d3341283f7c5897dac17';
+$config['current_commit'] = '5cb03029fbab3d77ca1f881512cbc0b2279266a7';
/**
* A list of files or folders to never perform an update on.
diff --git a/application/controllers/auto_management.php b/application/controllers/auto_management.php
index 8d324d2..831169b 100644
--- a/application/controllers/auto_management.php
+++ b/application/controllers/auto_management.php
@@ -1,31 +1,42 @@
nascop_url = trim(file_get_contents($link));
- $this -> eid_url="http://nascop.org/eid/";
- $this->ftp_url='41.89.6.210';
- //$this->ftp_url='192.168.133.56';
+ $this -> eid_url = "http://viralload.nascop.org/";
+ $this -> ftp_url = "192.168.133.10";
+ // off Campus access {should be active at facility level}
+ // $this->ftp_url='41.89.6.210';
}
+// To clean the sync_regimen_category table incase of the duplicates
+ // public function delete_dulicates(){
+ // $sql = "SELECT count(id) as counts, id, new_id,Name from sync_regimen_category group by id,Name having counts>1";
+ // $result_raw = $this->db->query($sql)->result_array();
+ // foreach ($result_raw as $key => $value) {
+ // $new_id = $value['new_id'];
+ // $id = $value['id'];
+ // $name = $value['Name'];
+ // $sql_inner = "delete from sync_regimen_category where id='$id' and Name = '$name' and new_id !='$new_id'";
+ // $this->db->query($sql_inner);
+
+ // }
+
public function index($manual=FALSE){
$message ="";
$today = (int)date('Ymd');
-
//get last update time of log file for auto_update
$log=Migration_Log::getLog('auto_update');
$last_update = (int)$log['last_index'];
-
//if not updated today
if ($today != $last_update || $manual==TRUE) {
//Function to create stored procedures
@@ -41,42 +52,102 @@ public function index($manual=FALSE){
//function to update patients without current_regimen with last regimen dispensed
$message .= $this->update_current_regimen();
//function to send eid statistics to nascop dashboard
- $message .= $this->updateEid();
+ //$message .= $this->updateEid();
//function to update patient data such as active to lost_to_follow_up
$message .= $this->updatePatientData();
//function to update data bugs by applying query fixes
$message .= $this->updateFixes();
- //function to get viral load data
- $message .= $this->updateViralLoad();
//function to add new facilities list
$message .= $this->updateFacilties();
//function to create new tables into adt
$message .= $this->update_database_tables();
//function to create new columns into table
$message .= $this->update_database_columns();
+ //function to get viral load data
+ $message .= $this->updateViralLoad();
//function to set negative batches to zero
$message .= $this->setBatchBalance();
+ //function to create mirth_sync_db
+ $message .= $this->mirth_adt_db();
+ //fucntion to update patient visit dose from id to name
+ $message .= $this->update_dose_name();
+ // To clean the sync_regimen_category table incase of the duplicates
+ // $message .= $this->delete_dulicates();
//function to update hash value of system to nascop
- $message .= $this->update_system_version();
+ //$message .= $this->update_system_version();
//function to download guidelines from nascop
- $message .= $this->get_guidelines();
+ //$message .= $this->get_guidelines();
//function to update facility admin that reporting deadline is close
- $message .= $this->update_reporting();
-
+ //$message .= $this->update_reporting();
//finally update the log file for auto_update
- if ($this -> session -> userdata("curl_error") != 1) {
+ if ($this -> session -> userdata("curl_error") == '') {
$sql="UPDATE migration_log SET last_index='$today' WHERE source='auto_update'";
$this -> db -> query($sql);
$this -> session -> set_userdata("curl_error", "");
}
}
-
if($manual==TRUE){
$message="
× ".$message."
";
}
echo $message;
}
+ public function mirth_adt_db(){
+ /*$message="";
+ $this->load->dbforge();
+ if ($this->dbforge->create_database('mirth_adt_db'))
+ {
+ $query_stmt = file_get_contents('assets/adt_iqcare/');
+ print_r($query_stmt);
+ die();
+ //Execute query statements
+ $statements = explode("//", $query_stmt);
+ foreach($statements as $statement){
+ $statement = trim($statement);
+ if ($statement){
+ $mirth_db=$this->load->database('mirth_db',TRUE);
+ $mirth_db->query($statement);
+ $message="ADT IQCARE sncy database created successfully";
+ }
+ }
+
+ }
+ return $message;*/
+ $this->load->dbforge();
+ if ($this->dbforge->create_database('mirth_adt_db'))
+ {
+ $count = 0;
+ $delimeter = "//";
+ $queries_dir = 'assets/adt_iqcare/';
+ $accepted_files = array('sql');
+ if (is_dir($queries_dir)) {
+ $files = scandir($queries_dir);
+ foreach ($files as $file_name) {
+ $ext = pathinfo($file_name, PATHINFO_EXTENSION);
+ if ($file_name != '.' && $file_name != '..' && in_array($ext, $accepted_files)) {
+ //Get query statements
+ $query_file = $queries_dir . '/' . $file_name;
+ $query_stmt = file_get_contents($query_file);
+ //Execute query statements
+ $statements = explode($delimeter, $query_stmt);
+ foreach($statements as $statement){
+ $statement = trim($statement);
+ if ($statement){
+ $mirth_db=$this->load->database('mirth_db',TRUE);
+ if (!$mirth_db->simple_query($statement))
+ {
+ $error = $file_name.'==>'.$mirth_db->_error_message().' ';
+ }
+ }
+ }
+ $count++;
+ }
+ }
+
+ }
+
+ }
+}
public function updateDrugId() {
//function to update drug_id column in drug_stock_movement table where drug_id column is zero
//Get batches for drugs which are associateed with those drugs
@@ -84,7 +155,6 @@ public function updateDrugId() {
FROM `drug_stock_movement`
WHERE drug =0 AND batch_number!=''
ORDER BY `drug_stock_movement`.`drug` ";
-
$query = $this -> db -> query($sql);
$res = $query -> result_array();
$counter = 0;
@@ -118,7 +188,6 @@ public function updateDrugPatientVisit() {
FROM `patient_visit`
WHERE drug_id =0 AND batch_number!=''
ORDER BY `patient_visit`.`drug_id` ";
-
$query = $this -> db -> query($sql);
$res = $query -> result_array();
$counter = 0;
@@ -194,14 +263,13 @@ public function updateCCC_Store(){
$this->db->query($sql);
$count=$this->db->affected_rows();
$message="(".$count.") transactions changed from main pharmacy to main store! ";
-
if($count<=0){
$message="";
}
return $message;
}
- public function setBatchBalance(){//Set batch balance to zero where balance is negative
+ public function setBatchBalance(){
$facility_code=$this->session->userdata("facility");
$sql="UPDATE drug_stock_balance dsb
SET dsb.balance=0
@@ -210,7 +278,6 @@ public function setBatchBalance(){//Set batch balance to zero where balance is n
$this->db->query($sql);
$count=$this->db->affected_rows();
$message="(".$count.") batches with negative balance have been updated! ";
-
if($count<=0){
$message="";
}
@@ -276,7 +343,6 @@ public function updateEid() {
$results = $query -> result_array();
if($results){
$json_data = json_encode($results, JSON_PRETTY_PRINT);
-
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -300,7 +366,6 @@ public function updateSms() {
$facility_name=$this -> session -> userdata('facility_name');
$facility_phone=$this->session->userdata("facility_phone");
$facility_sms_consent=$this->session->userdata("facility_sms_consent");
-
if($facility_sms_consent==TRUE){
/* Find out if today is on a weekend */
$weekDay = date('w');
@@ -309,9 +374,7 @@ public function updateSms() {
} else {
$tommorrow = date('Y-m-d', strtotime('+1 day'));
}
-
$nextweek=date('Y-m-d', strtotime('+1 week'));
-
$phone_minlength = '8';
$phone = "";
$phone_list = "";
@@ -319,7 +382,6 @@ public function updateSms() {
$first_part = "";
$kenyacode = "254";
$arrDelimiters = array("/", ",", "+");
-
/*Get All Patient Who Consented Yes That have an appointment Tommorow */
$sql = "SELECT p.phone,p.patient_number_ccc,p.nextappointment,temp.patient,temp.appointment,temp.machine_code as status,temp.id
FROM patient p
@@ -333,11 +395,9 @@ public function updateSms() {
AND char_length(p.phone)>$phone_minlength
AND temp.machine_code !='s'
GROUP BY p.patient_number_ccc";
-
$query = $this -> db -> query($sql);
$results = $query -> result_array();
$phone_data=array();
-
if ($results) {
foreach ($results as $result) {
$phone = $result['phone'];
@@ -345,7 +405,6 @@ public function updateSms() {
$newphone = substr($phone, -$phone_minlength);
$first_part = str_replace($newphone, "", $phone);
$message = "You have an Appointment on " . date('l dS-M-Y', strtotime($appointment)) . " at $facility_name Contact Phone: $facility_phone";
-
if (strlen($first_part) < 7) {
if ($first_part === '07') {
$phone = "+" . $kenyacode . substr($phone, 1);
@@ -361,12 +420,10 @@ public function updateSms() {
$phone_list .= $phone;
$messages_list .= "+" .$message;
}
-
} else {
/*If Phone Does not meet requirements*/
$phone = str_replace($arrDelimiters, "-|-", $phone);
$phones = explode("-|-", $phone);
-
foreach ($phones as $phone) {
$newphone = substr($phone, -$phone_minlength);
$first_part = str_replace($newphone, "", $phone);
@@ -396,13 +453,12 @@ public function updateSms() {
}
$phone_list = substr($phone_list, 1);
$messages_list = substr($messages_list, 1);
-
$phone_list = explode("+", $phone_list);
$messages_list = explode("+", $messages_list);
foreach ($phone_list as $counter=>$contact) {
$message = urlencode($messages_list[$counter]);
- file("http://41.57.109.242:13000/cgi-bin/sendsms?username=clinton&password=ch41sms&to=$contact&text=$message");
+ //file("http://41.57.109.242:13000/cgi-bin/sendsms?username=clinton&password=ch41sms&to=$contact&text=$message");
}
$alert = "Patients notified (" . sizeof($phone_list) . " )";
}
@@ -411,7 +467,7 @@ public function updateSms() {
}
public function updatePatientData() {
- $days_to_lost_followup = 90;
+ $days_to_lost_followup=$this -> session -> userdata('lost_to_follow_up');//Default lost to follow up
$days_to_pep_end = 30;
$days_in_year = date("z", mktime(0, 0, 0, 12, 31, date('Y'))) + 1;
$adult_age = 12;
@@ -423,7 +479,6 @@ public function updatePatientData() {
$adult_days = $days_in_year * $adult_age;
$message = "";
$state = array();
-
//Get Patient Status id's
$status_array = array($active, $lost, $pep, $pmtct);
foreach ($status_array as $status) {
@@ -432,11 +487,10 @@ public function updatePatientData() {
$rs = $q -> result_array();
if($rs){
$state[$status] = $rs[0]['id'];
- } else {
- $state[$status]='NAN'; //If non existant
- }
+ } else{
+ $state[$status]='NAN'; //If non existant
+ }
}
-
if(!empty($state)){
/*Change Last Appointment to Next Appointment*/
$sql['Change Last Appointment to Next Appointment'] = "(SELECT patient_number_ccc,nextappointment,temp.appointment,temp.patient
@@ -449,15 +503,15 @@ public function updatePatientData() {
AND DATEDIFF(temp.appointment,p.nextappointment)>0
GROUP BY p.patient_number_ccc) as p1
SET p.nextappointment=p1.appointment";
-
/*Change Active to Lost_to_follow_up*/
if(isset($state[$lost])){
$sql['Change Active to Lost_to_follow_up'] = "(SELECT patient_number_ccc,nextappointment,DATEDIFF(CURDATE(),nextappointment) as days
FROM patient p
LEFT JOIN patient_status ps ON ps.id=p.current_status
WHERE ps.Name LIKE '%$active%'
- AND (DATEDIFF(CURDATE(),nextappointment )) >=$days_to_lost_followup) as p1
- SET p.current_status = '$state[$lost]'";
+ AND (DATEDIFF(CURDATE(),nextappointment )) >=$days_to_lost_followup
+ AND p.status_change_date != CURDATE()) as p1
+ SET p.current_status = '$state[$lost]', p.status_change_date = CURDATE()";
}
/*Change Lost_to_follow_up to Active */
@@ -467,10 +521,9 @@ public function updatePatientData() {
LEFT JOIN patient_status ps ON ps.id=p.current_status
WHERE ps.Name LIKE '%$lost%'
AND (DATEDIFF(CURDATE(),nextappointment )) <$days_to_lost_followup) as p1
- SET p.current_status = '$state[$active]' ";
+ SET p.current_status = '$state[$active]', p.status_change_date = CURDATE()";
}
-
/*Change Active to PEP End*/
if(isset($state[$pep])){
$sql['Change Active to PEP End'] = "(SELECT patient_number_ccc,rst.name as Service,ps.Name as Status,DATEDIFF(CURDATE(),date_enrolled) as days_enrolled
@@ -480,10 +533,9 @@ public function updatePatientData() {
WHERE (DATEDIFF(CURDATE(),date_enrolled))>=$days_to_pep_end
AND rst.name LIKE '%$pep%'
AND ps.Name NOT LIKE '%$pep%') as p1
- SET p.current_status = '$state[$pep]' ";
+ SET p.current_status = '$state[$pep]', p.status_change_date = CURDATE()";
}
-
/*Change PEP End to Active*/
if(isset($state[$active])){
$sql['Change PEP End to Active'] = "(SELECT patient_number_ccc,rst.name as Service,ps.Name as Status,DATEDIFF(CURDATE(),date_enrolled) as days_enrolled
@@ -493,10 +545,9 @@ public function updatePatientData() {
WHERE (DATEDIFF(CURDATE(),date_enrolled))<$days_to_pep_end
AND rst.name LIKE '%$pep%'
AND ps.Name NOT LIKE '%$active%') as p1
- SET p.current_status = '$state[$active]' ";
+ SET p.current_status = '$state[$active]', p.status_change_date = CURDATE()";
}
-
/*Change Active to PMTCT End(children)*/
if(isset($state[$pmtct])){
$sql['Change Active to PMTCT End(children)'] = "(SELECT patient_number_ccc,rst.name AS Service,ps.Name AS Status,DATEDIFF(CURDATE(),dob) AS days
@@ -507,10 +558,9 @@ public function updatePatientData() {
AND (DATEDIFF(CURDATE(),dob)) <$adult_days
AND rst.name LIKE '%$pmtct%'
AND ps.Name NOT LIKE '%$pmtct%') as p1
- SET p.current_status = '$state[$pmtct]'";
+ SET p.current_status = '$state[$pmtct]', p.status_change_date = CURDATE()";
}
-
/*Change PMTCT End to Active(Adults)*/
if(isset($state[$active])){
$sql['Change PMTCT End to Active(Adults)'] = "(SELECT patient_number_ccc,rst.name AS Service,ps.Name AS Status,DATEDIFF(CURDATE(),dob) AS days
@@ -521,7 +571,7 @@ public function updatePatientData() {
AND (DATEDIFF(CURDATE(),dob)) >=$adult_days
AND rst.name LIKE '%$pmtct%'
AND ps.Name LIKE '%$pmtct%') as p1
- SET p.current_status = '$state[$active]'";
+ SET p.current_status = '$state[$active]', p.status_change_date = CURDATE()";
}
foreach ($sql as $i => $q) {
@@ -539,6 +589,7 @@ public function updatePatientData() {
}
public function updateFixes(){
+ $days_to_lost_followup = $this -> session -> userdata('lost_to_follow_up');//Default lost to follow up
//Rename the prophylaxis cotrimoxazole
$fixes[]="UPDATE drug_prophylaxis
SET name='cotrimoxazole'
@@ -549,14 +600,8 @@ public function updateFixes(){
SET p.start_regimen_date=''
WHERE rst.name LIKE '%oi%'
AND p.start_regimen_date IS NOT NULL";
- //Update status_change_date for lost_to_follow_up patients
- $fixes[]="UPDATE patient p,
- (SELECT p.id, INTERVAL 90 DAY + p.nextappointment AS choosen_date
- FROM patient p
- LEFT JOIN patient_status ps ON ps.id = p.current_status
- WHERE ps.Name LIKE '%lost%') as test
- SET p.status_change_date=test.choosen_date
- WHERE p.id=test.id";
+ //Update status_change_date for lost_to_follow_up patients @180
+ $fixes[]="UPDATE patient p,(SELECT p.id,CASE WHEN p.nextappointment != '' THEN INTERVAL $days_to_lost_followup DAY + p.nextappointment ELSE CASE WHEN p.start_regimen_date != '' THEN INTERVAL $days_to_lost_followup DAY + p.start_regimen_date ELSE INTERVAL $days_to_lost_followup DAY + p.date_enrolled END END AS choosen_date FROM patient p LEFT JOIN patient_status ps ON ps.id = p.current_status WHERE ps.Name LIKE '%lost%' AND p.status_change_date = '') as test SET p.status_change_date=test.choosen_date WHERE p.id=test.id";
//Update patients without service lines ie Pep end status should have pep as a service line
$fixes[]="UPDATE patient p
LEFT JOIN patient_status ps ON ps.id=p.current_status,
@@ -579,7 +624,6 @@ public function updateFixes(){
$fixes[]="UPDATE drug_instructions
SET name=REPLACE(name, '?', '.')
WHERE name LIKE '%?%'";
-
$facility_code=$this->session->userdata("facility");
//Auto Update Supported and supplied columns for satellite facilities
$fixes[] = "UPDATE facilities f,
@@ -595,7 +639,6 @@ public function updateFixes(){
SET p.other_drugs = TRIM(Replace(Replace(Replace(p.other_drugs,'\t',''),'\n',''),'\r','')),
p.other_illnesses = TRIM(Replace(Replace(Replace(p.other_illnesses,'\t',''),'\n',''),'\r','')),
p.adr = TRIM(Replace(Replace(Replace(p.adr,'\t',''),'\n',''),'\r',''))";
-
//Execute fixes
$total=0;
foreach ($fixes as $fix) {
@@ -621,36 +664,47 @@ public function updateViralLoad(){
$facility_code = $this -> session -> userdata("facility");
$url = $this -> eid_url . "vlapi.php?mfl=" . $facility_code;
$patient_tests=array();
-
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
-
- $json_data = curl_exec($ch);
+ $json_data = curl_exec($ch);
if (empty($json_data)) {
$message = "cURL Error: " . curl_error($ch)." ";
- $this -> session -> set_userdata("curl_error", 1);
+ //$this -> session -> set_userdata("curl_error", 1);
} else {
- $data = json_decode($json_data, TRUE);
+ $data = json_decode($json_data, TRUE);
$lab_data=$data['posts'];
- foreach($lab_data as $lab){
- foreach($lab as $tests){
- $ccc_no=trim($tests['Patient']);
- $result=$tests['Result'];
- $date_tested=$tests['DateTested'];
- $patient_tests[$ccc_no][]=array('date_tested'=>$date_tested,'result'=>$result);
- }
+ $message="Viral Load Download Failed! ";
+ if(!empty($lab_data)){
+ foreach($lab_data as $lab){
+ foreach($lab as $tests){
+ $ccc_no = trim($tests['Patient']);
+ $result = $tests['Result'];
+ $date_tested = $tests['DateTested'];
+ $justification = $tests['Justification'];
+ //An array to store patient viral Load data
+ $sql = "CALL proc_check_viralload(?, ?, ?, ?)";
+ $parameters = array($ccc_no, $date_tested, $result, $justification);
+ $this->db->query($sql, $parameters);
+ }
+ }
+ $message="Viral Load Download Success! ";
}
- $message="Viral Load Download Success! ";
}
- curl_close($ch);
- //write to file
- $fp = fopen('assets/viral_load.json', 'w');
- fwrite($fp, json_encode($patient_tests,JSON_PRETTY_PRINT));
- fclose($fp);
+
return $message;
}
+ public function get_viral_load($patient_no){
+ $this->db->select('*');
+ $this->db->where('patient_ccc_number', $patient_no);
+ $this->db->from('patient_viral_load');
+ $this->db->order_by('test_date','desc');
+ $query = $this->db->get();
+ $result = $query->result_array();
+ echo json_encode($result);
+ }
+
public function updateFacilties(){
$total=Facilities::getTotalNumber();
$message="";
@@ -666,7 +720,6 @@ public function updateFacilties(){
$facilities=array();
$facility_code=$this->session->userdata("facility");
$lists=Facilities::getParentandSatellites($facility_code);
-
for ($row = 2; $row < $highestRow; $row++) {
$facility_id=$arr[$row]['A'];
$facility_name=$arr[$row]['B'];
@@ -735,103 +788,36 @@ public function updateFacilties(){
}
return $message;
}
+
public function update_database_tables(){
- $count=0;
- $message="";
- $tables['dependants'] = "CREATE TABLE dependants(
- id int(11),
- parent varchar(30),
- child varchar(30),
- PRIMARY KEY (id)
- );";
- $tables['spouses']= "CREATE TABLE spouses(
- id int(11),
- primary_spouse varchar(30),
- secondary_spouse varchar(30),
- PRIMARY KEY (id)
- );";
- $tables['drug_instructions']="CREATE TABLE IF NOT EXISTS `drug_instructions` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `name` varchar(255) NOT NULL,
- `active` int(11) NOT NULL,
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=35;
- INSERT INTO `drug_instructions` (`id`, `name`, `active`) VALUES
- (1, 'Warning. May cause drowsiness', 1),
- (2, 'Warning. May cause drowsiness. If affected to do not drive or operate machinery.Avoid alcoholic drink', 1),
- (3, 'Warning. May cause drowsiness. If affected to do not drive or operate machinery.', 1),
- (4, 'Warning. Avoid alcoholic drink', 1),
- (5, 'Do not take indigestion remedies at the same time of the day as this medicine', 1),
- (6, 'Do not take indigestion remedies or medicines containing Iron or Zinc at the same time of a day as this medicine', 1),
- (7, 'Do not take milk, indigestion remedies, or medicines containing Iron or Zinc at the same time of day as this medicine', 1),
- (8, 'Do not stop taking this medicine except on your doctor''s advice', 1),
- (9, 'Take at regular intervals. Complete the prescribed course unless otherwise directed', 1),
- (10, 'Warning. Follow the printed instruction you have been given with this medicine', 1),
- (11, 'Avoid exposure of skin to direct sunlight or sun lamps', 1),
- (12, 'Do not take anything containing aspirin while taking this medicine', 1),
- (13, 'Dissolve or mix with water before taking', 1),
- (14, 'This medicine may colour the urine', 1),
- (15, 'Caution flammable: Keep away from fire or flames', 1),
- (16, 'Allow to dissolve under the tongue. Do not transfer from this container. Keep tightly closed. Discard 8 weeks after opening.', 1),
- (17, 'Do not take more than??.in 24 hours', 1),
- (18, 'Do not take more than ?..in 24 hours or?. In any one week', 1),
- (19, 'Warning. Causes drowsiness which may continue the next day. If affected do not drive or operate machinery. Avoid alcoholic drink', 1),
- (20, '??..with or after food', 1),
- (21, '???.half to one hour after food', 1),
- (22, '????..an hour before food or on an empty stomach', 1),
- (23, '???.an hour before food or on an empty stomach', 1),
- (24, '???. sucked or chewed', 1),
- (25, '??? swallowed whole, not chewed', 1),
- (26, '???dissolved under the tongue', 1),
- (27, '????with plenty of water', 1),
- (28, 'To be spread thinly?..', 1),
- (29, 'Do not take more than 2 at any one time. Do not take more than 8 in 24 hours', 1),
- (30, 'Do not take with any other paracetamol products.', 1),
- (31, 'Contains aspirin and paracetamol. Do not take with any other paracetamol products', 1),
- (32, 'Contains aspirin', 1),
- (33, 'contains an apirin-like medicine', 1),
- (34, 'Avoid a lot of fatty meals together with efavirenz', 1);";
- $tables['sync_regimen_category']="CREATE TABLE IF NOT EXISTS `sync_regimen_category` (
- `id` int(2) NOT NULL AUTO_INCREMENT,
- `Name` varchar(50) NOT NULL,
- `Active` varchar(2) NOT NULL,
- `ccc_store_sp` int(11) NOT NULL DEFAULT '2',
- PRIMARY KEY (`id`),
- KEY `ccc_store_sp` (`ccc_store_sp`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=14;
- INSERT INTO `sync_regimen_category` (`id`, `Name`, `Active`, `ccc_store_sp`) VALUES
- (4, 'Adult First Line', '1', 2),
- (5, 'Adult Second Line', '1', 2),
- (6, 'Other Adult ART', '1', 2),
- (7, 'Paediatric First Line', '1', 2),
- (8, 'Paediatric Second Line', '1', 2),
- (9, 'Other Pediatric Regimen', '1', 2),
- (10, 'PMTCT Mother', '1', 2),
- (11, 'PMTCT Child', '1', 2),
- (12, 'PEP Adult', '1', 2),
- (13, 'PEP Child', '', 2);";
- $tables['faq'] = "CREATE TABLE IF NOT EXISTS `faq` (
- `id` int(11) NOT NULL AUTO_INCREMENT,
- `modules` varchar(100) NOT NULL,
- `questions` varchar(255) NOT NULL,
- `answers` varchar(255) NOT NULL,
- `active` int(5) NOT NULL DEFAULT '1',
- PRIMARY KEY (`id`)
- ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;";
- foreach($tables as $table=>$statements){
- if (!$this->db->table_exists($table)){
- $statements=explode(";",$statements);
- foreach($statements as $statement){
- $this->db->query($statement);
- }
- $count++;
+ $count = 0;
+ $delimeter = "//";
+ $queries_dir = 'assets/queries';
+ $accepted_files = array('sql');
+ if (is_dir($queries_dir)) {
+ $files = scandir($queries_dir);
+ foreach ($files as $file_name) {
+ $ext = pathinfo($file_name, PATHINFO_EXTENSION);
+ if ($file_name != '.' && $file_name != '..' && in_array($ext, $accepted_files)) {
+ //Get query statements
+ $query_file = $queries_dir . '/' . $file_name;
+ $query_stmt = file_get_contents($query_file);
+ //Execute query statements
+ $statements = explode($delimeter, $query_stmt);
+ foreach($statements as $statement){
+ $statement = trim($statement);
+ if ($statement){
+ if (!$this->db->simple_query($statement))
+ {
+ $error = $file_name.'==>'.$this->db->_error_message().' ';
+ }
+ }
+ }
+ $count++;
+ }
}
- }
-
- if($count>0){
- $message="(".$count.") tables created! ";
- }
- return $message;
+ }
+ return "(".$count.") rows affected! ";
}
public function update_database_columns(){
@@ -842,6 +828,10 @@ public function update_database_columns(){
$statements['spouses']='ALTER TABLE `spouses` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT';
$statements['dependants']='ALTER TABLE `dependants` CHANGE `id` `id` INT(11) NOT NULL AUTO_INCREMENT';
$statements['source_destination'] = "ALTER TABLE `drug_stock_movement` CHANGE `Source_Destination` `Source_Destination` VARCHAR( 50 )";
+ $statements['maps_issynched']="ALTER TABLE `maps` ADD `issynched` varchar(5) NOT NULL DEFAULT 'N'";
+ $statements['maps_item_issynched']="ALTER TABLE `maps_item` ADD `issynched` varchar(5) NOT NULL DEFAULT 'N'";
+ $statements['cdrr_item_adjustments_neg']="ALTER TABLE `cdrr_item` ADD `adjustments_neg` INT(11) NULL AFTER `adjustments`";
+
if ($statements) {
foreach ($statements as $column => $statement) {
if ($statement != null) {
@@ -855,39 +845,50 @@ public function update_database_columns(){
return $message;
}
- //function to download guidelines from the nascop
- public function get_guidelines(){
- $this->load->library('ftp');
-
+ public function get_guidelines(){
+ $this->load->library('ftp');
$config['hostname'] = $this->ftp_url;
$config['username'] = 'demo';
$config['password'] = 'demo';
$config['port'] = 21;
$config['passive'] = TRUE;
$config['debug'] = TRUE;
-
$this->ftp->connect($config);
$server_file="/";
$dir = realpath($_SERVER['DOCUMENT_ROOT']);
-
$files = $this->ftp->list_files($server_file);
- if(!empty($files))
- {
- foreach($files as $file){
- $local_file = $dir . "/ADT/assets/guidelines". $file;
- $downloadfile= $this->ftp->download($file,$local_file , 'ascii');
- }
+ if(!empty($files))
+ {
+ foreach($files as $file){
+ $local_file = $dir . "/ADT/assets/guidelines". $file;
+ $downloadfile= $this->ftp->download($file,$local_file , 'ascii');
}
}
-
- public function update_system_version(){
+ }
+ //function to update dose on patient visit from id to dose name
+ public function update_dose_name(){
+ $message = '';
+ $sql="SELECT id, Name FROM dose";
+ $query = $this -> db -> query($sql);
+ $doses = $query -> result_array();
+ foreach ($doses as $dose) {
+ $dose_id= $dose['id'];
+ $dose_name=$dose['Name'];
+ $sql1="UPDATE patient_visit set dose='$dose_name' where dose='$dose_id' ";
+ $query1 = $this -> db -> query($sql1);
+ $message = 'Updated Dose Records in Visits ('.$this-> db -> affected_rows().')';
+ }
+
+ return $message;
+
+ }
+ public function update_system_version(){
$url = $this -> nascop_url . "sync/gitlog";
$facility_code = $this -> session -> userdata("facility");
$hash=Git_Log::getLatestHash();
$results = array("facility_code" => $facility_code, "hash_value" => $hash);
$json_data = json_encode($results, JSON_PRETTY_PRINT);
-
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
@@ -926,7 +927,6 @@ public function update_reporting() {
$facility_code = $this -> session -> userdata("facility");
$central_site = Sync_Facility::getId($facility_code, 0);
$central_site = $central_site['id'];
-
$sql = "SELECT sf.name as facility_name,sf.code as facility_code,IF(c.id,'reported','not reported') as status
FROM sync_facility sf
LEFT JOIN cdrr c ON c.facility_id=sf.id AND c.period_begin='$start_date'
@@ -936,7 +936,6 @@ public function update_reporting() {
GROUP BY sf.id";
$query = $this -> db -> query($sql);
$satellites = $query -> result_array();
-
$notification .= "";
$notification .= "Name Code Status ";
if ($satellites) {
@@ -945,11 +944,9 @@ public function update_reporting() {
}
}
$notification .= "
";
-
//send notification via email
ini_set("SMTP", "ssl://smtp.gmail.com");
ini_set("smtp_port", "465");
-
$sql = "SELECT DISTINCT(Email_Address) as email
FROM users u
LEFT JOIN access_level al ON al.id=u.Access_Level
@@ -968,22 +965,18 @@ public function update_reporting() {
if(!empty($mail_list))
{
$mail_list = implode(",", $mail_list);
-
$config['mailtype'] = "html";
$config['protocol'] = 'smtp';
$config['smtp_host'] = 'ssl://smtp.googlemail.com';
$config['smtp_port'] = 465;
$config['smtp_user'] = stripslashes('webadt.chai@gmail.com');
$config['smtp_pass'] = stripslashes('WebAdt_052013');
-
$this -> load -> library('email', $config);
-
$this -> email -> set_newline("\r\n");
$this -> email -> from('webadt.chai@gmail.com', "WEB_ADT CHAI");
$this -> email -> to("$mail_list");
$this -> email -> subject("ORDER REPORTING NOTIFICATION");
$this -> email -> message("$notification");
-
if ($this -> email -> send()) {
$message = 'Reporting Notification was sent! ';
$this -> email -> clear(TRUE);
@@ -995,7 +988,7 @@ public function update_reporting() {
return $message;
}
- function createStoredProcedures(){
+ public function createStoredProcedures(){
$data =array();
$data["MAPS: Patient Revisit OC CM Stored Procedure"] ="
@@ -1048,7 +1041,7 @@ function createStoredProcedures(){
return $message;
}
- public function addIndex(){//Create indexes on columns in table;
+ public function addIndex(){
$columns = array(
array(
"table"=>"patient_visit",
@@ -1087,4 +1080,5 @@ public function addIndex(){//Create indexes on columns in table;
return $message;
}
}
-?>
+ob_get_clean();
+?>
\ No newline at end of file
diff --git a/application/controllers/cdrr_logic.php b/application/controllers/cdrr_logic.php
index acb0978..0e2f026 100644
--- a/application/controllers/cdrr_logic.php
+++ b/application/controllers/cdrr_logic.php
@@ -3,7 +3,7 @@
class Cdrr_Logic extends MY_Controller {
var $nascop_url = "http://192.168.133.10/NASCOP/";
- var $escm_url = "http://api.kenyapharma.org/";
+ var $escm_url = "http://portal.kemsa.co.ke/escm-api/";
var $facility_code = "";
var $default_url = "";
diff --git a/application/controllers/dispensement_management.php b/application/controllers/dispensement_management.php
index b654306..42ae306 100644
--- a/application/controllers/dispensement_management.php
+++ b/application/controllers/dispensement_management.php
@@ -1,4 +1,6 @@
load->model('patientmodel');
print_r($this->patientmodel->get_patient_details($patientID));
}
+
+
+ /************
+ *************
+ iqcare changes
+ **************
+ ***************
+ **************/
+
+ public function get_pharmacy_order($record_no){
+ $this->load->dbutil();
+ $iqcare_data = array('size' => 0, 'orders' => array());
+ if ($this->dbutil->database_exists('mirth_adt_db')){
+ //Get patient ptnk
+ $row = $this->db->query('SELECT medical_record_number FROM patient where id='.$record_no.'')->row();
+ $ptnpk = $row->medical_record_number;
+ if($ptnpk){
+ //Get pharmacy orders for ptnpk
+ $order_query = "SELECT
+ ord.weight,
+ ord.height,
+ ord.adt_regimen_id current_regimen,
+ dtl.adt_drugId drug_id,
+ dtl.dose,
+ dtl.duration,
+ dtl.quantity
+ FROM ord_patientpharmacyorder ord
+ INNER JOIN dtl_patientpharmacyorder dtl ON ord.Ptnpk_pharmacy_pk = dtl.ptn_pharmacyPK
+ WHERE ord.PtnPk = $ptnpk";
+ $mirth_db=$this->load->database('mirth_db',TRUE);
+ $results = $mirth_db->query($order_query)->result_array();
+ $main_elements = array('weight', 'height', 'current_regimen');
+ $stem_length = sizeof($results);
+ foreach ($results as $counter => $result) {
+ $stem_elements = array();
+ foreach ($result as $key => $value) {
+ if(in_array($key, $main_elements)){
+ $iqcare_data['orders'][$key] = $value;
+ }else{
+ $stem_elements[$key] = $value;
+ }
+ }
+ $iqcare_data['orders']['items'][] = $stem_elements;
+ }
+ $iqcare_data['size'] = $stem_length;
+ }
+ }
+ echo json_encode($iqcare_data);
+ }
+ public function get_patient_details(){
+ $record_no = $this -> input -> post('record_no');
+ $facility_code = $this -> session -> userdata('facility');
+ $sql = "select ps.name as patient_source,p.patient_number_ccc,FLOOR(DATEDIFF(CURDATE(),p.dob)/365) as age from patient p
+ LEFT JOIN patient_source ps ON ps.id = p.source
+ where p.id='$record_no' and facility_code='$facility_code'
+ ";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ echo json_encode($results);
+
+ }
public function dispense($record_no) {
-
- //$this->db->save_queries = FALSE;
$facility_code = $this -> session -> userdata('facility');
$dispensing_date = "";
@@ -32,116 +93,23 @@ public function dispense($record_no) {
";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
+
if ($results) {
$patient_no = $results[0]['patient_number_ccc'];
$age=@$results[0]['age'];
$data['results'] = $results;
-
- }
-
- /***********/
- /*$sql = "SELECT r.id,
- r.regimen_desc,
- r.regimen_code,
- pv.dispensing_date,
- pv.current_weight,
- pv.current_height,
- v.name as visit_purpose_name
- FROM patient_visit pv
- LEFT JOIN regimen r ON r.id = pv.regimen
- LEFT JOIN visit_purpose v ON v.id = pv.visit_purpose
- WHERE pv.patient_id = '$patient_no'
- ORDER BY pv.dispensing_date DESC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $data['last_regimens'] = $results[0];
- $dispensing_date = $results[0]['dispensing_date'];
-
- //Check if patient had startART or enrollment purpose in previous visits
- $enrollment_check = 0;
- $start_art_check = 0;
- foreach($results as $result)
- {
- $visit_purpose = strtolower($result['visit_purpose_name']);
-
- if (strpos($visit_purpose,'startart') !== false)
- {
- $start_art_check = 1;
- }
- if(strpos($visit_purpose,'enrollment') !== false) {
- $enrollment_check = 1;
- }
- }
-
- $data['purposes'] = Visit_Purpose::getFiltered($enrollment_check,$start_art_check);
- }else{
- $data['purposes'] = Visit_Purpose::getAll();
- }
-
- $sql = "SELECT DISTINCT(d.drug),
- pv.quantity,
- pv.pill_count,
- pv.months_of_stock as mos,
- pv.drug_id,
- pv.dispensing_date,
- ds.value,
- ds.frequency,
- pv.dose,
- pv.duration
- FROM v_patient_visits pv
- LEFT JOIN drugcode d
- ON d.id=pv.drug_id
- LEFT JOIN dose ds
- ON ds.Name=d.dose
- WHERE pv.patient_id = '$patient_no'
- AND pv.dispensing_date = '$dispensing_date'
- ORDER BY pv.id DESC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- $data['prev_visit'] = "";
- if ($results) {
- $data['visits'] = $results;//Get latest dispensed drug;
- $data['prev_visit'] = json_encode($results);
- }
- $sql="UPDATE drugcode SET quantity='' WHERE quantity=0";
- $this->db->query($sql);
- $sql = "SELECT appointment "
- . "FROM patient_appointment pa "
- . "WHERE pa.patient = '$patient_no' "
- . "AND pa.facility = '$facility_code' "
- . "ORDER BY appointment DESC LIMIT 1";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $data['appointments'] = $results[0];
}
- $data['facility'] = $facility_code;
- $data['user'] = $this -> session -> userdata('full_name');
-
- if($age==''){
- $data['regimens'] = Regimen::getRegimens();
- }else{
- if($age>=15){
- //adult regimens
- $data['regimens']=Regimen::getAdultRegimens();
- }else if($age<15){
- //paediatric regimens
- $data['regimens']=Regimen::getChildRegimens();
- }
- }
-*/
/*************/
- $sql1="SELECT dispensing_date FROM patient_visit pv WHERE pv.patient_id = '$patient_no' AND pv.active=1 ORDER BY dispensing_date DESC LIMIT 1";
+ $sql1="SELECT dispensing_date FROM patient_visit pv WHERE pv.patient_id = ".$record_no." AND pv.active=1 ORDER BY dispensing_date DESC LIMIT 1";
$query = $this -> db -> query($sql1);
$results1 = $query -> row_array();
+ $dated='';
+ $results=array();
+ if($results1){
+ $dated=$results1['dispensing_date'];
-
-$dated=$results1['dispensing_date'];
-
- //die();
$sql = "SELECT d.id as drug_id,d.drug,d.dose,d.duration, pv.quantity,pv.dispensing_date,pv.pill_count,r.id as regimen_id,r.regimen_desc,r.regimen_code,pv.months_of_stock as mos,ds.value,ds.frequency
FROM patient_visit pv
@@ -154,17 +122,15 @@ public function dispense($record_no) {
ORDER BY dispensing_date DESC";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
- //getPreviouslyDispensedDrugs();
+ }
$data = array();
$data['non_adherence_reasons'] = Non_Adherence_Reasons::getAllHydrated();
$data['regimen_changes'] = Regimen_Change_Purpose::getAllHydrated();
$data['purposes'] = Visit_Purpose::getAll();
- $data['dated']=$dated;
-
+ $data['dated'] = $dated;
$data['patient_id'] = $record_no;
$data['purposes'] = Visit_Purpose::getAll();
$data['patient_appointment']=$results;
-
$data['hide_side_menu'] = 1;
$data['content_view'] = "patients/dispense_v";
$this -> base_params($data);
@@ -182,38 +148,10 @@ public function get_other_dispensing_details(){
echo json_encode($data);
}
-// public function getPreviouslyDispensedDrugs(){
-// $patient_ccc = $this ->input ->post("patient_ccc");
-// //$patient_ccc=0887679;
-// $sql1="SELECT dispensing_date FROM patient_visit WHERE patient_id = '$patient_ccc' AND active=1 ORDER BY dispensing_date DESC LIMIT 1";
-// $query = $this -> db -> query($sql1);
-// $results1 = $query -> result_array();
-
-
-// $dated=$results1[];
-// echo $dated;
-// die();
-
-// $sql = "SELECT d.id as drug_id,d.drug,d.dose,d.duration, pv.quantity,pv.dispensing_date,pv.pill_count,r.id as regimen_id,r.regimen_desc,r.regimen_code,pv.months_of_stock as mos,ds.value,ds.frequency
-// FROM patient_visit pv
-// LEFT JOIN drugcode d ON d.id = pv.drug_id
-// LEFT JOIN dose ds ON ds.Name=d.dose
-// LEFT JOIN regimen r ON r.id = pv.regimen
-// WHERE pv.patient_id = '$patient_ccc'
-// AND pv.active=1
-// AND pv.dispensing_date = '$dated'
-// ORDER BY dispensing_date DESC";
-
-// $query = $this -> db -> query($sql);
-// $results = $query -> result_array();
-// echo json_encode($results);
-// die();
-// }
-
public function getPreviouslyDispensedDrugs(){
$patient_ccc = $this ->input ->post("patient_ccc");
//$patient_ccc=1088816;
- $sql = "SELECT d.id as drug_id,d.drug,d.dose,d.duration, pv.quantity,pv.dispensing_date,pv.pill_count,r.id as regimen_id,r.regimen_desc,r.regimen_code,pv.months_of_stock as mos,ds.value,ds.frequency
+ $sql = "SELECT d.id as drug_id,d.drug,d.dose,pv.duration, pv.quantity,pv.dispensing_date,pv.pill_count,r.id as regimen_id,r.regimen_desc,r.regimen_code,pv.months_of_stock as mos,ds.value,ds.frequency
FROM patient_visit pv
LEFT JOIN drugcode d ON d.id = pv.drug_id
LEFT JOIN dose ds ON ds.Name=d.dose
@@ -234,7 +172,7 @@ public function getDrugsRegimens() {
$stock_type = $this -> input -> post('stock_type');
$and_stocktype = "AND dsb.stock_type = '$stock_type' ";
}
- $sql = "SELECT DISTINCT(d.id),UPPER(d.drug) as drug
+ $sql = "SELECT DISTINCT(d.id),UPPER(d.drug) as drug,IF(none_arv = 1, FALSE, TRUE) as is_arv
FROM regimen_drug rd
LEFT JOIN regimen r ON r.id = rd.regimen
LEFT JOIN drugcode d ON d.id=rd.drugcode
@@ -248,7 +186,7 @@ public function getDrugsRegimens() {
//die();
}
- public function getBrands() {
+ public function getBrands() {
$drug_id = $this -> input -> post("selected_drug");
$get_drugs_sql = $this -> db -> query("SELECT DISTINCT id,brand FROM brand WHERE drug_id='" . $drug_id . "' AND brand!=''");
$get_drugs_array = $get_drugs_sql -> result_array();
@@ -261,6 +199,19 @@ public function getDoses() {
echo json_encode($get_doses_array);
}
+ public function getDrugDose($drug_id) {
+ $get_doses_sql = $this -> db -> query("SELECT id,dose FROM drugcode where id='$drug_id'");
+ $get_doses_array = $get_doses_sql -> result_array();
+ echo json_encode($get_doses_array);
+ }
+ public function getFacililtyAge(){
+ $facility_code = $this -> session -> userdata('facility');
+ $get_adult_age_sql = $this -> db -> query("SELECT adult_age FROM facilities where facilitycode='$facility_code'");
+ $get_adult_age_array = $get_adult_age_sql -> result_array();
+ //echo $facility_code;
+ echo json_encode($get_adult_age_array);
+ }
+
//function to return drugs on the sync_drugs
public function getMappedDrugCode(){
$drug_id = $this -> input -> post("selected_drug");
@@ -679,18 +630,17 @@ public function print_test(){
$facility_name=$this->input->post("print_facility_name");
$facility_phone=$this->input->post("print_facility_phone");
$str="";
-
$this -> load -> library('mpdf');
//MPDF Config
$mode = 'utf-8';
- $format = array(80,90);
- $default_font_size = '11';
- $default_font = 'Helvetica';
- $margin_left = '5';
- $margin_right = '5';
+ $format = array(88.9,38.1);
+ $default_font_size = '9';
+ $default_font = 'Segoe UI';
+ $margin_left = '2';
+ $margin_right = '2';
$margin_top = '4';
- $margin_bottom = '4';
+ $margin_bottom = '2';
$margin_header = '';
$margin_footer = '';
$orientation = 'P';
@@ -702,45 +652,44 @@ public function print_test(){
foreach($check_if_print as $counter=>$check_print){
//selected to print
if($check_print){
- //count no. to print
- $count=1;
-
- while($count<=$no_to_print[$counter]){
- $this -> mpdf -> addPage();
- $str='';
- $str.='';
- $str.='Drugname: '.strtoupper($drug_name[$counter]).' ';
- $str.='Qty: '.$qty[$counter].' ';
- $str.=' ';
- $str.='';
- $str.='Tablets/Capsules: ';
- $str.=''.$dose_value[$counter].' to be taken '.$dose_frequency[$counter].' times a day after every '.$dose_hours[$counter].' hours ';
- $str.=' ';
- $str.='';
- $str.='Before/After Meals: ';
- $str.=''.$drug_instructions[$counter].' ';
- $str.=' ';
- $str.='';
- $str.='Patient Name: '.$patient_name.' Pharmacy :'.$pharmacy_name[$counter].' Date:'.$dispensing_date.' ';
- $str.=' ';
- $str.='';
- $str.='Keep all medicines in a cold dry place out of reach of children. ';
- $str.='Facility Name: '.$this->session->userdata("facility_name").' Facility Phone: '.$this->session->userdata("facility_phone").' ';
- $str.=' ';
- $str.=' ';
- $str.='
';
- //write to page
- $this -> mpdf -> WriteHTML($str);
- $count++;
- }
- }
- }
+ //count no. to print
+ $count=1;
+ while($count<=$no_to_print[$counter]){
+ $this -> mpdf -> addPage();
+ $str='';
+ $str.='';
+ $str.='Drugname: '.strtoupper($drug_name[$counter]).' ';
+ $str.='Qty: '.$qty[$counter].' ';
+ $str.=' ';
+ $str.='';
+ $str.='Tablets/Capsules: ';
+ $str.=''.$dose_value[$counter].' to be taken '.$dose_frequency[$counter].' times a day after every '.$dose_hours[$counter].' hours ';
+ $str.=' ';
+ $str.='';
+ $str.='Before/After Meals: ';
+ $str.=''.$drug_instructions[$counter].' ';
+ $str.=' ';
+ $str.='';
+ $str.='Patient Name: '.$patient_name.' Pharmacy :'.$pharmacy_name[$counter].' Date:'.$dispensing_date.' ';
+ $str.=' ';
+ $str.='';
+ $str.='Keep all medicines in a cold dry place out of reach of children. ';
+ $str.='Facility Name: '.$this->session->userdata("facility_name").' Facility Phone: '.$this->session->userdata("facility_phone").' ';
+ $str.=' ';
+ $str.=' ';
+ $str.='
';
+ //write to page
+ $this -> mpdf -> WriteHTML($str);
+ $count++;
+ } //end while
+ }//end if
+ } //end foreach
$file_name='Export/'.$patient_name.'(Labels).pdf';
$this -> mpdf -> Output($file_name, 'F');
echo base_url().$file_name;
- }else{
- echo 0;
- }
+ }else{
+ echo 0;
+ }
}
public function getInstructions($drug_id){
@@ -787,4 +736,5 @@ public function save_session(){
}
+ob_get_clean();
?>
\ No newline at end of file
diff --git a/application/controllers/dossing_chart.php b/application/controllers/dossing_chart.php
new file mode 100644
index 0000000..0c5764e
--- /dev/null
+++ b/application/controllers/dossing_chart.php
@@ -0,0 +1,175 @@
+ session -> set_userdata("link_id", "index");
+ $this -> session -> set_userdata("linkSub", "dossing_chart");
+ $this -> session -> set_userdata("linkTitle", "Pediatrics Dossing Chart");
+ }
+
+ public function index() {
+ $this -> listing();
+ }
+
+ public function listing() {
+ $access_level = $this -> session -> userdata('user_indicator');
+ $data = array();
+ //get dosssing information from the dossing_chart table
+ $sql="select ds.id,min_weight,max_weight,d.drug,do.Name as dose,ds.is_active as is_active
+ from dossing_chart ds
+ inner join drugcode d on d.id=ds.drug_id
+ inner join dose do on do.id=ds.dose_id
+ ";
+ $query = $this -> db -> query($sql);
+ $classifications = $query -> result_array();
+ $tmpl = array('table_open' => '');
+ $this -> table -> set_template($tmpl);
+ $this -> table -> set_heading('','Minimum Weight' ,'Maximum Weight', 'Drug','Dose','Options');
+ foreach ($classifications as $classification) {
+ $links = "";
+ $array_param = array('id' => $classification['id'], 'role' => 'button', 'class' => 'edit_user', 'data-toggle' => 'modal', 'name' => $classification['dose']);
+ //$array_param = array('id' => $classification['id'], 'role' => 'button', 'class' => 'edit_user', 'data-toggle' => 'modal');
+ if ($classification['is_active'] == 1) {
+ $links .= anchor('#edit_form', 'Edit', $array_param);
+ }
+ //Check if user is an admin
+ if ($access_level == "facility_administrator") {
+
+ if ($classification['is_active'] == 1) {
+ $links .= " | ";
+ $links .= anchor('dossing_chart/disable/' . $classification['id'], 'Disable', array('class' => 'disable_user'));
+ } else {
+ $links .= anchor('dossing_chart/enable/' . $classification['id'], 'Enable', array('class' => 'enable_user'));
+ }
+ }
+
+ $this -> table -> add_row(
+ $classification['min_weight'],
+ $classification['min_weight'],
+ $classification['max_weight'],
+ $classification['drug'],
+ $classification['dose'], $links);
+ }
+ $data['classifications'] = $this -> table -> generate();
+ $this -> base_params($data);
+ }
+ //function to select all pediatric drugs
+ public function get_drugs(){
+ $sql="select d.id,d.drug
+ from drugcode d
+ inner join regimen_drug rd on d.id=rd.drugcode
+ inner join regimen r on r.id = rd.regimen
+ WHERE (r.regimen_code LIKE '%CF%'
+ OR r.regimen_code LIKE '%PC%'
+ OR r.regimen_code LIKE '%CS%'
+ OR r.regimen_code LIKE '%CT%'
+ OR r.regimen_code LIKE '%OC%')
+ AND rd.active = '1'
+ GROUP BY d.id";
+ $query = $this -> db -> query($sql);
+ $data = $query -> result_array();
+ echo json_encode($data);
+
+ }
+ //function to get doses from dose table
+ public function get_dose(){
+ $sql="select id, Name
+ from dose
+ where Active = '1'";
+ $query = $this -> db -> query($sql);
+ $data = $query -> result_array();
+ echo json_encode($data);
+
+ }
+ //save dossing infotmation to dossing chart database
+ public function save() {
+ //call validation function
+ $valid = $this -> _submit_validate();
+ if ($valid == false) {
+ $data['settings_view'] = "dossing_chart_v";
+ $this -> base_params($data);
+ }
+ else {
+ $drugs=$this -> input -> post("drug");
+ foreach ($drugs as $drug) {
+ $data = array(
+ 'min_weight' => $this -> input -> post("min_weight"),
+ 'max_weight' => $this -> input -> post("max_weight"),
+ 'drug_id' => $drug,
+ 'dose_id' => $this -> input -> post("dose")
+ );
+ $result=$this->db->insert('dossing_chart',$data);
+
+ }
+ if($result){
+ $this -> session -> set_userdata('msg_success', ' Item was Added');
+ }
+ else
+ {
+ $this -> session -> set_userdata('msg_success', ' Item was not Added');
+ }
+
+ redirect("settings_management");
+ }
+
+ }
+ //function to get data for edit view
+ public function edit(){
+ $id = $this -> input -> post('id');
+ $sql="select d.id,min_weight,max_weight,do.Name,dc.drug from dossing_chart d
+ inner join drugcode dc on dc.id=d.drug_id
+ inner join dose do on do.id=d.dose_id
+ where d.id='$id'";
+ $query = $this -> db -> query($sql);
+ $data = $query -> result_array();
+ echo json_encode($data);
+ }
+ //update records
+ public function update() {
+ $id = $this -> input -> post('idno');
+ $min_weight = $this -> input -> post('min_weights');
+ $max_weight = $this -> input -> post('max_weights');
+ $drug_id = $this -> input -> post('drugs');
+ $dose_id = $this -> input -> post('doses');
+ $query = $this -> db -> query("UPDATE dossing_chart SET
+ min_weight='$min_weight',
+ max_weight='$max_weight',
+ drug_id='$drug_id',
+ dose_id='$dose_id'
+ WHERE id='$id'");
+
+ $this -> session -> set_userdata('msg_success','Update Was Successfull');
+ //Filter datatable
+ redirect("settings_management");
+ }
+
+
+ public function enable($classification_id) {
+ $query = $this -> db -> query("UPDATE dossing_chart SET is_active='1' WHERE id='$classification_id'");
+ $this -> session -> set_userdata('msg_success','Item was enabled');
+ //Filter datatable
+ redirect("settings_management");
+ }
+
+ public function disable($classification_id) {
+ $query = $this -> db -> query("UPDATE dossing_chart SET is_active='0' WHERE id='$classification_id'");
+ $this -> session -> set_userdata('msg_error','Item was disabled');
+ //Filter datatable
+ redirect("settings_management");
+ }
+ private function _submit_validate() {
+ $this->form_validation->set_rules('min_weight', 'Mimimum Weight', 'required');
+ $this->form_validation->set_rules('max_weight', 'Maximium Weight', 'required');
+ $this->form_validation->set_rules('dose', 'Dosage', 'required');
+ $this->form_validation->set_rules('drug', 'Drug', 'required');
+ return $this -> form_validation -> run();
+ }
+
+ public function base_params($data) {
+ $this -> load -> view('dossing_chart_v', $data);
+ }
+}
+?>
\ No newline at end of file
diff --git a/application/controllers/drugcode_management.php b/application/controllers/drugcode_management.php
index 5b45d28..78aebb1 100644
--- a/application/controllers/drugcode_management.php
+++ b/application/controllers/drugcode_management.php
@@ -304,7 +304,6 @@ public function getNonMappedDrugs($param='0'){
}
$data['non_mapped_drugs'] = Drugcode::getNonMappedDrugs();//Not mapped regimens
-
echo json_encode($data);
}
diff --git a/application/controllers/facility_management.php b/application/controllers/facility_management.php
index 5155168..6199b7a 100644
--- a/application/controllers/facility_management.php
+++ b/application/controllers/facility_management.php
@@ -78,7 +78,7 @@ public function update() {
'district' => $this -> input -> post('district'),
'county' => $this -> input -> post('county'),
'weekday_max' => $this -> input -> post('weekday_max'),
- 'weekend_max' => $this -> input -> post('weekend_max'),
+ 'weekend_max' => $this -> input -> post('weekend_max'),
'supported_by' => $this -> input -> post('supported_by'),
'phone' => $this -> input -> post('phone_number'),
'service_art' => $art_service,
@@ -86,7 +86,8 @@ public function update() {
'service_pep' => $pep_service,
'supplied_by' => $this -> input -> post('supplied_by'),
'parent' => $this -> input -> post('central_site'),
- 'map'=>$this->input->post("sms_map", TRUE)
+ 'map'=>$this->input->post("sms_map", TRUE),
+ 'lost_to_follow_up' => $this -> input -> post('lost_to_follow_up'),
);
$this -> db -> where('id', $facility_id);
$this -> db -> update('facilities', $data);
@@ -104,9 +105,12 @@ public function base_params($data) {
$data['quick_link'] = "facility";
if ($access_level == "system_administrator") {
$data['facilities_list'] = Facilities::getAll($source);
- $this -> load -> view("facility_v", $data);
- } else {
- $data['facilities'] = Facilities::getCurrentFacility($source);
+ $this -> load -> view("facility_v", $data); }
+ else {
+ $sql="SELECT * FROM Facilities where facilitycode='$source'";
+ $query = $this -> db -> query($sql);
+ $data['facilities'] = $query -> result_array();
+ //$data['facilities'] = Facilities::getCurrentFacility($source);
$this -> load -> view("facility_user_v", $data);
}
diff --git a/application/controllers/facilitydashboard_management.php b/application/controllers/facilitydashboard_management.php
index 413bbd6..770336b 100644
--- a/application/controllers/facilitydashboard_management.php
+++ b/application/controllers/facilitydashboard_management.php
@@ -337,132 +337,20 @@ public function getStockSafetyQty($stock_type = "2") {
echo $drug_display;
}
- public function getPatientMasterList() {
- ini_set("max_execution_time", "100000");
+ public function getPatientMasterList()
+ {
ini_set("memory_limit", '2048M');
- $adultage=$this -> session -> userdata('adult_age');
- $facility_name=$this -> session -> userdata('facility_name');
- //export patient transactions
- $dir = "Export";
- $objPHPExcel = new PHPExcel();
- $objPHPExcel->setActiveSheetIndex(0);
-
- /*Delete all files in export folder*/
- if (is_dir($dir)) {
- $files = scandir($dir);
- foreach ($files as $object) {
- if ($object != "." && $object != "..") {
- unlink($dir . "/" . $object);
- }
- }
- } else {
- mkdir($dir);
- }
-
- $sql = "SELECT medical_record_number,
- patient_number_ccc,
- first_name,
- last_name,
- other_name,
- dob as Date_Of_Birth,
- ROUND(DATEDIFF(CURDATE(),dob)/360) as age,
- IF(ROUND(DATEDIFF(CURDATE(),dob)/360)>=$adultage,'Adult','Paediatric') as Patient_Category,
- pob,
- IF(gender=1,'MALE','FEMALE')as gender,
- IF(pregnant=1,'YES','NO')as pregnant,
- weight as Current_Weight,
- height as Current_height,
- sa as Current_BSA,
- p.phone as Phone_Number,
- physical as Physical_Address,
- alternate as Alternate_Address,
- other_illnesses,
- other_drugs,
- adr as Drug_Allergies,
- IF(tb=1,'YES','NO')as TB,
- IF(smoke=1,'YES','NO')as smoke,
- IF(alcohol=1,'YES','NO')as alcohol,
- date_enrolled,
- ps.name as Patient_source,
- s.Name as supported_by,
- rst.name as Service,
- r1.regimen_desc as Start_Regimen,
- start_regimen_date,
- pst.Name as Current_status,
- IF(sms_consent=1,'YES','NO') as SMS_Consent,
- fplan as Family_Planning,
- tbphase,
- startphase,
- endphase,
- IF(partner_status=1,'Concordant',IF(partner_status=2,'Discordant','')) as partner_status,
- status_change_date,
- IF(partner_type=1,'YES','NO') as Disclosure,
- support_group,
- r.regimen_desc as Current_Regimen,
- nextappointment,
- DATEDIFF(nextappointment,CURDATE()) AS Days_to_NextAppointment,
- start_height,
- start_weight,
- start_bsa,
- IF(p.transfer_from !='',f.name,'N/A') as Transfer_From,
- dp.name as Prophylaxis
- FROM patient p
- LEFT JOIN regimen r on r.id=p.current_regimen
- LEFT JOIN regimen r1 on r1.id=p.start_regimen
- LEFT JOIN patient_source ps on ps.id=p.source
- LEFT JOIN supporter s on s.id=p.supported_by
- LEFT JOIN regimen_service_type rst on rst.id=p.service
- LEFT JOIN patient_status pst on pst.id=p.current_status
- LEFT JOIN facilities f on f.facilitycode=p.transfer_from
- LEFT JOIN drug_prophylaxis dp on dp.id=p.drug_prophylaxis
- WHERE p.active='1'
- ORDER BY p.id ASC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
-
- //get columns
- $column = array();
- $letter = 'A';
- while ($letter !== 'AAA') {
- $column[] = $letter++;
- }
- //set col and row indices
- $col=0;
- $row=0;
-
- //loop through patients
- if($results){
- foreach ($results as $counter=>$mydata) {
- $row++;
- $col=0;
- foreach ($mydata as $index => $value) {
- $position=$column[$col].$row;
- if($row==1){
- //first row
- $index=strtoupper(str_replace("_"," ", $index));
- $objPHPExcel -> getActiveSheet() -> SetCellValue($position, $index);
- }else{
- $objPHPExcel -> getActiveSheet() -> SetCellValue($position, $value);
- }
- $col++;
- }
- }
- }
-
- //Generate file
- ob_start();
- $timestamp=date('d-M-Y H-i-s a');
- $original_filename = strtoupper($facility_name)." PATIENT MASTER LIST[".$timestamp."].csv";
- $filename = $dir . "/" . urldecode($original_filename);
-
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
- $objWriter->save($filename);
- $objPHPExcel -> disconnectWorksheets();
- unset($objPHPExcel);
- if (file_exists($filename)) {
- $filename = str_replace("#", "%23", $filename);
- redirect($filename);
- }
- }
+ $this->load->dbutil();
+ $this->load->helper('file');
+ $this->load->helper('download');
+ $delimiter = ",";
+ $newline = "\r\n";
+ $filename = "patient_master_list.csv";
+ $query = "SELECT * FROM vw_patient_list";
+ $results = $this->db->query($query);
+ $data = $this->dbutil->csv_from_result($results, $delimiter, $newline);
+ ob_clean();//Removes spaces
+ force_download($filename, $data);
+ }
}
\ No newline at end of file
diff --git a/application/controllers/inventory_management.php b/application/controllers/inventory_management.php
index 409a417..bea669d 100644
--- a/application/controllers/inventory_management.php
+++ b/application/controllers/inventory_management.php
@@ -151,6 +151,7 @@ public function getDrugBinCard($drug_id='',$ccc_id=''){
//CCC Store Name
$ccc = CCC_store_service_point::getCCC($ccc_id);
$ccc_name = $ccc['Name'];
+
$pack_size = 0;
//get drug information
$drug=Drugcode::getDrug($drug_id,$ccc_id);
@@ -190,11 +191,13 @@ public function getDrugBinCard($drug_id='',$ccc_id=''){
$transaction_type = Transaction_Type::getTransactionType('issue',0);
$transaction_type = $transaction_type['id'];
}
- $consumption = Drug_Stock_Movement::getDrugConsumption($drug_id, $facility_code,$ccc_id,$transaction_type);
+ $consumption = Drug_Stock_Movement::getDrugConsumption($drug_id, $facility_code,$ccc_id,$transaction_type);
foreach ($consumption as $value) {
$three_months_consumption += $value['total_out'];
}
+
+ // echo "";print_r($data);die;
//3 Months consumption using facility orders
$data['maximum_consumption'] = number_format($three_months_consumption);
$data['avg_consumption'] = number_format(($three_months_consumption) / 3);
@@ -209,10 +212,13 @@ public function getDrugBinCard($drug_id='',$ccc_id=''){
$data['store'] = $ccc_name;
$data['drug_id'] = $drug_id;
$data['content_view']='bin_card_v';
+
$this->base_params($data);
}
public function getDrugTransactions($drug_id='4',$ccc_id='2'){
+ /*Added Limit as there are issues*/
+ ini_set("memory_limit", -1);
$iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
$iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
$iSortCol_0 = $this -> input -> get_post('iSortCol_0', false);
@@ -327,7 +333,6 @@ public function getDrugTransactions($drug_id='4',$ccc_id='2'){
$this -> db -> where("ds.ccc_store_sp", $ccc_id);
$total = $this -> db -> get();
$iTotal = count($total -> result_array());
-
// Output
$output = array('sEcho' => intval($sEcho),
'iTotalRecords' => $iTotal,
diff --git a/application/controllers/migration_management.php b/application/controllers/migration_management.php
index ae78421..0b6eadd 100644
--- a/application/controllers/migration_management.php
+++ b/application/controllers/migration_management.php
@@ -418,7 +418,6 @@ public function mapping($facility_code=null,$ccc_pharmacy=null,$source_database=
'currentheight',
's.sourceofclient',
'IF(tb=0,"0","1")',
- 'universalid',
'STR_TO_DATE(datestartedonart, "%Y-%m-%d")',
'STR_TO_DATE(datechangedstatus, "%Y-%m-%d")',
'lastname',
@@ -458,7 +457,6 @@ public function mapping($facility_code=null,$ccc_pharmacy=null,$source_database=
'height',
'source',
'tb',
- 'medical_record_number',
'start_regimen_date',
'status_change_date',
'other_name',
diff --git a/application/controllers/new_patients.php b/application/controllers/new_patients.php
new file mode 100644
index 0000000..e71a05e
--- /dev/null
+++ b/application/controllers/new_patients.php
@@ -0,0 +1,227 @@
+display_new_patients();
+ }
+
+ public function display_new_patients()
+ {
+ $this->data['title'] = "New Patients";
+ $this->data['banner_text'] = "New Patients From IQCare";
+ $this->data['content_view'] = 'new_patient_sync';
+ $this->data['new_patients']=$this->get_new_patients();
+ $this->load->view('template',$this->data);
+ }
+
+ public function get_new_patients()
+ {
+ $get="select * from mirth_sync where inserted=0";
+ $user_get=$this->db->query($get);
+ return $user_get->result_array();
+
+ }
+
+ public function insert_into_db()
+ {
+ if(isset($_POST['approve']))
+ {
+ $approve=$this->input->post('select');
+ $patient_number_ccc=$this->input->post('patient_number_ccc');
+ $first_name=$this->input->post('first_name');
+ $last_name=$this->input->post('last_name');
+ $other_name=$this->input->post('other_name');
+ $gender=$this->input->post('gender');
+ $phone=$this->input->post('phone');
+ $date_enrolled=$this->input->post('date_enrolled');
+
+
+ $new_patient = array();
+ foreach($approve as $key=>$value){
+ $new_patient[$key]['patient_number_ccc'] = $patient_number_ccc[$key];
+ }
+ $success=TRUE;
+
+ if($success==TRUE){
+ foreach($patient_number_ccc as $key=>$value){
+ $update=$new_patient[$key]['patient_number_ccc'];
+
+ $sql="select * from mirth_sync where patient_number_ccc='$update'";
+ $query=$this->db->query($sql);
+
+
+
+ if ($query->num_rows() > 0)
+{
+ $row = $query->row();
+
+ $id= $row->id;
+$patient_number_ccc=$row->patient_number_ccc;
+ $fname=$row->first_name;
+ $lame= $row->last_name;
+ $oname= $row->other_name;
+ $gender=$row->gender;
+ $dob=$row->dob;
+ $pob=$row->pob;
+ // $phone= $row->phone;
+ $date_enrolled= $row->date_enrolled;
+ $source= $row->source;
+ $start_regimen_date= $row->start_regimen_date;
+ $supported_by= $row->supported_by;
+ $start_regimen= $row->start_regimen;
+ //$drug_allergies= $row->drug_allergies;
+ //$from_facility_id= $row->from_facility_id;
+ //$patient_status_id= $row->patient_status_id;
+ $physical= $row->physical;
+ $weight= $row->weight;
+ $height= $row->height;
+ //$pregnant= $row->pregnant;
+ $who_stage= $row->who_stage;
+ //$other_drugs= $row->other_drugs;
+ $facility_code= $row->facility_code;
+ $service= $row->service;
+ $timestamp= $row->timestamp;
+ $sa= $row->sa;
+ $other_drugs= $row->other_drugs;
+ $current_regimen= $row->current_regimen;
+ $start_weight= $row->start_weight;
+ $start_height= $row->start_height;
+ $start_bsa= $row->start_bsa;
+
+$sql1 = "insert INTO patients_approved
+(patient_number_ccc,first_name,last_name,other_name,dob,pob,gender,weight,height,sa,physical,other_drugs,
+date_enrolled,source,supported_by,timestamp,facility_code,service,start_regimen,start_regimen_date,current_regimen,
+start_height,start_weight,start_bsa,who_stage)
+VALUES
+('$patient_number_ccc','$fname','$lame','$oname','$dob','$pob','$gender','$weight','$height','$sa','$physical',
+'$other_drugs','$date_enrolled','$source','$supported_by','$timestamp','$facility_code','$service','$start_regimen',
+'$start_regimen_date','$current_regimen','$start_height','$start_weight','$start_bsa','$who_stage')";
+$ex=$this -> db -> query($sql1);
+//echo $this->db->_error_message();
+ if($ex){
+
+ $sql="UPDATE mirth_sync set inserted=1 where patient_number_ccc=$patient_number_ccc";
+ $query=mysql_query($sql);
+
+ }
+ else{
+
+ }
+
+
+}
+}
+
+ }
+ redirect('new_patients');
+ }
+
+//dissaproved from IQCare
+
+if(isset($_POST['disapprove']))
+ {
+ $approve=$this->input->post('select');
+ $patient_number_ccc=$this->input->post('patient_number_ccc');
+ $first_name=$this->input->post('first_name');
+ $last_name=$this->input->post('last_name');
+ $other_name=$this->input->post('other_name');
+ $gender=$this->input->post('gender');
+ $phone=$this->input->post('phone');
+ $date_enrolled=$this->input->post('date_enrolled');
+
+
+ $new_patient = array();
+ foreach($approve as $key=>$value){
+ $new_patient[$key]['patient_number_ccc'] = $patient_number_ccc[$key];
+ }
+ $success=TRUE;
+
+ if($success==TRUE){
+ foreach($patient_number_ccc as $key=>$value){
+ $update=$new_patient[$key]['patient_number_ccc'];
+
+ $sql="select * from mirth_sync where patient_number_ccc='$update'";
+ $query=$this->db->query($sql);
+
+
+
+ if ($query->num_rows() > 0)
+{
+ $row = $query->row();
+
+ $id= $row->id;
+$patient_number_ccc=$row->patient_number_ccc;
+ $fname=$row->first_name;
+ $lame= $row->last_name;
+ $oname= $row->other_name;
+ $gender=$row->gender;
+ $dob=$row->dob;
+ $pob=$row->pob;
+ // $phone= $row->phone;
+ $date_enrolled= $row->date_enrolled;
+ $source= $row->source;
+ $start_regimen_date= $row->start_regimen_date;
+ $supported_by= $row->supported_by;
+ $start_regimen= $row->start_regimen;
+ //$drug_allergies= $row->drug_allergies;
+ //$from_facility_id= $row->from_facility_id;
+ //$patient_status_id= $row->patient_status_id;
+ $physical= $row->physical;
+ $weight= $row->weight;
+ $height= $row->height;
+ //$pregnant= $row->pregnant;
+ $who_stage= $row->who_stage;
+ //$other_drugs= $row->other_drugs;
+ $facility_code= $row->facility_code;
+ $service= $row->service;
+ $timestamp= $row->timestamp;
+ $sa= $row->sa;
+ $other_drugs= $row->other_drugs;
+ $current_regimen= $row->current_regimen;
+ $start_weight= $row->start_weight;
+ $start_height= $row->start_height;
+ $start_bsa= $row->start_bsa;
+
+$sql1 = "insert INTO patients_disapproved
+(patient_number_ccc,first_name,last_name,other_name,dob,pob,gender,weight,height,sa,physical,other_drugs,
+date_enrolled,source,supported_by,timestamp,facility_code,service,start_regimen,start_regimen_date,current_regimen,
+start_height,start_weight,start_bsa,who_stage)
+VALUES
+('$patient_number_ccc','$fname','$lame','$oname','$dob','$pob','$gender','$weight','$height','$sa','$physical',
+'$other_drugs','$date_enrolled','$source','$supported_by','$timestamp','$facility_code','$service','$start_regimen',
+'$start_regimen_date','$current_regimen','$start_height','$start_weight','$start_bsa','$who_stage')";
+$ex=$this -> db -> query($sql1);
+echo $this->db->_error_message();
+
+ if($ex){
+
+$sql="UPDATE mirth_sync set inserted=1 where patient_number_ccc=$patient_number_ccc";
+ $query=mysql_query($sql);
+
+ }
+ else{
+
+ }
+
+
+}
+}
+
+ }
+ redirect('new_patients');
+ }
+
+ }
+
+
+
+}
+
+
+
+
+
diff --git a/application/controllers/notification_management.php b/application/controllers/notification_management.php
index 4e32b11..2db42d9 100644
--- a/application/controllers/notification_management.php
+++ b/application/controllers/notification_management.php
@@ -5,7 +5,7 @@ class notification_management extends MY_Controller {
function __construct() {
parent::__construct();
- ini_set("max_execution_time", "100000");
+ ini_set("max_execution_time", "1000000");
ini_set("memory_limit", '2048M');
ini_set("allow_url_fopen", '1');
@@ -32,6 +32,7 @@ public function password_notification() {
} else {
$temp = " Password expiry " . $days_before_pwdchange . " Days
";
}
+
echo $temp;
}
@@ -80,6 +81,7 @@ public function reporting_notification() {
}
public function update_notification() {
+ /*
ini_set("max_execution_time", "1000000");
$this -> load -> library('Curl');
@@ -143,6 +145,9 @@ public function update_notification() {
}
}
echo $temp;
+ */
+ $changelog_link=base_url().'changelog.txt';
+ echo " System Up to Date ";
}
public function error_notification($display_array=false) {
@@ -161,6 +166,7 @@ public function error_notification($display_array=false) {
OR p.gender='null'
OR p.gender is null)
AND p.active='1'
+ -- AND p.current_status = '1'
GROUP BY p.patient_number_ccc;";
/*Patients without DOB*/
@@ -309,6 +315,7 @@ public function error_notification($display_array=false) {
LEFT JOIN regimen_service_type rst2 ON rst2.id = r.type_of_service
WHERE rst1.id != rst2.id
AND rst2.Name NOT LIKE '%oi%'
+ -- AND p.current_status = 1
GROUP BY p.patient_number_ccc;";
if($display_array==true){
@@ -333,7 +340,11 @@ public function error_notification($display_array=false) {
$temp = " Errors " . $overall_total . "
";
}
echo $temp;
- }
+
+
+
+ }
+
}
public function load_error_view() {
@@ -554,7 +565,7 @@ public function load_followup_view(){
//loop through patients adding the rows
foreach($patients as $patient){
$detail_link="Detail ";
- $edit_link="Edit ";
+ $edit_link="Edit ";
$disable_link="Disable ";
$patient['links']=$detail_link." | ".$edit_link." | ".$disable_link;
unset($patient['id']);
diff --git a/application/controllers/order.php b/application/controllers/order.php
index 9395159..6bb07a5 100644
--- a/application/controllers/order.php
+++ b/application/controllers/order.php
@@ -1,382 +1,94 @@
load -> library('Curl');
-
- $dir = realpath($_SERVER['DOCUMENT_ROOT']);
- $link = $dir . "\\ADT\\assets\\nascop.txt";
- // $vr = file_get_contents($link)."/laban";
- // $vr1=str_replace(" ",'',$vr);
- // print_r($vr);
- //die();
- $this -> nascop_url = file_get_contents($link);
- //nascop_url = file_get_contents($link);
-//print_r(nascop_url);
- // die();
-
+ $this->facility_code = $this -> session -> userdata('facility');
+ $this->facility_type = Facilities::getType($this->facility_code);
+ $this->user_id = $this -> session -> userdata('user_id');
}
public function index() {
- $facility_code = $this -> session -> userdata('facility');
- //get supplier
- $facility = Facilities::getSupplier($facility_code);
- $supplier = $facility -> supplier -> name;
- if (!$this -> session -> userdata('api_id')) {
- $data['content_view'] = "orders/login_v";
- $data['login_type'] = 0;
- if (strtoupper($supplier) == "KENYA PHARMA") {
- $data['login_type'] = 1;
- }
- } else {
- $data['cdrr_buttons'] = $this -> get_buttons("cdrr");
- $data['cdrr_filter'] = $this -> get_filter("cdrr");
- $data['fmap_buttons'] = $this -> get_buttons("maps");
- $data['maps_filter'] = $this -> get_filter("maps");
- $data['cdrr_table'] = $this -> get_orders("cdrr");
- $data['map_table'] = $this -> get_orders("maps");
- $data['aggregate_table'] = $this -> get_orders("aggregate");
- $data['facilities'] = Facilities::getSatellites($facility_code);
- $data['content_view'] = "orders/order_v";
-
- }
- $data['supplier_name']=strtolower($supplier);
+ $data['cdrr_buttons'] = $this -> get_buttons("cdrr");
+ $data['cdrr_filter'] = $this -> get_filter("cdrr");
+ $data['fmap_buttons'] = $this -> get_buttons("maps");
+ $data['maps_filter'] = $this -> get_filter("maps");
+ $data['cdrr_table'] = $this -> get_orders("cdrr");
+ $data['map_table'] = $this -> get_orders("maps");
+ $data['facilities'] = Facilities::getSatellites($this->facility_code);
$data['page_title'] = "my Orders";
$data['banner_text'] = "Facility Orders";
+ $data['content_view'] = "orders/order_v";
$this -> base_params($data);
}
- public function authenticate_user($login_type = 0) {
- $curl = new Curl();
- if ($login_type == 1) {
- //eSCM
- $username = $this -> input -> post("username");
- $password = $this -> input -> post("password");
- $curl -> setBasicAuthentication($username, $password);
- $curl -> setOpt(CURLOPT_RETURNTRANSFER, TRUE);
- $url = $this -> esm_url . 'user/' . $username;
- $curl -> get($url);
- } else {
- //nascop
- $post_data = array(
- "email" => $this -> input -> post("email", TRUE),
- "password" => $this -> input -> post("password",TRUE)
- );
- $url = trim($this -> nascop_url) . 'sync/user';
- $curl -> post($url,$post_data);
- }
- if ($curl -> error) {
- $curl -> error_code;
- $error_name = "";
- //Check typer of error
- if ($curl -> error_code == 6 || $curl -> error_code == 7) {//Internet Connection error
- $this -> session -> set_flashdata('login_message', "Problem while connecting to the Server! ".$curl -> error_message." ");
- } else {
- $this -> session -> set_flashdata('login_message', "Error " . $curl -> error_code . ": Login Failed! Incorrect credentials ");
- }
-
- redirect("order");
- } else {
- $main_array = json_decode($curl -> response, TRUE);
- if ($login_type == 1) {
- $user_array = array();
- foreach ($main_array as $main) {
- foreach ($main as $ind => $my) {
- if ($ind !== "ownUser_facility") {
- $user_array[$ind] = $my;
- }
- if ($ind == "id") {
- $this -> session -> set_userdata('api_id', $my);
- } else if ($ind == "ownUser_facility") {
- foreach ($my as $facility) {
- $facility_array[] = $facility['facility_id'];
- }
- $this -> db -> query("DELETE FROM user_facilities WHERE user_id='" . $main['id'] . "'");
- $this -> db -> insert("user_facilities", array("user_id" => $main['id'], "facility" => json_encode($facility_array)));
- }
- }
- }
- $this -> session -> set_userdata('api_user', $username);
- $this -> session -> set_userdata('api_pass', $password);
- } else {
- //Set User Sessions
- $this -> session -> set_userdata('api_id', $main_array['id']);
- $this -> session -> set_userdata('api_user', $main_array['name']);
-
- $id = $this -> session -> userdata('api_id');
-
- //Set User Facilities
- $facility_array = json_decode($main_array['ownUser_facility'], TRUE);
- //Remove User Facilities
- $sql = "DELETE FROM user_facilities WHERE user_id='$id'";
- $this -> db -> query($sql);
- //Remove Sync User
- $sql = "DELETE FROM sync_user WHERE id = '$id' OR username = '".$main_array['username']."'";
- $this -> db -> query($sql);
-
- $facility_data = array(
- "user_id" => $id,
- "facility" => json_encode(array($facility_array))
- );
- $this -> db -> insert("user_facilities",$facility_data);
-
- //Set Data_Array
- unset($main_array['ownUser_facility']);
- $user_array = $main_array;
- }
-
- $this -> db -> insert("sync_user", $user_array);
- $user_id = $this -> session -> userdata("user_id");
- $api_id = $this -> session -> userdata("api_id");
- $new_array = array('map' => $api_id);
- $this -> db -> where('id', $user_id);
- $this -> db -> update('users', $new_array);
- }
- redirect("order");
- }
-
- public function api_sync() {
- /*Get Drugs,facilities and Regimens from NASCOP or eSCM
- *Update Drugs,facilities and Regimens into weADT
- */
- $facility_code = $this -> session -> userdata('facility');
- $facility = Facilities::getSupplier($facility_code);
- $supplier = $facility -> supplier -> name;
- $links = array();
- $success_log = "";
- $error_log = "";
- $curl = new Curl();
- if (strtoupper($supplier) == "KENYA PHARMA") {
- $url = $this -> esm_url;
- $links['sync_drug'] = "drugs";
- $links['sync_facility'] = "facilities";
- $links['sync_regimen'] = "regimen";
- $username = $this -> session -> userdata('api_user');
- $password = $this -> session -> userdata('api_pass');
- $curl -> setBasicAuthentication($username, $password);
- $curl -> setOpt(CURLOPT_RETURNTRANSFER, TRUE);
- } else {
- $url = $this -> nascop_url;
- $links['sync_drug'] = "sync/drugs";
- $links['sync_facility'] = "sync/facilities";
- $links['sync_regimen'] = "sync/regimen";
- }
-
- foreach ($links as $table => $link) {
- $target_url = trim($url.$link);
- //print_r($target_url);
- $curl -> get($target_url);
- if ($curl -> error) {
- $curl -> error_code;
- $error_log .= "Error: " . $curl -> error_code . " ";
- } else {
- $main_array = json_decode($curl -> response, TRUE);
-
- foreach ($main_array as $key => $value) {
- unset($main_array[$key]['lmis_id']);
- # code...
- }
- /*echo "";
- print_r($main_array);
- echo " ";*/
-
-//die();
-
- $this -> db -> query("TRUNCATE $table");
-
- $this -> db -> insert_batch($table, $main_array);
- $success_log .= "Success: " . $table . " Synched ";
-
- //$this -> map_process();
+ public function verify_user_access(){
+ $has_access = FALSE;
+ $sync_facility = Sync_Facility::getId($this->facility_code, $this->facility_type);
+ $user_facilities = User_Facilities::getHydratedFacilityList($this -> user_id);
+ if(!empty($user_facilities)){
+ $facility_ids = json_decode($user_facilities['facility'], TRUE);
+ if(in_array($sync_facility['id'], $facility_ids)){
+ $has_access = TRUE;
}
}
- $this -> session -> set_flashdata('order_message', $success_log);
+ return $has_access;
}
- public function get_updates($type = 0) {
-
- if ($type != 0) {
- if ($this -> session -> userdata("update_timer") != "") {
- $to_time = strtotime(date('Y-m-d H:i:s'));
- $from_time = strtotime($this -> session -> userdata("update_timer"));
-
- if (round(abs($to_time - $from_time) / 60, 2) <= 10) {
- $this -> session -> set_userdata("update_test", false);
- echo 2;
- die();
- }
- }
- $this -> session -> set_userdata("update_timer", date('Y-m-d H:i:s'));
- }
- ini_set("max_execution_time", "1000000");
-
- $current_month_start = date('Y-m-01');
- $one_current_month_start = date('Y-m-d', strtotime($current_month_start . "-1 month"));
- $two_current_month_start = date('Y-m-d', strtotime($current_month_start . "-2 months"));
- $three_current_month_start = date('Y-m-d', strtotime($current_month_start . "-3 months"));
-
- $facility_code = $this -> session -> userdata('facility');
- $api_userID = $this -> session -> userdata('api_id');
- $facility_list = User_Facilities::getHydratedFacilityList($api_userID);
- $lists = json_decode($facility_list['facility'], TRUE);
- $facility = Facilities::getSupplier($facility_code);
- $supplier = $facility -> supplier -> name;
- $links = array();
- $curl = new Curl();
- if (strtoupper($supplier) == "KENYA PHARMA") {
- $url = $this -> esm_url;
- foreach ($lists as $facility_id) {
- if ($type == 0) {
- $links[] = "facility/" . $facility_id . "/cdrr";
- $links[] = "facility/" . $facility_id . "/maps";
- } else {
- $links[] = "facility/" . $facility_id . "/cdrr/" . $current_month_start;
- $links[] = "facility/" . $facility_id . "/maps/" . $current_month_start;
- $links[] = "facility/" . $facility_id . "/cdrr/" . $one_current_month_start;
- $links[] = "facility/" . $facility_id . "/maps/" . $one_current_month_start;
- $links[] = "facility/" . $facility_id . "/cdrr/" . $two_current_month_start;
- $links[] = "facility/" . $facility_id . "/maps/" . $two_current_month_start;
+ public function get_filter($type = "cdrr") {
+ $filter = "";
+ if($this->verify_user_access()){
+ $filter .= "Filter Period: ";
+ $filter .= "All ";
+ if ($type == "cdrr") {
+ $periods = Cdrr::getPeriods();
+ foreach ($periods as $period) {
+ $filter .= "" . date('F-Y', strtotime($period['periods'])) . " ";
}
- }
- $username = $this -> session -> userdata('api_user');
- $password = $this -> session -> userdata('api_pass');
- $curl -> setBasicAuthentication($username, $password);
- $curl -> setOpt(CURLOPT_RETURNTRANSFER, TRUE);
- } else {
- $url = $this -> nascop_url;
- if(!empty($lists))
- {
- $lists = explode(",", $lists[0]);
- foreach ($lists as $facility_id) {
- if ($type == 0) {
- $links[] = "sync/facility/" . $facility_id . "/cdrr";
- $links[] = "sync/facility/" . $facility_id . "/maps";
- } else {
- $links[] = "sync/facility/" . $facility_id . "/cdrr/" . $current_month_start;
- $links[] = "sync/facility/" . $facility_id . "/maps/" . $current_month_start;
- $links[] = "sync/facility/" . $facility_id . "/cdrr/" . $one_current_month_start;
- $links[] = "sync/facility/" . $facility_id . "/maps/" . $one_current_month_start;
- $links[] = "sync/facility/" . $facility_id . "/cdrr/" . $two_current_month_start;
- $links[] = "sync/facility/" . $facility_id . "/maps/" . $two_current_month_start;
- }
- }
- }
- }
-
- //clear orders if its a full sync
- if ($type == 0) {
- $this->clear_orders();
- }
-
- foreach ($links as $link) {
- $target_url = $url . $link;
- $curl -> get($target_url);
- if ($curl -> error) {
- $curl -> error_code;
- echo "Error: " . $curl -> error_code . " ";
- } else {
- $main_array = json_decode($curl -> response, TRUE);
- $clean_data = array();
-
- foreach ($main_array as $main) {
- if ($main['code'] == "D-CDRR" || $main['code'] == "F-CDRR_units" || $main['code'] == "F-CDRR_packs") {
- $type = "cdrr";
- } else {
- $type = "maps";
- }
- if ($type == 0) {
- if (is_array($main)) {
- if (!empty($main)) {
- $id = $this -> extract_order($type, array($main), $main['id']);
- }
- }
- } else {
- if ($main['period_begin'] == $current_month_start || $main['period_begin'] == $one_current_month_start || $main['period_begin'] == $two_current_month_start) {
- if (is_array($main)) {
- if (!empty($main)) {
- $id = $this -> extract_order($type, array($main), $main['id']);
- }
- }
- }
- }
+ } else if ($type == "maps") {
+ $periods = Maps::getPeriods();
+ foreach ($periods as $period) {
+ $filter .= "" . date('F-Y', strtotime($period['periods'])) . " ";
}
}
+ $filter .= " ";
}
- $this -> session -> set_flashdata('order_message', "Sync Complete");
-
- echo 1;
- }
-
- public function get_filter($type = "cdrr") {
- $filter = "Filter Period: ";
- $filter .= "All ";
- if ($type == "cdrr") {
- $periods = Cdrr::getPeriods();
- foreach ($periods as $period) {
- $filter .= "" . date('F-Y', strtotime($period['periods'])) . " ";
- }
- } else if ($type == "maps") {
- $periods = Maps::getPeriods();
- foreach ($periods as $period) {
- $filter .= "" . date('F-Y', strtotime($period['periods'])) . " ";
- }
- }
- $filter .= " ";
return $filter;
}
public function get_buttons($type = "cdrr") {
- $facility_code = $this -> session -> userdata("facility");
$buttons = "";
$set_type = "order/create_order/" . $type;
$satellite_type = 'btn_new_' . $type . '_satellite';
-
- $facility_type = Facilities::getType($facility_code);
- if ($facility_type == 0) {
- $buttons .= "New Satellite $type ";
- } else if ($facility_type == 1) {
- $buttons .= "New Stand-Alone $type ";
- } else if ($facility_type > 1) {
- $buttons .= "New Aggregate $type ";
- $buttons .= "New Central $type ";
- $buttons .= "New Satellite $type ";
+ if($this->verify_user_access()){
+ if ($this->facility_type == 0) {
+ $buttons .= "New Satellite $type ";
+ } else if ($this->facility_type == 1) {
+ $buttons .= "New Stand-Alone $type ";
+ } else if ($this->facility_type > 1) {
+ $buttons .= "New Aggregate $type ";
+ $buttons .= "New Central $type ";
+ $buttons .= "New Satellite $type ";
+ }
}
return $buttons;
}
- public function clear_orders(){
- $this->db->trans_start();
- $this->db->query('TRUNCATE cdrr');
- $this->db->query('TRUNCATE cdrr_item');
- $this->db->query('TRUNCATE cdrr_log');
- $this->db->query('TRUNCATE maps');
- $this->db->query('TRUNCATE maps_item');
- $this->db->query('TRUNCATE maps_log');
- $this->db->trans_complete();
- }
-
- public function get_supplier($facility_code) {
- $facility = Facilities::getSupplier($facility_code);
- $supplier = $facility -> supplier -> name;
- return strtoupper($supplier);
- }
-
public function get_orders($type = "cdrr", $period_begin = "") {
$columns = array('#', '#ID', 'Period Beginning', 'Status', 'Facility Name', 'Options');
- $facility_code = $this -> session -> userdata('facility');
- $supplier = $this -> get_supplier($facility_code);
- $facility_table = "sync_facility";
- $facility_name = "f.name";
- $conditions = "";
-
- $user_facilities = User_Facilities::getHydratedFacilityList($this -> session -> userdata("api_id"));
-
- $facilities = json_decode($user_facilities['facility'], TRUE);
- $facilities = implode(",", $facilities);
-
+ $facility_table = 'sync_facility';
+ $facility_name = 'f.name';
+ $conditions = '';
+ $facilities = '';
+ $results = array();
+ $user_facilities = User_Facilities::getHydratedFacilityList($this -> session -> userdata("user_id"));
+ if(!empty($user_facilities)){
+ $facilities = implode(',',json_decode($user_facilities['facility'], TRUE));
+ }
+
if ($period_begin != "" && $type == "cdrr") {
$conditions = "AND c.period_begin='$period_begin'";
}
@@ -390,47 +102,26 @@ public function get_orders($type = "cdrr", $period_begin = "") {
$conditions = "";
}
- if ($type == "cdrr") {
- $sql = "SELECT c.id,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_id,c.period_begin,LCASE(c.status) as status_name,$facility_name as facility_name
- FROM cdrr c
- LEFT JOIN $facility_table f ON f.id=c.facility_id
- WHERE facility_id IN($facilities)
- AND c.status NOT LIKE '%deleted%'
- $conditions
- ORDER BY c.period_begin desc";
- } else if ($type == "maps") {
- $sql = "SELECT m.id,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.period_begin,LCASE(m.status) as status_name,$facility_name as facility_name
- FROM maps m
- LEFT JOIN $facility_table f ON f.id=m.facility_id
- WHERE facility_id IN($facilities)
- AND m.status NOT LIKE '%deleted%'
- $conditions
- ORDER BY m.period_begin desc";
- } else if ($type == "aggregate") {
- $facility_type = Facilities::getType($facility_code);
- $sql = "";
- $columns = array('#', 'Facility Name', 'Period Beginning', 'Options');
-
- if ($facility_type > 1 && $supplier == "KEMSA") {
- $sql = "SELECT c.period_begin as id,sf.name as facility_name,c.period_begin,c.id as cdrr_id,m.id as maps_id,c.facility_id as facility_id,f.facilitycode as facility_code
- FROM cdrr c
- LEFT JOIN maps m ON (c.facility_id=m.facility_id) AND (c.period_begin=m.period_begin) AND (c.period_end=m.period_end)
- LEFT JOIN sync_facility sf ON sf.id=c.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- WHERE c.code = 'D-CDRR'
- AND m.code='D-MAPS'
- AND LCASE(c.status) NOT IN('prepared','review','deleted')
- AND LCASE(m.status) NOT IN('prepared','review','deleted')
- AND c.facility_id IN($facilities)
- GROUP BY c.period_begin
- ORDER BY c.period_begin desc";
- }
- }
- if ($sql != "") {
+ if($facilities){
+ if ($type == "cdrr") {
+ $sql = "SELECT c.id,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_id,c.period_begin,LCASE(c.status) as status_name,$facility_name as facility_name
+ FROM cdrr c
+ LEFT JOIN $facility_table f ON f.id=c.facility_id
+ WHERE facility_id IN($facilities)
+ AND c.status NOT LIKE '%deleted%'
+ $conditions
+ ORDER BY c.period_begin desc";
+ } else if ($type == "maps") {
+ $sql = "SELECT m.id,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.period_begin,LCASE(m.status) as status_name,$facility_name as facility_name
+ FROM maps m
+ LEFT JOIN $facility_table f ON f.id=m.facility_id
+ WHERE facility_id IN($facilities)
+ AND m.status NOT LIKE '%deleted%'
+ $conditions
+ ORDER BY m.period_begin desc";
+ }
$query = $this -> db -> query($sql);
$results = $query -> result_array();
- } else {
- $results = array();
}
if ($period_begin != "") {
@@ -493,11 +184,8 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$this -> session -> set_userdata("order_go_back", "cdrr");
$data['hide_side_menu'] = 0;
$data['options'] = "none";
- if ($order_type == 1) {//Dispensing Point
- $data['page_title'] = "Central Dispensing Point(F-CDRR)";
- $data['banner_text'] = "Central Dispensing Point(F-CDRR)";
- $facility = $this -> session -> userdata("facility");
- } else if ($order_type == 2) {//Satellite
+
+ if ($order_type == 0){ //satellite
$data['page_title'] = "Satellite Facility(F-CDRR)";
$data['banner_text'] = "Satellite Facility(F-CDRR)";
$facility = $this -> input -> post("satellite_facility", TRUE);
@@ -507,14 +195,20 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
} else {
$data['hide_generate'] = 1;
}
-
-
- } else if ($order_type == 3) {
+ }
+ else if ($order_type == 1){ //standalone
$data['page_title'] = "Stand-alone(F-CDRR)";
$data['banner_text'] = "Stand-alone(F-CDRR)";
$facility = $this -> session -> userdata("facility");
$data['stand_alone'] = 1;
- } else {//Aggregate
+ }
+ else if ($order_type == 2){ //dispensing_point
+ $data['page_title'] = "Central Dispensing Point(F-CDRR)";
+ $data['banner_text'] = "Central Dispensing Point(F-CDRR)";
+ $facility = $this -> session -> userdata("facility");
+ $order_type = 0;
+ }
+ else{ //aggregate
$data['page_title'] = "Central Aggregate(D-CDRR)";
$data['banner_text'] = "Central Aggregate(D-CDRR)";
$data['hide_generate'] = 2;
@@ -553,7 +247,6 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$and = "AND ci.resupply !='0'";
}
if ($cdrr_array['options'] == "update") {
- $supplier = Facilities::getSupplier($facility);
$data['commodities'] = Sync_Drug::getActiveList();
} else {
$sql = "SELECT sd.id,CONCAT_WS('] ',CONCAT_WS(' [',name,abbreviation),CONCAT_WS(' ',strength,formulation)) as Drug,unit as Unit_Name,packsize as Pack_Size,category_id as Category
@@ -572,9 +265,6 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$duplicate = $this -> check_duplicate($code, $period_start, $period_end, $facilities['id'], $type);
$data['commodities'] = Sync_Drug::getActiveList();
$data['duplicate'] = $duplicate;
- if ($duplicate == true) {
- //redirect("order");
- }
}
$facilities = Sync_Facility::getId($facility, $order_type);
@@ -592,15 +282,7 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$data["is_update"] = 0;
$data["is_view"] = 0;
- if ($order_type == 1) {//Central Dispensing point
- $facility_code = $this -> session -> userdata('facility');
- $facility_id = $this -> session -> userdata('facility_id');
- $supplier['supplied_by'] = Facilities::getSupplier($facility_code);
- $data['commodities'] = Drugcode::getAllObjects($supplier['supplied_by']);
-
- $data['page_title'] = "Central Dispensing Point";
- $data['banner_text'] = "Maps Form";
- } else if ($order_type == 2) {//Satellite
+ if($order_type == 0){ //satellite
$facility_code = $this -> input -> post("satellite_facility", TRUE);
$data['page_title'] = "Satellite Facility(F-MAPS)";
$data['banner_text'] = "Satellite Facility(F-MAPS)";
@@ -610,14 +292,23 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
} else {
$data['hide_generate'] = 1;
}
- } else if ($order_type == 3) {//Stand-alone Maps
+ }
+ else if($order_type == 1){ //standalone
$facility_code = $this -> session -> userdata('facility');
$facility_id = $this -> session -> userdata('facility_id');
- $supplier['supplied_by'] = Facilities::getSupplier($facility_code);
- $data['commodities'] = Drugcode::getAllObjects($supplier['supplied_by']);
+ $data['commodities'] = Sync_Drug::getActiveList();
$data['page_title'] = "Stand-Alone MAPS";
$data['banner_text'] = "Maps Form";
- } else {//Aggregated order
+ }
+ else if($order_type == 2){ //dispensing_point
+ $facility_code = $this -> session -> userdata('facility');
+ $facility_id = $this -> session -> userdata('facility_id');
+ $data['commodities'] = Sync_Drug::getActiveList();
+ $data['page_title'] = "Central Dispensing Point";
+ $data['banner_text'] = "Maps Form";
+ $order_type = 0;
+ }
+ else{ //aggregate
$facility_code = $this -> session -> userdata('facility');
$data['page_title'] = "Aggregate Maps List";
$facility = Facilities::getParent($facility_code);
@@ -635,7 +326,6 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$data['facility_id'] = $facility_id;
$facilities = Sync_Facility::getCode($facility_id, $order_type);
$facility_code = $facilities['code'];
- $data['supplier'] = $this -> get_supplier($facility_code);
$code = $fmaps_array['fmaps_array'][0]['code'];
$code = $this -> getDummyCode($code, $order_type);
//Central or Satellite or Aggregate
@@ -652,12 +342,6 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$data['map_id'] = $map_id;
$data['logs'] = Maps_Log::getMapLogs($map_id);
- /*echo "";
- print_r($data);
- echo " ";
- die();*/
-
-
if ($data['options'] == "view") {
$data['hide_save'] = 1;
$regimen_table = 'sync_regimen';
@@ -693,13 +377,7 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
}
} else {
- $data['supplier'] = $this -> get_supplier($facility_code);
- if($data['supplier']=='KEMSA'){
- $data['regimen_categories'] = Sync_Regimen_Category::getAll();
- }else if($data['supplier']=='KENYA PHARMA'){
- $data['regimen_categories'] = Sync_Regimen_Category::getAll();
- }
-
+ $data['regimen_categories'] = Sync_Regimen_Category::getAll();
$period_start = date('Y-m-01', strtotime(date('Y-m-d') . "-1 month"));
$period_end = date('Y-m-t', strtotime(date('Y-m-d') . "-1 month"));
@@ -707,9 +385,6 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
$facilities = Sync_Facility::getId($facility_code, $order_type);
$duplicate = $this -> check_duplicate($code, $period_start, $period_end, $facilities['id'], $type);
$data['duplicate'] = $duplicate;
- if ($duplicate == true) {
- //redirect("order");
- }
}
$facilities = Sync_Facility::getId($facility_code, $order_type);
$data['facility_id'] = $facilities['id'];
@@ -721,11 +396,9 @@ public function create_order($type = "cdrr", $order_type, $content_array = array
}
-
-
public function check_duplicate($code, $period_start, $period_end, $facility, $table = "cdrr") {
$response = false;
- $sql = "select * from $table where period_begin='$period_start' and period_end='$period_end' and code='$code' and facility_id='$facility' and status !='deleted'";
+ $sql = "select * from $table where period_begin='$period_start' and period_end='$period_end' and code='$code' and facility_id = '$facility' and status !='deleted'";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
if ($results) {
@@ -778,6 +451,7 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
$losses = $this -> input -> post('losses');
$adjustments = $this -> input -> post('adjustments');
+ $adjustments_neg = $this -> input -> post('adjustments_neg');
$physical_count = $this -> input -> post('physical_count');
$expiry_quantity = $this -> input -> post('expire_qty');
$expiry_date = $this -> input -> post('expire_period');
@@ -838,6 +512,7 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
$cdrr_array[$commodity_counter]['losses'] = $losses[$commodity_counter];
$cdrr_array[$commodity_counter]['adjustments'] = $adjustments[$commodity_counter];
+ $cdrr_array[$commodity_counter]['adjustments_neg'] = $adjustments_neg[$commodity_counter];
$cdrr_array[$commodity_counter]['count'] = $physical_count[$commodity_counter];
$cdrr_array[$commodity_counter]['expiry_quant'] = $expiry_quantity[$commodity_counter];
if ($expiry_date[$commodity_counter] != "-" && $expiry_date[$commodity_counter] != "" && $expiry_date[$commodity_counter] !=null && $expiry_date[$commodity_counter] != "NULL" && $expiry_date[$commodity_counter] != "1970-01-01" && $expiry_date[$commodity_counter] != "0000-00-00") {
@@ -859,10 +534,8 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
$commodity_counter++;
}
-
$main_array['ownCdrr_item'] = $cdrr_array;
//Insert Logs
-
$log_array = array();
if ($id != "") {
$status = "updated";
@@ -874,7 +547,7 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['cdrr_id'] = $id;
$logs[]=$log_array;
@@ -884,7 +557,7 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['cdrr_id'] = $id;
$main_array['ownCdrr_log'] = array($log_array);
}
@@ -894,48 +567,45 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
if ($type == "maps") {
- $save = $this -> input -> post("save_maps");
+ $save = $this->input->post("save_maps");
if ($save) {
-
- $code = $this -> input -> post("report_type");
+ $code = $this->input->post("report_type");
$code = $this -> getActualCode($code, $type);
- $reporting_period = $this -> input -> post('reporting_period');
+ $reporting_period = $this->input->post('reporting_period');
+ $period_begin =date('Y-m-01', strtotime($reporting_period));
+ $period_end = date('Y-m-t', strtotime($reporting_period));
$reporting_period = date('Y-m', strtotime($reporting_period));
- $period_begin = $this -> input -> post("start_date");
- $period_end = $this -> input -> post("end_date");
- $period_begin = $reporting_period . '-' . $period_begin;
- $period_end = $reporting_period . '-' . $period_end;
- $reports_expected = $this -> input -> post("reports_expected");
- $reports_actual = $this -> input -> post("reports_actual");
- $services = $this -> input -> post("services");
- $sponsors = $this -> input -> post("sponsor");
- $art_adult = $this -> input -> post("art_adult");
- $art_child = $this -> input -> post("art_child");
- $new_male = $this -> input -> post("new_male");
- $new_female = $this -> input -> post("new_female");
- $revisit_male = $this -> input -> post("revisit_male");
- $revisit_female = $this -> input -> post("revisit_female");
- $new_pmtct = $this -> input -> post("new_pmtct");
- $revisit_pmtct = $this -> input -> post("revisit_pmtct");
- $total_infant = $this -> input -> post("total_infant");
- $pep_adult = $this -> input -> post("pep_adult");
- $pep_child = $this -> input -> post("pep_child");
- $total_adult = $this -> input -> post("tot_cotr_adult");
- $total_child = $this -> input -> post("tot_cotr_child");
- $diflucan_adult = $this -> input -> post("diflucan_adult");
- $diflucan_child = $this -> input -> post("diflucan_child");
- $new_cm = $this -> input -> post("new_cm");
- $revisit_cm = $this -> input -> post("revisit_cm");
- $new_oc = $this -> input -> post("new_oc");
- $revisit_oc = $this -> input -> post("revisit_oc");
- $comments = $this -> input -> post("other_regimen");
+ $reports_expected = $this->input->post("reports_expected");
+ $reports_actual = $this->input->post("reports_actual");
+ $services = $this->input->post("services");
+ $sponsors = $this->input->post("sponsor");
+ $art_adult = $this->input->post("art_adult");
+ $art_child = $this->input->post("art_child");
+ $new_male = $this->input->post("new_male");
+ $new_female = $this->input->post("new_female");
+ $revisit_male = $this->input->post("revisit_male");
+ $revisit_female = $this->input->post("revisit_female");
+ $new_pmtct = $this->input->post("new_pmtct");
+ $revisit_pmtct = $this->input->post("revisit_pmtct");
+ $total_infant = $this->input->post("total_infant");
+ $pep_adult = $this->input->post("pep_adult");
+ $pep_child = $this->input->post("pep_child");
+ $total_adult = $this->input->post("tot_cotr_adult");
+ $total_child = $this->input->post("tot_cotr_child");
+ $diflucan_adult = $this->input->post("diflucan_adult");
+ $diflucan_child = $this->input->post("diflucan_child");
+ $new_cm = $this->input->post("new_cm");
+ $revisit_cm = $this->input->post("revisit_cm");
+ $new_oc = $this->input->post("new_oc");
+ $revisit_oc = $this->input->post("revisit_oc");
+ $comments = $this->input->post("other_regimen");
//trim comments tabs
$comments = preg_replace('/[ ]{2,}|[\t]/', ' ', trim($comments));
- $report_id = $this -> input -> post("report_id");
- $facility_id = $this -> input -> post("facility_id");
- $regimens = $this -> input -> post('patient_regimens');
- $patient_numbers = $this -> input -> post('patient_numbers');
+ $report_id = $this->input->post("report_id");
+ $facility_id = $this->input->post("facility_id");
+ $regimens = $this->input->post('patient_regimens');
+ $patient_numbers = $this->input->post('patient_numbers');
//insert map
$main_array['id'] = $id;
$main_array['status'] = $status;
@@ -975,7 +645,6 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
$regimen_counter = 0;
if ($regimens != null) {
-
foreach ($regimens as $regimen) {
//Check if any patient numbers have been reported for this regimen
if ($patient_numbers[$regimen_counter] > 0 && $regimens[$regimen_counter] != 0 && trim($regimens[$regimen_counter]) != '') {
@@ -990,7 +659,6 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
$regimen_counter++;
}
-
}
$main_array['ownMaps_item'] = $maps_item;
//Insert Logs
@@ -1005,17 +673,17 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['maps_id'] = $id;
- $logs[]=$log_array;
+ $logs[] = $log_array;
$main_array['ownMaps_log'] = $logs;
} else {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['maps_id'] = $id;
$main_array['ownMaps_log'] = array($log_array);
}
@@ -1023,53 +691,11 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
$main_array = array($main_array);
if ($status == "prepared") {
- //format to json
- $json_data = json_encode($main_array, JSON_PRETTY_PRINT);
-
- //get supplier
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
- //save links
- if ($supplier != "KEMSA") {
- //Go to escm
- $url = $this -> esm_url . $type;
- } else {
- //Go to nascop
- $target_url = "sync/save/nascop/" . $type;
- $url = $this -> nascop_url . $target_url;
- }
- $responses = $this -> post_order($url, $json_data,$supplier);
- $responses = json_decode($responses, TRUE);
- if (is_array($responses)) {
- if (!empty($responses)) {
- $id = $this -> extract_order($type, $responses);
- }
- }
+ $id = $this -> extract_order($type, $main_array);
$this -> session -> set_flashdata('order_message', "Your " . strtoupper($type) . " data was successfully saved !");
redirect("order");
}else if ($status != "prepared") {
- //format to json
- $json_data = json_encode($main_array, JSON_PRETTY_PRINT);
- //get supplier
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
- //save links
- if ($supplier != "KEMSA") {
- //Go to escm
- $url = $this -> esm_url . $type . "/" . $id;
- $responses = $this -> put_order($url, $json_data);
- } else {
- //Go to nascop
- $target_url = "sync/save/nascop/" . $type . "/" . $id;
- $url = $this -> nascop_url . $target_url;
- $responses = $this -> post_order($url, $json_data,$supplier);
- }
- $responses = json_decode($responses, TRUE);
- if (is_array($responses)) {
- if (!empty($responses)) {
- $id = $this -> extract_order($type, $responses, $id);
- }
- }
+ $id = $this -> extract_order($type, $main_array, $id);
$this -> session -> set_flashdata('order_message', "Your " . strtoupper($type) . " data was successfully ".$status." !");
if($status == "approved" || $status == "archived"){
@@ -1080,332 +706,130 @@ public function save($type = "cdrr", $status = "prepared", $id = "") {
}
}
- public function clean_index($type = "cdrr", $responses = array()) {
- $my_array = array();
- if ($type == "cdrr") {
- $cdrr = array();
- $cdrr_items = array();
- $cdrr_log = array();
- $temp_items = array();
- $temp_log = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownCdrr_item") {
- $cdrr_items[$index] = $main;
- } else if ($index == "ownCdrr_log") {
- $cdrr_log[$index] = $main;
- } else {
- if ($index == "id") {
- $cdrr[$index] = "";
- } else {
- $cdrr[$index] = $main;
- }
- }
- }
- }
- $my_array = $cdrr;
-
- //Loop through cdrr_item and add cdrr_id
- foreach ($cdrr_items as $index => $cdrr_item) {
- foreach ($cdrr_item as $counter => $items) {
- foreach ($items as $ind => $item) {
- if ($ind == "id") {
- $temp_items[$counter]['id'] = "";
- } else if ($ind == "cdrr_id") {
- $temp_items[$counter]['cdrr_id'] = "";
- } else {
- $temp_items[$counter][$ind] = $item;
- }
- }
- }
- }
- $my_array['ownCdrr_item'] = $temp_items;
-
- //Loop through cdrr_log and add cdrr_id
- foreach ($cdrr_log as $index => $my_log) {
- foreach ($my_log as $counter => $log) {
- foreach ($log as $ind => $lg) {
- if ($ind == "id") {
- $temp_log[$counter]['id'] = "";
- } else if ($ind == "cdrr_id") {
- $temp_log[$counter]['cdrr_id'] = "";
- } else {
- $temp_log[$counter][$ind] = $lg;
- }
- }
- }
- }
- $my_array['ownCdrr_log'] = $temp_log;
+ public function extract_order($type = "cdrr", $responses = array(), $id = "") {
+ //Setup parameters
+ $params = array(
+ 'cdrr' => array(
+ 'id_column' => 'cdrr_id',
+ 'items_table' => 'cdrr_item',
+ 'items_column' => 'ownCdrr_item',
+ 'logs_table' => 'cdrr_log',
+ 'logs_column' => 'ownCdrr_log'
+ ),
+ 'maps' => array(
+ 'id_column' => 'maps_id',
+ 'items_table' => 'maps_item',
+ 'items_column' => 'ownMaps_item',
+ 'logs_table' => 'maps_log',
+ 'logs_column' => 'ownMaps_log'
+ )
+ );
+
+ //Delete existing order
+ if ($id != "") {
+ $this -> delete_order($type, $id, 1);
+ }
- } else if ($type == "maps") {
- $map = array();
- $map_items = array();
- $map_log = array();
- $temp_items = array();
- $temp_log = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownMaps_item") {
- $map_items[$index] = $main;
- } else if ($index == "ownMaps_log") {
- $map_log[$index] = $main;
- } else {
- if ($index == "id") {
- $map[$index] = "";
- } else {
- $map[$index] = $main;
- }
- }
- }
- }
- $my_array = $map;
-
- //Loop through cdrr_item and add cdrr_id
- foreach ($map_items as $index => $map_item) {
- foreach ($map_item as $counter => $items) {
- foreach ($items as $ind => $item) {
- if ($ind == "id") {
- $temp_items[$counter]['id'] = "";
- } else if ($ind == "maps_id") {
- $temp_items[$counter]['maps_id'] = "";
- } else {
- $temp_items[$counter][$ind] = $item;
- }
+ //Save reponses
+ foreach ($responses as $response) {
+ $items = $response[$params[$type]['items_column']];
+ $logs = $response[$params[$type]['logs_column']];
+ unset($response[$params[$type]['items_column']]);
+ unset($response[$params[$type]['logs_column']]);
+
+ //Get id
+ $response['id'] = $id;
+ $this -> db -> insert($type, $response);
+ $id = $this->db->insert_id();
+
+ $response = array($params[$type]['items_column'] => $items, $params[$type]['logs_column'] => $logs);
+ foreach ($response as $index => $main) {
+ if ($index == $params[$type]['items_column']) {
+ foreach ($main as $data) {
+ $data[$params[$type]['id_column']] = $id;
+ $this -> db -> insert($params[$type]['items_table'], $data);
}
- }
- }
- $my_array['ownMaps_item'] = $temp_items;
-
- //Loop through cdrr_log and add cdrr_id
- foreach ($map_log as $index => $my_log) {
- foreach ($my_log as $counter => $log) {
- foreach ($log as $ind => $lg) {
- if ($ind == "id") {
- $temp_log[$counter]['id'] = "";
- } else if ($ind == "maps_id") {
- $temp_log[$counter]['maps_id'] = "";
- } else {
- $temp_log[$counter][$ind] = $lg;
- }
+ } else if ($index == $params[$type]['logs_column']) {
+ foreach ($main as $data) {
+ $data[$params[$type]['id_column']] = $id;
+ $this -> db -> insert($params[$type]['logs_table'], $data);
}
- }
+ }
}
- $my_array['ownMaps_log'] = $temp_log;
}
- return $my_array;
+
+ return $id;
}
- public function prepare_order($type = "cdrr", $responses = array()) {
- $my_array = array();
- if ($type == "cdrr") {
- $cdrr = array();
- $cdrr_items = array();
- $cdrr_log = array();
- $temp_items = array();
- $temp_log = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownCdrr_item") {
- $cdrr_items[$index] = $main;
- } else if ($index == "ownCdrr_log") {
- $cdrr_log[$index] = $main;
- } else {
- $cdrr[$index] = $main;
- }
- }
- }
- //Insert the cdrr and retrieve the auto_id assigned to it,this will be the cdrr_id
- $this -> db -> insert('cdrr', $cdrr);
- $cdrr_id = $this -> db -> insert_id();
-
- //Loop through cdrr_log and add cdrr_id
- foreach ($cdrr_log as $index => $log) {
- foreach ($log as $ind => $lg) {
- if ($ind == "cdrr_id") {
- $lg['cdrr_id'] = $cdrr_id;
- }
- $temp_log[] = $lg;
- }
- }
- $this -> db -> insert_batch('cdrr_log', $temp_log);
-
- //Loop through cdrr_item and add cdrr_id
- foreach ($cdrr_items as $index => $cdrr_item) {
- foreach ($cdrr_item as $counter => $items) {
- foreach ($items as $ind => $item) {
- if ($ind == "cdrr_id") {
- $temp_items[$counter]['cdrr_id'] = $cdrr_id;
- } else {
- $temp_items[$counter][$ind] = $item;
- }
- }
+ public function delete_order($type = "cdrr", $id, $mission = 0) {
+ $sql = "SELECT status FROM $type WHERE id='$id'";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ $status = $results[0]['status'];
+ if (($status != "approved" || $mission == 1)) {
+ $sql_array = array();
+ if ($type == "cdrr") {
+ $this -> session -> set_userdata("order_go_back", "cdrr");
+ $sql_array[] = "DELETE FROM cdrr where id='$id'";
+ $sql_array[] = "DELETE FROM cdrr_item where cdrr_id='$id'";
+ $sql_array[] = "DELETE FROM cdrr_log where cdrr_id='$id'";
+ } else if ($type == "maps") {
+ $this -> session -> set_userdata("order_go_back", "maps");
+ $sql_array[] = "DELETE FROM maps where id='$id'";
+ $sql_array[] = "DELETE FROM maps_item where maps_id='$id'";
+ $sql_array[] = "DELETE FROM maps_log where maps_id='$id'";
}
- }
- $this -> db -> insert_batch('cdrr_item', $temp_items);
- } else if ($type == "maps") {
- $maps = array();
- $temp_items = array();
- $temp_log = array();
- $maps_log = array();
- $maps_items = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownMaps_item") {
- $temp_items['maps_item'] = $main;
- } else if ($index == "ownMaps_log") {
- $temp_log['maps_log'] = $main;
- } else {
- $maps[$index] = $main;
- }
+ foreach ($sql_array as $sql) {
+ $query = $this -> db -> query($sql);
}
- }
- $this -> db -> insert("maps", $maps);
- $maps_id = $this -> db -> insert_id();
-
- //attach maps id to maps_log
- foreach ($temp_log as $logs) {
- foreach ($logs as $index => $log) {
- if ($index == "maps_id") {
- $log["maps_id"] = $maps_id;
- }
- $maps_log[] = $log;
+ if ($mission == 0) {
+ $this -> session -> set_flashdata("order_delete", $type . " was deleted successfully.");
}
- }
- $this -> db -> insert_batch('maps_log', $maps_log);
-
- //attach maps id to maps_item
- foreach ($temp_items as $temp_item) {
- foreach ($temp_item as $counter => $items) {
- foreach ($items as $ind => $item) {
- if ($ind == "maps_id") {
- $maps_items[$counter]['maps_id'] = $maps_id;
- } else {
- $maps_items[$counter][$ind] = $item;
- }
- }
+ } else {
+ if ($mission == 0) {
+ $this -> session -> set_flashdata("order_delete", $type . " delete failed!");
}
}
- $this -> db -> insert_batch('maps_item', $maps_items);
- }
- }
-
- public function post_order($url, $json_data, $supplier) {
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
- curl_setopt($ch, CURLOPT_POST, 1);
-
- if ($supplier != "KEMSA") {
- $username = $this -> session -> userdata('api_user');
- $password = $this -> session -> userdata('api_pass');
- curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
} else {
- curl_setopt($ch, CURLOPT_POSTFIELDS, array('json_data' => $json_data));
- }
- $json_data = curl_exec($ch);
- if (empty($json_data)) {
- echo "cURL Error: " . curl_error($ch);
+ if ($mission == 0) {
+ $this -> session -> set_flashdata("order_delete", $type . " not found!");
+ }
}
- curl_close($ch);
-
- return $json_data;
- }
-
- public function put_order($url, $json_data) {
- $username = $this -> session -> userdata('api_user');
- $password = $this -> session -> userdata('api_pass');
-
- $ch = curl_init();
- curl_setopt($ch, CURLOPT_URL, $url);
- curl_setopt($ch, CURLOPT_USERPWD, $username . ':' . $password);
- curl_setopt($ch, CURLOPT_CUSTOMREQUEST, "PUT");
- curl_setopt($ch, CURLOPT_POSTFIELDS, $json_data);
- curl_setopt($ch, CURLOPT_RETURNTRANSFER, TRUE);
- curl_setopt($ch, CURLOPT_HTTPHEADER, array('Content-Type: application/json', 'Content-Length: ' . strlen($json_data)));
-
- $json_data = curl_exec($ch);
- if (empty($json_data)) {
- echo "cURL Error: " . curl_error($ch);
+ if ($mission == 0) {
+ redirect("order");
}
- curl_close($ch);
- return $json_data;
}
- public function extract_order($type = "cdrr", $responses = array(), $id = "") {
- if ($id != "") {
- $this -> delete_order($type, $id, 1);
- }
- if ($type == "cdrr") {
- $cdrr = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownCdrr_item") {
- $this -> db -> insert_batch("cdrr_item", $main);
- } else if ($index == "ownCdrr_log") {
- $this -> db -> insert_batch("cdrr_log", $main);
- } else {
- $cdrr[$index] = $main;
- }
- }
- }
- $this -> db -> insert("cdrr", $cdrr);
-
- } else if ($type == "maps") {
- $maps = array();
- foreach ($responses as $response) {
- foreach ($response as $index => $main) {
- if ($index == "ownMaps_item") {
- $this -> db -> insert_batch("maps_item", $main);
- } else if ($index == "ownMaps_log") {
- $this -> db -> insert_batch("maps_log", $main);
- } else {
- $maps[$index] = $main;
- }
- }
- }
- $this -> db -> insert("maps", $maps);
- }
- $my_id = $this -> db -> insert_id();
- return $my_id;
- }
-
- public function view_order($type = "cdrr", $id) {
+ public function view_order($type = "cdrr", $id) {
if ($type == "cdrr") {
$cdrr_array = array();
$sql = "SELECT c.*,ci.*,f.*,co.county as county_name,d.name as district_name,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_label,c.status as status_name,sf.name as facility_name,ci.id as item_id,sf.code as facility_code
FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- LEFT JOIN sync_facility sf ON sf.id=c.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- LEFT JOIN counties co ON co.id=f.county
- LEFT JOIN district d ON d.id=f.district
- WHERE c.id='$id'";
+ LEFT JOIN cdrr_item ci ON ci.cdrr_id = c.id
+ LEFT JOIN sync_facility sf ON sf.id = c.facility_id
+ LEFT JOIN facilities f ON f.facilitycode = sf.code
+ LEFT JOIN counties co ON co.id = f.county
+ LEFT JOIN district d ON d.id = f.district
+ WHERE c.id = '$id'";
$query = $this -> db -> query($sql);
$cdrr_array = $query -> result_array();
$data['cdrr_array'] = $cdrr_array;
$data['options'] = "view";
- //echo ""; print_r($cdrr_array); die;
if ($cdrr_array[0]['code'] == "D-CDRR") {
- $code = 0;
+ $code = 3;
} else if ($cdrr_array[0]['code'] == "F-CDRR_units") {
- $facility_code = $this -> session -> userdata("facility");
- if ($cdrr_array[0]['facility_code'] == $facility_code) {
- $code = 1;
- } else {
+ if ($this->facility_type > 0) {
$code = 2;
+ } else {
+ $code = 0;
}
} else if ($cdrr_array[0]['code'] == "F-CDRR_packs") {
- $code = 3;
+ $code = 1;
}
$this -> create_order($type, $code, $data);
} else if ($type == "maps") {//
- $facility_code = $this -> session -> userdata('facility');
- $facility = Facilities::getSupplier($facility_code);
- $supplier = $facility -> supplier -> name;
$facility_table = 'sync_facility';
$fmaps_array = array();
$sql = "SELECT m.*,mi.*,ml.*,f.*,co.county as county_name,d.name as district_name,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.status as status_name,sf.name as facility_name,m.id as map_id,sf.code as facility_code
@@ -1422,17 +846,15 @@ public function view_order($type = "cdrr", $id) {
$data['fmaps_array'] = $fmaps_array;
$data['options'] = "view";
if ($fmaps_array[0]['code'] == "D-MAPS") {
- $code = 0;
+ $code = 3;
} else if ($fmaps_array[0]['code'] == "F-MAPS") {
- $facility_code = $this -> session -> userdata("facility");
- $facility_type = Facilities::getType($facility_code);
-
+ $facility_type = Facilities::getType($this->facility_code);
if ($facility_type == 1) {
- $code = 3;
+ $code = 1;
} else if ($facility_type == 0) {
- $code = 2;
+ $code = 0;
} else {
- $code = 1;
+ $code = 2;
}
}
$this -> create_order($type, $code, $data);
@@ -1449,22 +871,22 @@ public function update_order($type = "cdrr", $id) {
LEFT JOIN facilities f ON f.facilitycode=sf.code
LEFT JOIN counties co ON co.id=f.county
LEFT JOIN district d ON d.id=f.district
- WHERE c.id='$id'";
+ WHERE c.id = '$id'";
$query = $this -> db -> query($sql);
$cdrr_array = $query -> result_array();
$data['cdrr_array'] = $cdrr_array;
$data['options'] = "update";
if ($cdrr_array[0]['code'] == "D-CDRR") {
- $code = 0;
+ $code = 3;
} else if ($cdrr_array[0]['code'] == "F-CDRR_units") {
$facility_code = $this -> session -> userdata("facility");
- if ($cdrr_array[0]['facility_code'] == $facility_code) {
- $code = 1;
- } else {
+ if ($this->facility_type > 0) {
$code = 2;
+ } else {
+ $code = 0;
}
} else if ($cdrr_array[0]['code'] == "F-CDRR_packs") {
- $code = 3;
+ $code = 1;
}
$this -> create_order($type, $code, $data);
} else if ($type == "maps") {
@@ -1483,17 +905,16 @@ public function update_order($type = "cdrr", $id) {
$data['fmaps_array'] = $fmaps_array;
$data['options'] = "update";
if ($fmaps_array[0]['code'] == "D-MAPS") {
- $code = 0;
+ $code = 3;
} else if ($fmaps_array[0]['code'] == "F-MAPS") {
$facility_code = $this -> session -> userdata("facility");
$facility_type = Facilities::getType($facility_code);
-
if ($facility_type == 1) {
- $code = 3;
+ $code = 1;
} else if ($facility_type == 0) {
- $code = 2;
+ $code = 0;
} else {
- $code = 1;
+ $code = 2;
}
}
$this -> create_order($type, $code, $data);
@@ -1506,8 +927,8 @@ public function read_order($type = "cdrr", $id) {
$status='deleted';
$log_array=array();
if ($type == "cdrr") {
- $results= Cdrr::getCdrr($id);
- $main_array=$results[0];
+ $results = Cdrr::getCdrr($id);
+ $main_array = $results[0];
$main_array["ownCdrr_item"] = Cdrr_Item::getItems($id);
$logs = Cdrr_Log::getHydratedLogs($id);
@@ -1515,16 +936,16 @@ public function read_order($type = "cdrr", $id) {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['cdrr_id'] = $id;
- $logs[]=$log_array;
+ $logs[] = $log_array;
$main_array['ownCdrr_log'] = $logs;
} else if ($type == "maps") {
$results = Maps::getMap($id);
- $main_array=$results[0];
+ $main_array = $results[0];
$main_array["ownMaps_item"] = Maps_Item::getItems($id);
$logs = Maps_Log::getHydratedLogs($id);
@@ -1532,168 +953,466 @@ public function read_order($type = "cdrr", $id) {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['maps_id'] = $id;
- $logs[]=$log_array;
+ $logs[] = $log_array;
$main_array['ownMaps_log'] = $logs;
}
- $main_array['status']=$status;
+ $main_array['status'] = $status;
$main_array = array($main_array);
- //format to json
- $json_data = json_encode($main_array, JSON_PRETTY_PRINT);
- //get supplier
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
- //save links
- if ($supplier != "KEMSA") {
- //Go to escm
- $url = $this -> esm_url . $type . "/" . $id;
- $responses = $this -> put_order($url, $json_data);
- } else {
- //Go to nascop
- $target_url = "sync/save/nascop/" . $type . "/" . $id;
- $url = $this -> nascop_url . $target_url;
- $responses = $this -> post_order($url, $json_data,$supplier);
- }
- $responses = json_decode($responses, TRUE);
- if (is_array($responses)) {
- if (!empty($responses)) {
- $id = $this -> extract_order($type, $responses, $id);
- $this -> session -> set_flashdata('order_delete', "Your " . strtoupper($type) . " data was successfully ".$status." !");
- }else{
- $this -> session -> set_flashdata('order_delete', "Your " . strtoupper($type) . " data was empty cannot be ".$status." !");
- }
- }else{
- $this -> session -> set_flashdata('order_delete', "Your ".strtoupper($type)." cannot be deleted!");
- }
+ $id = $this -> extract_order($type, $main_array, $id);
+ $this -> session -> set_flashdata('order_delete', "Your " . strtoupper($type) . " data was successfully ".$status." !");
+
redirect("order");
}
- public function delete_order($type = "cdrr", $id, $mission = 0) {
- $sql = "SELECT status FROM $type WHERE id='$id'";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $status = $results[0]['status'];
- if (($status != "approved" || $mission == 1)) {
- $sql_array = array();
- if ($type == "cdrr") {
- $this -> session -> set_userdata("order_go_back", "cdrr");
- $sql_array[] = "DELETE FROM cdrr where id='$id'";
- $sql_array[] = "DELETE FROM cdrr_item where cdrr_id='$id'";
- $sql_array[] = "DELETE FROM cdrr_log where cdrr_id='$id'";
- } else if ($type == "maps") {
- $this -> session -> set_userdata("order_go_back", "maps");
- $sql_array[] = "DELETE FROM maps where id='$id'";
- $sql_array[] = "DELETE FROM maps_item where maps_id='$id'";
- $sql_array[] = "DELETE FROM maps_log where maps_id='$id'";
- }
- foreach ($sql_array as $sql) {
- $query = $this -> db -> query($sql);
+ public function download_order($type = "cdrr", $id) {
+ $this -> load -> library('PHPExcel');
+ if ($type == "cdrr") {
+ $cdrr_id = $id;
+ $cdrr_array = array();
+ $dir = "Export";
+ $drug_name = "CONCAT_WS('] ',CONCAT_WS(' [',sd.name,sd.abbreviation),CONCAT_WS(' ',sd.strength,sd.formulation)) as drug_map";
+
+ $sql = "SELECT c.*,ci.*,cl.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_label,c.status as status_name,sf.name as facility_name,$drug_name
+ FROM cdrr c
+ LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
+ LEFT JOIN cdrr_log cl ON cl.cdrr_id=c.id
+ LEFT JOIN sync_facility sf ON sf.id=c.facility_id
+ LEFT JOIN facilities f ON f.facilitycode=sf.code
+ LEFT JOIN counties co ON co.id=f.county
+ LEFT JOIN district d ON d.id=f.district
+ LEFT JOIN users u ON u.id = cl.user_id
+ LEFT JOIN access_level al ON al.id=u.Access_Level
+ LEFT JOIN sync_drug sd ON sd.id=ci.drug_id
+ LEFT JOIN drugcode dc ON dc.map=sd.id
+ WHERE c.id = '$cdrr_id'";
+ $query = $this -> db -> query($sql);
+ $cdrr_array = $query -> result_array();
+ $report_type = $cdrr_array[0]['code'];
+
+ //Load download template
+ $template = "";
+ if ($report_type == "D-CDRR") {
+ $template = "new_cdrr_aggregate.xlsx";
+ }else{
+ $template = "new_cdrr_satellite_standalone.xlsx";
+ }
+ $inputFileName = $_SERVER['DOCUMENT_ROOT'] . '/ADT/assets/' . $template;
+ $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
+ $objReader = PHPExcel_IOFactory::createReader($inputFileType);
+ $objPHPExcel = $objReader -> load($inputFileName);
+
+ /*Delete all files in export folder*/
+ if (is_dir($dir)) {
+ $files = scandir($dir);
+ foreach ($files as $object) {
+ if ($object != "." && $object != "..") {
+ unlink($dir . "/" . $object);
+ }
}
- if ($mission == 0) {
- $this -> session -> set_flashdata("order_delete", $type . " was deleted successfully.");
+ } else {
+ mkdir($dir);
+ }
+
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C4', $cdrr_array[0]['name']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C5', $cdrr_array[0]['county_name']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('E7', date('d/m/Y', strtotime($cdrr_array[0]['period_begin'])));
+
+ if ($report_type == "D-CDRR") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L4', $cdrr_array[0]['facilitycode']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L5', $cdrr_array[0]['district_name']); //Sub_county
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L7', date('d/m/Y', strtotime($cdrr_array[0]['period_end'])));
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('B73', $cdrr_array[0]['comments']);
+ $drug_start = 16;
+ $drug_end = 69;
+ }else{
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K4', $cdrr_array[0]['facilitycode']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K5', $cdrr_array[0]['district_name']); //Sub_county
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K7', date('d/m/Y', strtotime($cdrr_array[0]['period_end'])));
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('B72', $cdrr_array[0]['comments']);
+ $drug_start = 15;
+ $drug_end = 68;
+ }
+
+
+ $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
+ for ($i = $drug_start; $i <= $drug_end; $i++) {
+ $drug = $arr[$i]['B'];
+ $pack_size = $arr[$i]['C'];
+ if ($drug) {
+ $key = $this -> getMappedDrug($drug, $pack_size);
+ if ($key !== null) {
+ foreach ($cdrr_array as $cdrr_item) {
+ if ($key == $cdrr_item['drug_id']) {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['balance']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['received']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['dispensed_packs']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['losses']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['adjustments']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['adjustments_neg']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['count']);
+ if ($cdrr_array[0]['code'] == "D-CDRR") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['aggr_consumed']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['aggr_on_hand']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('O' . $i, $cdrr_item['expiry_quant']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('P' . $i, $cdrr_item['expiry_date']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Q' . $i, $cdrr_item['out_of_stock']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('R' . $i, $cdrr_item['resupply']);
+ } else {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['expiry_quant']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['expiry_date']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['out_of_stock']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, $cdrr_item['resupply']);
+ }
+ } //End of key match to cdrr_id
+ } //End of foreach
+ } //End of key
+ } //End of drug
+ } //End of for loop
+
+ if ($cdrr_array[0]['code'] == 'D-CDRR') {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D79', $cdrr_array[0]['reports_expected']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L79', $cdrr_array[0]['reports_actual']);
+
+ $logs = Cdrr_Log::getLogs($cdrr_id);
+ foreach ($logs as $log) {
+ if ($log -> description == "prepared") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C91', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C93', $log -> user -> Phone_Number);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('O91', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H93', $log -> created);
+ } else if ($log -> description == "approved") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C96', $log -> s_user -> name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C99', $log -> user -> Phone_Number);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('O96', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H99', $log -> created);
+ }
}
+
} else {
- if ($mission == 0) {
- $this -> session -> set_flashdata("order_delete", $type . " delete failed!");
+ $logs = Cdrr_Log::getLogs($cdrr_id);
+ foreach ($logs as $log) {
+ if ($log -> description == "prepared") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C86', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C88', $log -> user -> Phone_Number);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M86', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H88', $log -> created);
+ } else if ($log -> description == "approved") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C90', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C93', $log -> user -> Phone_Number);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M90', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H93', $log -> created);
+ }
}
+
}
- } else {
- if ($mission == 0) {
- $this -> session -> set_flashdata("order_delete", $type . " not found!");
+
+ //Generate file
+ ob_start();
+ $facility_name=str_replace(array("/","'")," ", $cdrr_array[0]['facility_name']);
+ $original_filename = $cdrr_array[0]['cdrr_label'] . " " . $facility_name . " " . $cdrr_array[0]['period_begin'] . " to " . $cdrr_array[0]['period_end'] . ".xlsx";
+ $filename = $dir . "/" . urldecode($original_filename);
+ $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
+ $objWriter -> save($filename);
+ $objPHPExcel -> disconnectWorksheets();
+ unset($objPHPExcel);
+ if (file_exists($filename)) {
+ $filename = str_replace("#", "%23", $filename);
+ redirect($filename);
}
- }
- if ($mission == 0) {
- redirect("order");
- }
- }
- public function import_order($type = "cdrr") {
- $ret = array();
- $this -> load -> library('PHPExcel');
- $objReader = new PHPExcel_Reader_Excel5();
- if (isset($_FILES["file"])) {
- $fileCount = count($_FILES["file"]["tmp_name"]);
- for ($i = 0; $i < $fileCount; $i++) {
- $objPHPExcel = $objReader -> load($_FILES["file"]["tmp_name"][$i]);
- $status = "prepared";
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- $highestColumm = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestColumn();
- $highestRow = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestRow();
- if ($type == "cdrr") {
- $this -> session -> set_userdata("order_go_back", "cdrr");
+ } else if ($type == "maps") {
+ $fmaps_id = $id;
+ $fmaps_array = array();
+ $dir = "Export";
- $first_row = 4;
- $facility_name = trim($arr[$first_row]['C'] . $arr[$first_row]['D'] . $arr[$first_row]['E']);
- $facility_code = trim($arr[$first_row]['G'] . $arr[$first_row]['H'] . $arr[$first_row]['I']);
+ $sql = "SELECT m.*,mi.*,ml.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.status as status_name,sf.name as facility_name,m.id as map_id
+ FROM maps m
+ LEFT JOIN maps_item mi ON mi.maps_id=m.id
+ LEFT JOIN maps_log ml ON ml.maps_id=m.id
+ LEFT JOIN sync_facility sf ON sf.id=m.facility_id
+ LEFT JOIN facilities f ON f.facilitycode=sf.code
+ LEFT JOIN counties co ON co.id=f.county
+ LEFT JOIN district d ON d.id=f.district
+ LEFT JOIN users u ON u.id=ml.user_id
+ LEFT JOIN access_level al ON al.id=u.Access_Level
+ WHERE m.id = '$fmaps_id'";
+ $query = $this -> db -> query($sql);
+ $fmaps_array = $query -> result_array();
+ $report_type = $fmaps_array[0]['code'];
- $second_row = 5;
- $province = trim($arr[$second_row]['C'] . $arr[$second_row]['D'] . $arr[$second_row]['E']);
- $district = trim($arr[$second_row]['G'] . $arr[$second_row]['H'] . $arr[$second_row]['I']);
+ //Load download template
+ $template = "";
+ if ($report_type == "D-MAPS") {
+ $template = "new_fmaps_aggregate.xlsx";
+ }else{
+ $template = "new_fmaps_satellite_standalone.xlsx";
+ }
+ $inputFileName = $_SERVER['DOCUMENT_ROOT'] . '/ADT/assets/' . $template;
+ $inputFileType = PHPExcel_IOFactory::identify($inputFileName);
+ $objReader = PHPExcel_IOFactory::createReader($inputFileType);
+ $objPHPExcel = $objReader -> load($inputFileName);
- $third_row = 7;
- $period_begin = $this -> clean_date(trim($arr[$third_row]['D'] . $arr[$third_row]['E']));
- $period_end = $this -> clean_date(trim($arr[$third_row]['G'] . $arr[$third_row]['H']));
+ /*Delete all files in export folder*/
+ if (is_dir($dir)) {
+ $files = scandir($dir);
+ foreach ($files as $object) {
+ if ($object != "." && $object != "..") {
+ unlink($dir . "/" . $object);
+ }
+ }
+ } else {
+ mkdir($dir);
+ }
- $code = "F-CDRR_units";
- $text = $arr[2]['A'];
+ //Top menu
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C4', $fmaps_array[0]['facility_name']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C5', $fmaps_array[0]['county_name']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D7', date('d/m/Y', strtotime($fmaps_array[0]['period_begin'])));
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G4', $fmaps_array[0]['facilitycode']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G5', $fmaps_array[0]['district_name']);//Sub_county
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G7', date('d/m/Y', strtotime($fmaps_array[0]['period_end'])));
- $file_type = $this -> checkFileType($code, $text);
- $facilities = Sync_Facility::getId($facility_code, 2);
- $facility_id= $facilities['id'];
- $duplicate = $this -> check_duplicate($code, $period_begin, $period_end, $facilities['id']);
+ //Regimen columns
+ $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- if ($period_begin != date('Y-m-01', strtotime(date('Y-m-d') . "-1 month")) || $period_end != date('Y-m-t', strtotime(date('Y-m-d') . "-1 month"))) {
- $ret[] = "You can only report for current month. Kindly check the period fields !-" . $_FILES["file"]["name"][$i];
- } else if ($file_type == false) {
- $ret[] = "Incorrect File Selected-" . $_FILES["file"]["name"][$i];
- } else if ($duplicate == true) {
- $ret[] = "A cdrr report already exists for this month !-" . $_FILES["file"]["name"][$i];
- } else if ($facility_id == null) {
- $ret[] = "No facility found associated with this user!
- - Make sure that you have updated your settings
- - Check that you have entered the correct facility code for the file being uploaded!";
- } else {
- $fourth_row = 9;
- $sponsor_gok = trim($arr[$fourth_row]['D']);
- $sponsor_pepfar = trim($arr[$fourth_row]['F']);
- $sponsor_msf = trim($arr[$fourth_row]['H']);
- if ($sponsor_gok) {
- $sponsors = "GOK";
- }
- if ($sponsor_pepfar) {
- $sponsors = "PEPFAR";
- }
- if ($sponsor_msf) {
- $sponsors = "MSF";
+ //First column
+ for ($i = 14; $i <= 66; $i++) {
+ if (!in_array($i, array(23,31,37,49,55,61))) {
+ $regimen_code = $arr[$i]['B'];
+ $regimen_desc = $arr[$i]['C'];
+ $key = $this -> getMappedRegimen($regimen_code, $regimen_desc);
+ if ($key !== null) {
+ foreach ($fmaps_array as $fmaps_item) {
+ if ($key == $fmaps_item['regimen_id']) {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $fmaps_item['total']);
+ }
}
+ }
+ }
+ }
- $fifth_row = 11;
- $service = array();
- $service_art = trim($arr[$fifth_row]['D']);
- $service_pmtct = trim($arr[$fifth_row]['F']);
- $service_pep = trim($arr[$fifth_row]['H']);
- if ($service_art) {
- $service[] = "ART";
- }
- if ($service_pmtct) {
- $service[] = "PMTCT";
- }
- if ($service_pep) {
- $service[] = "PEP";
+ //Second column
+ for ($i = 14; $i <= 66; $i++) {
+ if (!in_array($i, array(25,32,33,39,43,44,45,46,51,54,61,62,63,64,65,66))) {
+ $regimen_code = $arr[$i]['F'];
+ $regimen_desc = $arr[$i]['G'];
+ $key = $this -> getMappedRegimen($regimen_code, $regimen_desc);
+ if ($key !== null) {
+ foreach ($fmaps_array as $fmaps_item) {
+ if ($key == $fmaps_item['regimen_id']) {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $fmaps_item['total']);
+ }
}
+ }
+ }
+ }
- $services = implode(",", $service);
-
- $seventh_row = 92;
+ //If order has changed status, check who prepared the order
+ $logs = Maps_Log::getMapLogs($fmaps_id);
+ if ($report_type == "D-MAPS") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D69', $fmaps_array[0]['reports_expected']);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H69', $fmaps_array[0]['reports_actual']);
+ foreach ($logs as $log) {
+ if ($log -> description == "prepared") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C73', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C76', $log -> created);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C77', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C78', $log -> user -> Phone_Number);
+ } else if ($log -> description == "approved") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G73', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G76', $log -> created);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G77', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G78', $log -> user -> Phone_Number);
+ }
+ }
+ }else{
+ foreach ($logs as $log) {
+ if ($log -> description == "prepared") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C69', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C72', $log -> created);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C73', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C74', $log -> user -> Phone_Number);
+ } else if ($log -> description == "approved") {
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G69', $log -> user -> Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G72', $log -> created);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G73', $log -> user -> Access -> Level_Name);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G74', $log -> user -> Phone_Number);
+ }
+ }
+ }
- $comments = trim($arr[$seventh_row]['A']);
- $comments .= trim($arr[$seventh_row]['B']);
- $comments .= trim($arr[$seventh_row]['C']);
+ //Generate file
+ ob_start();
+ $facility_name=str_replace(array("/","'")," ", $fmaps_array[0]['facility_name']);
+ $original_filename = $fmaps_array[0]['maps_id'] . " " . $facility_name . " " . $fmaps_array[0]['period_begin'] . " to " . $fmaps_array[0]['period_end'] . ".xlsx";
+ $original_filename = str_replace('/','-', $original_filename);
+ $filename = $dir . "/" . urldecode($original_filename);
+ $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
+ $objWriter -> save($filename);
+ $objPHPExcel -> disconnectWorksheets();
+ unset($objPHPExcel);
+ if (file_exists($filename)) {
+ $filename = str_replace("#", "%23", $filename);
+ redirect($filename);
+ }
+ }
+ }
+
+ public function clean_date($base_date) {
+ $formatted_date = '';
+ if($base_date){
+ //Split date elements
+ $pos = strpos($base_date, '-');
+ if ($pos !== FALSE) {
+ $date_array = explode('-', $base_date);
+ $year = '20'.$date_array[2];
+
+ }else{
+ $date_array = explode('/', $base_date);
+ $year = @$date_array[2];
+ }
+
+ $day = $date_array[1];
+ $month = $date_array[0];
+
+ //Create and format date
+ $date = new DateTime();
+ $date->setDate($year, $month, $day);
+ $formatted_date = $date->format('Y-m-d');
+ }
+
+ return $formatted_date;
+ }
+
+ public function checkFileType($type, $text) {
+
+ if ($type == "D-CDRR") {
+ $match = trim("CENTRAL SITE / DISTRICT STORE CONSUMPTION DATA REPORT and REQUEST (D-CDRR) for ANTIRETROVIRAL and OPPORTUNISTIC INFECTION MEDICINES (MoH 730A)");
+ } else if ($type == "D-MAPS") {
+ $match = trim("CENTRAL SITE / DISTRICT STORE MONTHLY ARV PATIENT SUMMARY (D-MAPS) Report (MoH 729A)");
+ } else if ($type == "F-CDRR_packs" || $type == "F-CDRR_units") {
+ $match = trim("FACILITY CONSUMPTION DATA REPORT and REQUEST (F-CDRR) for ANTIRETROVIRAL and OPPORTUNISTIC INFECTION MEDICINES (MoH 730B)");
+ } else if ($type == "F-MAPS") {
+ $match = trim("FACILITY MONTHLY ARV PATIENT SUMMARY (F-MAPS) Report (MoH 729B)");
+ }
+
+ //Test
+ if (trim($text) === $match) {
+ return true;
+ } else {
+ return false;
+ }
+ }
+
+ public function getMappedDrug($drug_name = "", $packsize = "") {
+ if ($drug_name != "") {
+ $drugs = explode(" ", trim($drug_name));
+ $drug_list = array();
+ foreach ($drugs as $drug) {
+ $drug = str_ireplace(array("(", ")"), array("", ""), $drug);
+ if ($drug != null) {
+ $sql = "SELECT sd.id
+ FROM sync_drug sd
+ WHERE (sd.name like '%$drug%'
+ OR sd.abbreviation like '%$drug%'
+ OR sd.strength = '$drug'
+ OR sd.formulation = '$drug'
+ OR sd.unit='$drug')
+ AND sd.packsize='$packsize'";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ foreach ($results as $result) {
+ $drug_list[] = $result['id'];
+ }
+ }
+ }
+ }
+ $list_array = array_count_values($drug_list);
+ if (is_array($list_array)) {
+ if (!empty($list_array)) {
+ return $key = array_search(max(array_count_values($drug_list)), array_count_values($drug_list));
+ }
+ }
+ }
+ return null;
+ }
+
+ public function getMappedRegimen($regimen_code = "", $regimen_desc = "") {
+ if ($regimen_code != "") {
+ $sql = "SELECT r.id as map
+ FROM sync_regimen r
+ WHERE(r.code='$regimen_code'
+ OR r.name='$regimen_desc')";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ return $results[0]['map'];
+ } else {
+ return null;
+ }
+ }
+ return null;
+ }
+
+ public function import_order($type = "cdrr") {
+ $ret = array();
+ $this -> load -> library('PHPExcel');
+
+ if (isset($_FILES["file"])) {
+ $fileCount = count($_FILES["file"]["tmp_name"]);
+ for ($i = 0; $i < $fileCount; $i++) {
+ $filename = $_FILES["file"]["name"][$i];
+ $inputFileType = PHPExcel_IOFactory::identify($_FILES["file"]["tmp_name"][$i]);
+ $objReader = PHPExcel_IOFactory::createReader($inputFileType);
+ $objPHPExcel = $objReader -> load($_FILES["file"]["tmp_name"][$i]);
+ $status = "prepared";
+ $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
+ $highestColumm = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestColumn();
+ $highestRow = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestRow();
+ if ($type == "cdrr") {
+ $this -> session -> set_userdata("order_go_back", "cdrr");
+
+ $first_row = 4;
+ $facility_name = trim($arr[$first_row]['C'] . $arr[$first_row]['D'] . $arr[$first_row]['E']);
+ $facility_code = trim($arr[$first_row]['K'] . $arr[$first_row]['L'] . $arr[$first_row]['M']);
+
+ $second_row = 5;
+ $county = trim($arr[$second_row]['C'] . $arr[$second_row]['D'] . $arr[$second_row]['E']);
+ $sub_county = trim($arr[$second_row]['K'] . $arr[$second_row]['L'] . $arr[$second_row]['M']);
+
+ $third_row = 7;
+ $period_begin = $this -> clean_date($objPHPExcel->getActiveSheet()->getCell('E' . $third_row)->getFormattedValue());
+ $period_end = $this -> clean_date($objPHPExcel->getActiveSheet()->getCell('K' . $third_row)->getFormattedValue());
+
+ $code = "F-CDRR_units";
+ $text = $arr[2]['B'];
+
+ $file_type = $this -> checkFileType($code, $text);
+ $facilities = Sync_Facility::getId($facility_code, 0);
+
+ $facility_id= $facilities['id'];
+ $duplicate = $this -> check_duplicate($code, $period_begin, $period_end, $facilities['id']);
+
+ if ($period_begin != date('Y-m-01', strtotime(date('Y-m-d') . "-1 month")) || $period_end != date('Y-m-t', strtotime(date('Y-m-d') . "-1 month"))) {
+ $ret[] = "You can only report for current month. Kindly check the period fields !-" . $_FILES["file"]["name"][$i];
+ } else if ($file_type == false) {
+ $ret[] = "Incorrect File Selected-" . $_FILES["file"]["name"][$i];
+ } else if ($duplicate == true) {
+ $ret[] = "A cdrr report already exists for this month !-" . $_FILES["file"]["name"][$i];
+ } else if ($facility_id == null) {
+ $ret[] = "No facility found associated with this user!
+ - Make sure that you have updated your settings
+ - Check that you have entered the correct facility code for the file being uploaded!";
+ } else {
+ $seventh_row = 72;
+ $comments = trim($arr[$seventh_row]['B']);
+ $comments .= trim($arr[$seventh_row]['C']);
$comments .= trim($arr[$seventh_row]['D']);
$comments .= trim($arr[$seventh_row]['E']);
$comments .= trim($arr[$seventh_row]['F']);
@@ -1703,6 +1422,8 @@ public function import_order($type = "cdrr") {
$comments .= trim($arr[$seventh_row]['J']);
$comments .= trim($arr[$seventh_row]['K']);
$comments .= trim($arr[$seventh_row]['L']);
+ $comments .= trim($arr[$seventh_row]['M']);
+ $comments .= trim($arr[$seventh_row]['N']);
//Save Import Values
$created = date('Y-m-d H:i:s');
@@ -1718,41 +1439,43 @@ public function import_order($type = "cdrr") {
$main_array['comments'] = $comments;
$main_array['reports_expected'] = null;
$main_array['reports_actual'] = null;
- $main_array['services'] = $services;
- $main_array['sponsors'] = $sponsors;
+ $main_array['services'] = 'ART,PEP,PMTCT';
+ $main_array['sponsors'] = 'GOK';
$main_array['non_arv'] = 0;
$main_array['delivery_note'] = null;
$main_array['order_id'] = 0;
- $facilities = Sync_Facility::getId($facility_code, 2);
$main_array['facility_id'] = $facility_id;
- $sixth_row = 18;
+ $sixth_row = 15;
$cdrr_array = array();
$commodity_counter = 0;
- for ($i = $sixth_row; $sixth_row, $i <= 89; $i++) {
- if ($i != 34 || $i != 57) {
- $drug_name = trim($arr[$i]['A']);
- $pack_size = trim($arr[$i]['B']);
+ for ($i = $sixth_row; $sixth_row, $i <= 68; $i++) {
+ if ($i != 35 || $i != 54) {
+ $drug_name = trim($arr[$i]['B']);
+ $pack_size = trim($arr[$i]['C']);
$commodity = $this -> getMappedDrug($drug_name, $pack_size);
if ($commodity != null) {
$cdrr_array[$commodity_counter]['id'] = "";
- $cdrr_array[$commodity_counter]['balance'] = str_replace(',', '', trim($arr[$i]['C']));
- $cdrr_array[$commodity_counter]['received'] = str_replace(',', '', trim($arr[$i]['D']));
- $cdrr_array[$commodity_counter]['dispensed_units'] = str_replace(',', '', trim($arr[$i]['E']));
- $cdrr_array[$commodity_counter]['dispensed_packs'] = ceil(str_replace(',', '', @trim($arr[$i]['E']) / @$pack_size));
- $cdrr_array[$commodity_counter]['losses'] = str_replace(',', '', trim($arr[$i]['F']));
- $cdrr_array[$commodity_counter]['adjustments'] = str_replace(',', '', trim($arr[$i]['G']));
- $cdrr_array[$commodity_counter]['count'] = str_replace(',', '', trim($arr[$i]['H']));
- $cdrr_array[$commodity_counter]['expiry_quant'] = str_replace(',', '', trim($arr[$i]['I']));
- $expiry_date = trim($arr[$i]['J']);
- if ($expiry_date != "-" || $expiry_date != "" || $expiry_date != null) {
+ $cdrr_array[$commodity_counter]['balance'] = str_replace(',', '', trim($arr[$i]['D']));
+ $cdrr_array[$commodity_counter]['received'] = str_replace(',', '', trim($arr[$i]['E']));
+ $cdrr_array[$commodity_counter]['dispensed_units'] = str_replace(',', '', trim($arr[$i]['F']));
+ $cdrr_array[$commodity_counter]['dispensed_packs'] = ceil(str_replace(',', '', @trim($arr[$i]['F']) / @$pack_size));
+ $cdrr_array[$commodity_counter]['losses'] = str_replace(',', '', trim($arr[$i]['G']));
+ $cdrr_array[$commodity_counter]['adjustments'] = str_replace(',', '', trim($arr[$i]['H']));
+ $cdrr_array[$commodity_counter]['adjustments_neg'] = str_replace(',', '', trim($arr[$i]['I']));
+ $cdrr_array[$commodity_counter]['count'] = str_replace(',', '', trim($arr[$i]['K']));
+ $cdrr_array[$commodity_counter]['expiry_quant'] = str_replace(',', '', trim($arr[$i]['L']));
+
+ $expiry_date = $objPHPExcel->getActiveSheet()->getCell('J' . $i)->getFormattedValue();
+
+ if (!in_array($expiry_date, array("-", "", null, "1970-01-01", "0000-00-00"))) {
$cdrr_array[$commodity_counter]['expiry_date'] = $this -> clean_date($expiry_date);
} else {
- $cdrr_array[$commodity_counter]['expiry_date'] = "";
+ $cdrr_array[$commodity_counter]['expiry_date'] = null;
}
- $cdrr_array[$commodity_counter]['out_of_stock'] = str_replace(',', '', trim($arr[$i]['K']));
- $cdrr_array[$commodity_counter]['resupply'] = str_replace(',', '', trim($arr[$i]['L']));
+ $cdrr_array[$commodity_counter]['out_of_stock'] = str_replace(',', '', trim($arr[$i]['M']));
+ $cdrr_array[$commodity_counter]['resupply'] = str_replace(',', '', trim($objPHPExcel->getActiveSheet()->getCell('N' . $i)->getOldCalculatedValue()));
$cdrr_array[$commodity_counter]['aggr_consumed'] = null;
$cdrr_array[$commodity_counter]['aggr_on_hand'] = null;
$cdrr_array[$commodity_counter]['publish'] = 0;
@@ -1768,57 +1491,35 @@ public function import_order($type = "cdrr") {
$log_array['id'] = "";
$log_array['description'] = $status;
$log_array['created'] = date('Y-m-d H:i:s');
- $log_array['user_id'] = $this -> session -> userdata("api_id");
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
$log_array['cdrr_id'] = "";
$main_array['ownCdrr_log'] = array($log_array);
$main_array = array($main_array);
- //----------------------------------Post order to supplier start--------------------------------
- //format to json
- $json_data = json_encode($main_array, JSON_PRETTY_PRINT);
-
- //get supplier
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
- //save links
- if ($supplier != "KEMSA") {
- //Go to escm
- $url = $this -> esm_url . $type;
- } else {
- //Go to nascop
- $target_url = "sync/save/nascop/" . $type;
- $url = $this -> nascop_url . $target_url;
- }
- $responses = $this -> post_order($url, $json_data,$supplier);
- $responses = json_decode($responses, TRUE);
- if (is_array($responses)) {
- if (!empty($responses)) {
- $id = $this -> extract_order($type, $responses);
- }
- }
- //----------------------------------Post order to supplier start End--------------------------------
- //$this -> prepare_order($type, $main_array);
- $ret[] = "Your " . strtoupper($type) . " data was successfully saved !-" . $_FILES["file"]["name"][$i];
+
+ //Save order
+ $id = $this -> extract_order($type, $main_array);
+ $ret[] = "Your " . strtoupper($type) . " data was successfully saved !-" . $filename;
}
} else if ($type == "maps") {
$this -> session -> set_userdata("order_go_back", "fmaps");
$first_row = 4;
- $facility_name = trim($arr[$first_row]['B'] . $arr[$first_row]['C'] . $arr[$first_row]['D']);
- $facility_code = trim($arr[$first_row]['F'] . $arr[$first_row]['G'] . $arr[$first_row]['H']);
+ $facility_name = trim($arr[$first_row]['C']);
+ $facility_code = trim($arr[$first_row]['G']);
$second_row = 5;
- $province = trim($arr[$first_row]['B'] . $arr[$first_row]['C'] . $arr[$first_row]['D']);
- $district = trim($arr[$first_row]['F'] . $arr[$first_row]['G'] . $arr[$first_row]['H']);
+ $county = trim($arr[$first_row]['C']);
+ $sub_county = trim($arr[$first_row]['G']);
$third_row = 7;
- $period_begin = $this -> clean_date(trim($arr[$third_row]['D'] . $arr[$third_row]['E']));
- $period_end = $this -> clean_date(trim($arr[$third_row]['G'] . $arr[$third_row]['H']));
+ $period_begin = $this -> clean_date($objPHPExcel->getActiveSheet()->getCell('D' . $third_row)->getFormattedValue());
+ $period_end = $this -> clean_date($objPHPExcel->getActiveSheet()->getCell('G' . $third_row)->getFormattedValue());
$code = "F-MAPS";
- $text = $arr[2]['A'];
+ $text = $arr[2]['B'];
- $facilities = Sync_Facility::getId($facility_code, 2);
+ $facilities = Sync_Facility::getId($facility_code, 0);
$facility_id= $facilities['id'];
$duplicate = $this -> check_duplicate($code, $period_begin, $period_end, $facilities['id'], "maps");
@@ -1834,61 +1535,8 @@ public function import_order($type = "cdrr") {
$ret[] = "No facility found associated with this user!
- Make sure that you have updated your settings
- Check that you have entered the correct facility code for the file being uploaded!";
- } else {
- $fourth_row = 9;
- $sponsors = "";
- $sponsor_gok = trim($arr[$fourth_row]['D']);
- $sponsor_pepfar = trim($arr[$fourth_row]['F']);
- $sponsor_msf = trim($arr[$fourth_row]['H']);
- if ($sponsor_gok) {
- $sponsors = "GOK";
- }
- if ($sponsor_pepfar) {
- $sponsors = "PEPFAR";
- }
- if ($sponsor_msf) {
- $sponsors = "MSF";
- }
-
- $fifth_row = 11;
- $service = array();
- $service_art = trim($arr[$fifth_row]['D']);
- $service_pmtct = trim($arr[$fifth_row]['F']);
- $service_pep = trim($arr[$fifth_row]['H']);
- if ($service_art) {
- $service[] = "ART";
- }
- if ($service_pmtct) {
- $service[] = "PMTCT";
- }
- if ($service_pep) {
- $service[] = "PEP";
- }
-
- $services = implode(",", $service);
-
- $art_adult = $arr[14]["D"];
- $art_child = $arr[14]["F"];
- $new_male = $arr[18]["D"];
- $new_female = $arr[18]["F"];
- $revisit_male = $arr[18]["E"];
- $revisit_female = $arr[18]["G"];
- $new_pmtct = $arr[26]["H"];
- $revisit_pmtct = $arr[27]["H"];
- $total_infant = $arr[38]["H"];
- $pep_adult = $arr[107]["H"];
- $pep_child = $arr[108]["H"];
- $total_adult = $arr[164]["E"];
- $total_child = $arr[164]["G"];
- $diflucan_adult = $arr[168]["E"];
- $diflucan_child = $arr[168]["G"];
- $new_cm = $arr[174]["D"];
- $revisit_cm = $arr[174]["E"];
- $new_oc = $arr[174]["F"];
- $revisit_oc = $arr[174]["G"];
-
+ } else {
//Save Import Values
-
$created = date('Y-m-d H:i:s');
$main_array = array();
$main_array['id'] = "";
@@ -1898,826 +1546,99 @@ public function import_order($type = "cdrr") {
$main_array['code'] = $code;
$main_array['period_begin'] = $period_begin;
$main_array['period_end'] = $period_end;
- $main_array['reports_expected'] = "";
- $main_array['reports_actual'] = "";
- $main_array['services'] = $services;
- $main_array['sponsors'] = $sponsors;
- $main_array['art_adult'] = $art_adult;
- $main_array['art_child'] = $art_child;
- $main_array['new_male'] = $new_male;
- $main_array['revisit_male'] = $revisit_male;
- $main_array['new_female'] = $new_female;
- $main_array['revisit_female'] = $revisit_female;
- $main_array['new_pmtct'] = $new_pmtct;
- $main_array['revisit_pmtct'] = $revisit_pmtct;
- $main_array['total_infant'] = $total_infant;
- $main_array['pep_adult'] = $pep_adult;
- $main_array['pep_child'] = $pep_child;
- $main_array['total_adult'] = $total_adult;
- $main_array['total_child'] = $total_child;
- $main_array['diflucan_adult'] = $diflucan_adult;
- $main_array['diflucan_child'] = $diflucan_child;
- $main_array['new_cm'] = $new_cm;
- $main_array['revisit_cm'] = $revisit_cm;
- $main_array['new_oc'] = $new_oc;
- $main_array['revisit_oc'] = $revisit_oc;
- $main_array['comments'] = "";
- $main_array['report_id'] = "";
- $main_array['facility_id'] = $facility_id;
-
- //Insert Maps items
- $sixth_row = 25;
- $maps_array = array();
- $regimen_counter = 0;
- $other_regimens = "";
- for ($i = $sixth_row; $sixth_row, $i <= 120; $i++) {
- if ($i != 36 || $i != 43 || $i != 53 || $i != 68 || $i != 75 || $i != 88 || $i != 99 || $i != 105 || $i != 113) {
- if ($arr[$i]['E'] != 0 || trim($arr[$i]['A']) != "") {
- $regimen_code = $arr[$i]['A'];
- $regimen_desc = $arr[$i]['B'];
- $regimen_id = $this -> getMappedRegimen($regimen_code, $regimen_desc);
- $total = $arr[$i]['E'];
- if ($regimen_id != null && $total != null) {
- $maps_array[$regimen_counter]["id"] = "";
- $maps_array[$regimen_counter]["regimen_id"] = $regimen_id;
- $maps_array[$regimen_counter]["total"] = $total;
- $maps_array[$regimen_counter]["maps_id"] = "";
- }elseif($regimen_id == null && ($total != null || $total!=0 )){//If maps regimens not found, list them under others
- $other_regimens.=" --".$regimen_code." | ".$regimen_desc.":".$total;
- }
- $regimen_counter++;
- }
- }
- }
- $main_array['comments'] = $other_regimens;
- $main_array['ownMaps_item'] = $maps_array;
-
- $log_array = array();
- $log_array['id'] = "";
- $log_array['description'] = $status;
- $log_array['created'] = $created;
- $log_array['user_id'] = $this -> session -> userdata("api_id");
- $log_array['maps_id'] = "";
-
- $main_array['ownMaps_log'] = array($log_array);
-
- $main_array = array($main_array);
-
- //----------------------------------Post order to supplier start--------------------------------
- //format to json
- $json_data = json_encode($main_array, JSON_PRETTY_PRINT);
-
- //get supplier
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
- //save links
- if ($supplier != "KEMSA") {
- //Go to escm
- $url = $this -> esm_url . $type;
- } else {
- //Go to nascop
- $target_url = "sync/save/nascop/" . $type;
- $url = $this -> nascop_url . $target_url;
- }
- $responses = $this -> post_order($url, $json_data,$supplier);
- $responses = json_decode($responses, TRUE);
- if (is_array($responses)) {
- if (!empty($responses)) {
- $id = $this -> extract_order($type, $responses);
- }
- }
- //----------------------------------Post order to supplier start End--------------------------------
- //$this -> prepare_order($type, $main_array);
- $ret[] = "Your " . strtoupper($type) . " data was successfully saved !-" . $_FILES["file"]["name"][$i];
- }
- }
-
- }
- }
- $ret = implode(" ", $ret);
- $this -> session -> set_flashdata('order_message', $ret);
- redirect("order");
- }
-
- public function clean_date($base_date) {
- $clean_date = "";
- $date_array = explode("/", @$base_date);
- $clean_date = @$date_array[2] . "-" . @$date_array[1] . "-" . @$date_array[0];
- return $clean_date;
- }
-
- public function getMappedDrug($drug_name = "", $packsize = "") {
- if ($drug_name != "") {
- $drugs = explode(" ", trim($drug_name));
- $drug_list = array();
- foreach ($drugs as $drug) {
- $drug = str_ireplace(array("(", ")"), array("", ""), $drug);
- if ($drug != null) {
- $sql = "SELECT sd.id
- FROM sync_drug sd
- WHERE (sd.name like '%$drug%'
- OR sd.abbreviation like '%$drug%'
- OR sd.strength = '$drug'
- OR sd.formulation = '$drug'
- OR sd.unit='$drug')
- AND sd.packsize='$packsize'";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- foreach ($results as $result) {
- $drug_list[] = $result['id'];
- }
- }
- }
- }
- $list_array = array_count_values($drug_list);
- if (is_array($list_array)) {
- if (!empty($list_array)) {
- return $key = array_search(max(array_count_values($drug_list)), array_count_values($drug_list));
- }
- }
- }
- return null;
- }
-
- public function getMappedRegimen($regimen_code = "", $regimen_desc = "") {
- if ($regimen_code != "") {
- $sql = "SELECT r.map
- FROM regimen r
- WHERE(r.regimen_code='$regimen_code'
- OR r.regimen_desc='$regimen_desc')";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- return $results[0]['map'];
- } else {
- return null;
- }
- }
- return null;
- }
-
- public function getMainRegimen($regimen_code = "", $regimen_desc = "") {
- if ($regimen_code != "") {
- $sql = "SELECT sr.id
- FROM sync_regimen sr
- WHERE(sr.code='$regimen_code'
- OR sr.name='$regimen_desc')";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- return $results[0]['id'];
- } else {
- return null;
- }
- }
- return null;
- }
-
- public function download_order($type = "cdrr", $id) {
- $this -> load -> library('PHPExcel');
- if ($type == "cdrr") {
- $cdrr_id = $id;
- $cdrr_array = array();
- $dir = "Export";
- $drug_name = "CONCAT_WS('] ',CONCAT_WS(' [',sd.name,sd.abbreviation),CONCAT_WS(' ',sd.strength,sd.formulation)) as drug_map";
-
- $sql = "SELECT c.*,ci.*,cl.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_label,c.status as status_name,sf.name as facility_name,$drug_name
- FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- LEFT JOIN cdrr_log cl ON cl.cdrr_id=c.id
- LEFT JOIN sync_facility sf ON sf.id=c.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- LEFT JOIN counties co ON co.id=f.county
- LEFT JOIN district d ON d.id=f.district
- LEFT JOIN sync_user su ON su.id=cl.user_id
- LEFT JOIN users u ON su.id=u.map
- LEFT JOIN access_level al ON al.id=u.Access_Level
- LEFT JOIN sync_drug sd ON sd.id=ci.drug_id
- LEFT JOIN drugcode dc ON dc.map=sd.id
- WHERE c.id='$cdrr_id'";
- $query = $this -> db -> query($sql);
- $cdrr_array = $query -> result_array();
- $report_type = $cdrr_array[0]['code'];
- $template = "";
-
- if ($report_type == "D-CDRR") {
- $template = "cdrr_aggregate";
- } else if ($report_type == "F-CDRR_packs") {
- $template = "cdrr_stand_alone";
- } else if ($report_type == "F-CDRR_units") {
- $template = "cdrr_satellite";
- }
-
- $inputFileType = 'Excel5';
- $inputFileName = $_SERVER['DOCUMENT_ROOT'] . '/ADT/assets/' . $template . '.xls';
- $objReader = PHPExcel_IOFactory::createReader($inputFileType);
- $objPHPExcel = $objReader -> load($inputFileName);
-
- /*Delete all files in export folder*/
- if (is_dir($dir)) {
- $files = scandir($dir);
- foreach ($files as $object) {
- if ($object != "." && $object != "..") {
- unlink($dir . "/" . $object);
- }
- }
- } else {
- mkdir($dir);
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C4', $cdrr_array[0]['name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G4', $cdrr_array[0]['facilitycode']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C5', $cdrr_array[0]['county_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G5', $cdrr_array[0]['district_name']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D7', date('d/m/y', strtotime($cdrr_array[0]['period_begin'])));
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G7', date('d/m/y', strtotime($cdrr_array[0]['period_end'])));
- if ($cdrr_array[0]['sponsors'] != "") {
- if (strtoupper($cdrr_array[0]['sponsors']) == "GOK") {
- $loc = "D";
- } else if (strtoupper($cdrr_array[0]['sponsors']) == "PEPFAR") {
- $loc = "F";
- } else if (strtoupper($cdrr_array[0]['sponsors']) == "MSF") {
- $loc = "H";
- }
- $objPHPExcel -> getActiveSheet() -> SetCellValue($loc . '9', "X");
- }
-
- $services = explode(",", $cdrr_array[0]['services']);
- if ($services != "") {
- foreach ($services as $service) {
- if (strtoupper($service) == "ART") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D11', "X");
- } else if (strtoupper($service) == "PMTCT") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F11', "X");
- } else if (strtoupper($service) == "PEP") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H11', "X");
- }
- }
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('A95', $cdrr_array[0]['comments']);
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- for ($i = 18; $i <= 93; $i++) {
- $drug = $arr[$i]['A'];
- $pack_size = $arr[$i]['B'];
- if ($drug) {
- $key = $this -> getMappedDrug($drug, $pack_size);
- if ($key !== null) {
- foreach ($cdrr_array as $cdrr_item) {
- if ($key == $cdrr_item['drug_id']) {
- if ($cdrr_array[0]['code'] == "F-CDRR_packs") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $cdrr_item['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['dispensed_units']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['dispensed_packs']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['count']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['resupply']);
- } else {
- if ($cdrr_array[0]['code'] == "D-CDRR") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $cdrr_item['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['dispensed_packs']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['count']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['aggr_consumed']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['aggr_on_hand']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, $cdrr_item['resupply']);
- } else {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $cdrr_item['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['dispensed_units']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['count']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['resupply']);
- }
- }
- }
- }
- }
- }
- }
-
- if ($cdrr_array[0]['code'] == 'D-CDRR') {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E108', $cdrr_array[0]['reports_expected']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H108', $cdrr_array[0]['reports_actual']);
-
- $logs = Cdrr_Log::getLogs($cdrr_id);
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C111', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C113', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K111', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G113', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C115', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C117', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K115', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G117', $log -> created);
- }
- }
-
- } else {
- $logs = Cdrr_Log::getLogs($cdrr_id);
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C107', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C109', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K107', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G109', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C111', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C113', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K111', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G113', $log -> created);
- }
- }
-
- }
-
- //Generate file
- ob_start();
- $facility_name=str_replace(array("/","'")," ", $cdrr_array[0]['facility_name']);
- $original_filename = $cdrr_array[0]['cdrr_label'] . " " . $facility_name . " " . $cdrr_array[0]['period_begin'] . " to " . $cdrr_array[0]['period_end'] . ".xls";
- $filename = $dir . "/" . urldecode($original_filename);
- $objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);
- $objWriter -> save($filename);
- $objPHPExcel -> disconnectWorksheets();
- unset($objPHPExcel);
- if (file_exists($filename)) {
- $filename = str_replace("#", "%23", $filename);
- redirect($filename);
- }
-
- } else if ($type == "maps") {
- $fmaps_id = $id;
- $fmaps_array = array();
- $dir = "Export";
-
- $sql = "SELECT m.*,mi.*,ml.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.status as status_name,sf.name as facility_name,m.id as map_id
- FROM maps m
- LEFT JOIN maps_item mi ON mi.maps_id=m.id
- LEFT JOIN maps_log ml ON ml.maps_id=m.id
- LEFT JOIN sync_facility sf ON sf.id=m.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- LEFT JOIN counties co ON co.id=f.county
- LEFT JOIN district d ON d.id=f.district
- LEFT JOIN users u ON u.map=ml.user_id
- LEFT JOIN access_level al ON al.id=u.Access_Level
- WHERE m.id='$fmaps_id'";
- $query = $this -> db -> query($sql);
- $fmaps_array = $query -> result_array();
- $report_type = $fmaps_array[0]['code'];
- $template = "";
-
- if ($report_type == "D-MAPS") {
- $template = "fmaps_aggregate";
- } else {
- $template = "fmaps_standalone";
- }
-
- $inputFileType = 'Excel5';
- $inputFileName = $_SERVER['DOCUMENT_ROOT'] . '/ADT/assets/' . $template . '.xls';
- $objReader = PHPExcel_IOFactory::createReader($inputFileType);
- $objPHPExcel = $objReader -> load($inputFileName);
-
- /*Delete all files in export folder*/
- if (is_dir($dir)) {
- $files = scandir($dir);
- foreach ($files as $object) {
- if ($object != "." && $object != "..") {
- unlink($dir . "/" . $object);
- }
- }
- } else {
- mkdir($dir);
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B4', $fmaps_array[0]['facility_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F4', $fmaps_array[0]['facilitycode']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B5', $fmaps_array[0]['county_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F5', $fmaps_array[0]['district_name']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D7', date('d/m/y', strtotime($fmaps_array[0]['period_begin'])));
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G7', date('d/m/y', strtotime($fmaps_array[0]['period_end'])));
-
- if (strtoupper($fmaps_array[0]['sponsors']) == "GOK") {
- $loc = "D";
- } else if (strtoupper($fmaps_array[0]['sponsors']) == "PEPFAR") {
- $loc = "F";
- } else if (strtoupper($fmaps_array[0]['sponsors']) == "MSF") {
- $loc = "H";
- }
- if($loc){
- $objPHPExcel -> getActiveSheet() -> SetCellValue($loc . '9', "X");
- }
-
- $services = explode(",", $fmaps_array[0]['services']);
- foreach ($services as $service) {
- if (strtoupper($service) == "ART") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D11', "X");
- } else if (strtoupper($service) == "PMTCT") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F11', "X");
- } else if (strtoupper($service) == "PEP") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H11', "X");
- }
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D14', $fmaps_array[0]['art_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F14', $fmaps_array[0]['art_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D18', $fmaps_array[0]['new_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E18', $fmaps_array[0]['revisit_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F18', $fmaps_array[0]['new_female']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G18', $fmaps_array[0]['revisit_female']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H26', $fmaps_array[0]['new_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H27', $fmaps_array[0]['revisit_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H38', $fmaps_array[0]['total_infant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H107', $fmaps_array[0]['pep_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H108', $fmaps_array[0]['pep_child']);
-
- if ($report_type == "D-MAPS") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E124', $fmaps_array[0]['total_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G124', $fmaps_array[0]['total_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E128', $fmaps_array[0]['diflucan_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G128', $fmaps_array[0]['diflucan_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D134', $fmaps_array[0]['new_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E134', $fmaps_array[0]['revisit_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F134', $fmaps_array[0]['new_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G134', $fmaps_array[0]['revisit_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D138', $fmaps_array[0]['reports_expected']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G138', $fmaps_array[0]['reports_actual']);
- } else {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E164', $fmaps_array[0]['total_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G164', $fmaps_array[0]['total_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E168', $fmaps_array[0]['diflucan_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G168', $fmaps_array[0]['diflucan_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D174', $fmaps_array[0]['new_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E174', $fmaps_array[0]['revisit_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F174', $fmaps_array[0]['new_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G174', $fmaps_array[0]['revisit_oc']);
- }
-
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- for ($i = 25; $i <= 120; $i++) {
- if ($i == 36 || $i == 43 || $i == 53 || $i == 68 || $i == 75 || $i == 88 || $i == 99 || $i == 105 || $i == 113) {
- continue;
- }
-
- $regimen_code = $arr[$i]['A'];
- $regimen_desc = $arr[$i]['B'];
- $key = $this -> getMappedRegimen($regimen_code, $regimen_desc);
- if ($key !== null) {
- foreach ($fmaps_array as $fmaps_item) {
- if ($key == $fmaps_item['regimen_id']) {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $fmaps_item['total']);
- }
- }
- }
- }
- //If order has changed status, check who prepared the order
- $logs = Maps_Log::getMapLogs($fmaps_id);
- if ($report_type == "D-MAPS") {
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B141', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B143', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G141', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E143', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B145', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B147', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G145', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E147', $log -> created);
- }
- }
- }else{
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B177', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B179', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G177', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E179', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B181', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B183', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G181', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E183', $log -> created);
- }
- }
- }
-
- //Generate file
- ob_start();
- $facility_name=str_replace(array("/","'")," ", $fmaps_array[0]['facility_name']);
- $original_filename = $fmaps_array[0]['maps_id'] . " " . $facility_name . " " . $fmaps_array[0]['period_begin'] . " to " . $fmaps_array[0]['period_end'] . ".xlsx";
- $original_filename = str_replace('/','-', $original_filename);
- $filename = $dir . "/" . urldecode($original_filename);
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');
- $objWriter -> save($filename);
- $objPHPExcel -> disconnectWorksheets();
- unset($objPHPExcel);
- if (file_exists($filename)) {
- $filename = str_replace("#", "%23", $filename);
- redirect($filename);
- }
- }
- }
-
- public function getCommodityStatusValues($drug_id, $start_date, $end_date, $stock_type = 1) {
- $period = 180;
- $facility_code = $this -> session -> userdata("facility");
- $pack_size = Sync_Drug::getPackSize($drug_id);
- $pack_size = $pack_size['packsize'];
- $beginning_balance = 0;
- //D-CDRR
- if ($stock_type == 1) {
- //get satellites
- $central_site = Sync_Facility::getId($facility_code, 0);
- $central_site = $central_site['id'];
- $satellites = Sync_Facility::getSatellites($central_site);
-
- //get beginning balance as physical stock of last period
- $period_begin = date('Y-m-d', strtotime($start_date . "-1 month"));
- $facility_id = $central_site;
- $beginning_balance = Cdrr_Item::getLastPhysicalStock($period_begin, $drug_id, $facility_id);
-
- foreach ($satellites as $satellite) {
- $satellite_site = $satellite['id'];
- $sql = "SELECT ci.drug_id,SUM(ci.received) as received,SUM(ci.count) as phy_count
- FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- WHERE c.period_begin='$start_date'
- AND c.period_end='$end_date'
- AND ci.drug_id='$drug_id'
- AND c.facility_id='$satellite_site'
- GROUP BY ci.drug_id";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $row['reported_consumed'] = ceil(@$results[0]['received'] / @$pack_size);
- $row['reported_count'] = ceil(@$results[0]['phy_count'] / @$pack_size);
- } else {
- $start_date = date('Y-m-01', strtotime($start_date . "-1 month"));
- $end_date = date('Y-m-t', strtotime($end_date . "-1 month"));
-
- $sql = "SELECT ci.drug_id,SUM(ci.received) as received,SUM(ci.count) as phy_count
- FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- WHERE c.period_begin='$start_date'
- AND c.period_end='$end_date'
- AND ci.drug_id='$drug_id'
- AND c.facility_id='$satellite_site'
- GROUP BY ci.drug_id";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- $row['reported_consumed'] = ceil(@$results[0]['received'] / @$pack_size);
- $row['reported_count'] = ceil(@$results[0]['phy_count'] / @$pack_size);
- }
- }
- $where = "AND (dsm.source='$facility_code' or dsm.destination='$facility_code') and dsm.source!=dsm.destination";
- }
- //F-CDRR
- else if ($stock_type == 2 || $stock_type == 3) {
- //get beginning balance as physical stock of last period
- $period_begin = date('Y-m-d', strtotime($start_date . "-1 month"));
- $site = Sync_Facility::getId($facility_code, $stock_type);
- $facility_id = $site['id'];
- $beginning_balance = Cdrr_Item::getLastPhysicalStock($period_begin, $drug_id, $facility_id);
-
- $where = "AND dsm.source=dsm.destination and dsm.source='$facility_code'";
- }
-
- $sql = "SELECT trans.name, trans.id, trans.effect, dsm.in_total, dsm.out_total
- FROM (SELECT id, name, effect
- FROM transaction_type
- WHERE name LIKE '%received%'
- OR name LIKE '%adjustment%'
- OR name LIKE '%return%'
- OR name LIKE '%dispense%'
- OR name LIKE '%issue%'
- OR name LIKE '%loss%') AS trans
- LEFT JOIN (SELECT dsm.transaction_type, SUM( dsm.quantity ) AS in_total, SUM( dsm.quantity_out ) AS out_total
- FROM drug_stock_movement dsm
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN sync_drug sd ON d.map=sd.id
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND sd.id = '$drug_id'
- AND dsm.facility='$facility_code'
- $where
- GROUP BY transaction_type) AS dsm ON trans.id = dsm.transaction_type
- GROUP BY trans.name";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- $total = 0;
- if ($results) {
- foreach ($results as $result) {
- $effect = $result['effect'];
- $trans_name = str_replace(array(" ", "(-)", "(+)", "/"), array("_", "_", "plus", "_"), $result['name']);
- if ($effect == 1) {
- if ($result['in_total'] != null) {
- $total = (int)$result['in_total'];
- } else {
- $total = 0;
- }
- } else {
- if ($result['out_total'] != null) {
- $total = (int)$result['out_total'];
- } else {
- $total = 0;
- }
- }
- if ($stock_type == 1) {
- $row[$trans_name] = ceil(@$total / @$pack_size);
- } else if ($stock_type == 3) {
- $row[$trans_name] = ceil(@$total / @$pack_size);
- } else {
- $row[$trans_name] = $total;
- }
-
- }
- }
-
- $row['beginning_balance'] = $beginning_balance;
-
- if ($stock_type == 1) {
- $row["stock_out_days"] = ceil(@$row["stock_out_days"] / @$pack_size);
- $row["stock_to_expire"] = ceil(@$row["stock_to_expire"] / @$pack_size);
- $row['physical_stock'] = ceil(@$row['physical_stock'] / @$pack_size);
- $row['beginning_balance'] = ceil(@$row['beginning_balance'] / @$pack_size);
-
- $other_satellites = Sync_Facility::getOtherSatellites($central_site, $facility_code);
- $my_satellites = array();
- foreach ($other_satellites as $others) {
- $my_satellites[] = $others['id'];
- }
- $my_satellites = implode(",", $my_satellites);
-
- //get total issued to satellites and dispensed at central site
- $sql = "SELECT dispense.total_dispensed,issued.total_issued
- FROM
- (SELECT SUM(dsm.quantity_out) as total_dispensed
- FROM drug_stock_movement dsm
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN sync_drug sd ON d.map=sd.id
- LEFT JOIN transaction_type t ON t.id=dsm.transaction_type
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND sd.id = '$drug_id'
- AND dsm.source=dsm.destination
- AND dsm.source='$facility_code'
- AND t.name LIKE '%dispense%')as dispense,
- (SELECT SUM(dsm.quantity_out) as total_issued
- FROM drug_stock_movement dsm
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN sync_drug sd ON d.map=sd.id
- LEFT JOIN transaction_type t ON t.id=dsm.transaction_type
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND sd.id = '$drug_id'
- AND Source_Destination IN($my_satellites)
- $where
- AND t.name LIKE '%issue%')as issued";
-
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- $row['Dispensed_to_Patients'] = ceil(($results[0]['total_dispensed'] + $results[0]['total_issued']) / @$pack_size);
- } else if ($stock_type == 3) {
- $row['dispensed_packs'] = $row['Dispensed_to_Patients'];
- $row['Dispensed_to_Patients'] = $row['Dispensed_to_Patients'] * @$pack_size;
- }
-
- //Get End of Month Physical Stock
- $sql = "SELECT phy.id,phy.physical_stock,exp.stocks_qty,exp.early_expiry,phy.stock_out_days
- FROM
- (SELECT dsb.drug_id AS id, SUM( dsb.balance ) AS physical_stock,IF(SUM(balance)>0,'0',DATEDIFF(CURDATE(),dsb.last_update)) as stock_out_days
- FROM drug_stock_balance dsb
- LEFT JOIN drugcode d ON d.id=dsb.drug_id
- LEFT JOIN sync_drug sd ON d.map=sd.id
- WHERE dsb.balance >0
- AND sd.id = '$drug_id'
- AND dsb.stock_type = '$stock_type'
- AND DATEDIFF( dsb.expiry_date, CURDATE( ) ) >=0
- GROUP BY dsb.drug_id) as phy
- LEFT JOIN
- (SELECT dsb.drug_id AS id,SUM(dsb.balance ) AS stocks_qty, dsb.expiry_date AS early_expiry
- FROM drug_stock_balance dsb
- LEFT JOIN drugcode d ON d.id=dsb.drug_id
- LEFT JOIN sync_drug sd ON d.map=sd.id
- WHERE DATEDIFF( dsb.expiry_date, CURDATE( ) ) <='$period'
- AND DATEDIFF( dsb.expiry_date, CURDATE( ) ) >=0
- AND dsb.balance >0
- AND sd.id ='$drug_id'
- AND dsb.stock_type ='$stock_type'
- GROUP BY dsb.drug_id
- ORDER BY dsb.expiry_date) as exp ON phy.id=exp.id";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
-
- if ((int)@$results[0]['stocks_qty'] > 0) {
- $row["early_expiry"] = date('d-M-Y', strtotime($results[0]['early_expiry']));
- } else {
- $row["early_expiry"] = "-";
- }
- if (@$results[0]['stock_out_days'] == null) {
- $row["stock_out_days"] = date('d');
- } else {
- $row["stock_out_days"] = $results[0]['stock_out_days'];
- }
- $row["stock_to_expire"] = (int)@$results[0]['stocks_qty'];
- $row['drug'] = $drug_id;
-
- if (@$results[0]['physical_stock'] == null) {
- $physical_stock = 0;
- } else {
- $physical_stock = $beginning_balance + $row['Received_From'] - $row['Dispensed_to_Patients'] - $row['Losses__'] + $row['Adjustment_plus'] - $row['Adjustment__'];
-
- if ($stock_type == 1) {
- $period_begin = date('Y-m-d', strtotime($start_date . "-1 month"));
- $site = Sync_Facility::getId($facility_code, 2);
- $facility_id = $site['id'];
- $beginning_balance = Cdrr_Item::getLastPhysicalStock($period_begin, $drug_id, $facility_id);
-
- $sql = "SELECT trans.name, trans.id, trans.effect, dsm.in_total, dsm.out_total
- FROM (SELECT id, name, effect
- FROM transaction_type
- WHERE name LIKE '%received%'
- OR name LIKE '%adjustment%'
- OR name LIKE '%return%'
- OR name LIKE '%dispense%'
- OR name LIKE '%issue%'
- OR name LIKE '%loss%') AS trans
- LEFT JOIN (SELECT dsm.transaction_type, SUM( dsm.quantity ) AS in_total, SUM( dsm.quantity_out ) AS out_total
- FROM drug_stock_movement dsm
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN sync_drug sd ON d.map=sd.id
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND sd.id = '$drug_id'
- AND dsm.facility='$facility_code'
- $where
- GROUP BY transaction_type) AS dsm ON trans.id = dsm.transaction_type
- GROUP BY trans.name";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- $total = 0;
- if ($results) {
- foreach ($results as $result) {
- $effect = $result['effect'];
- $trans_name = str_replace(array(" ", "(-)", "(+)", "/"), array("_", "_", "plus", "_"), $result['name']);
- if ($effect == 1) {
- if ($result['in_total'] != null) {
- $total = (int)$result['in_total'];
- } else {
- $total = 0;
- }
- } else {
- if ($result['out_total'] != null) {
- $total = (int)$result['out_total'];
- } else {
- $total = 0;
+ $main_array['reports_expected'] = null;
+ $main_array['reports_actual'] = null;
+ $main_array['services'] = 'ART,PEP,PMTCT';
+ $main_array['sponsors'] = 'GOK';
+ $main_array['comments'] = "";
+ $main_array['report_id'] = "";
+ $main_array['facility_id'] = $facility_id;
+
+ //Insert Maps items
+ $sixth_row = 14;
+ $maps_array = array();
+ $regimen_counter = 0;
+ $other_regimens = "";
+
+ //First column
+ for ($i = $sixth_row; $sixth_row, $i <= 66; $i++) {
+ if (!in_array($i, array(23,31,37,49,55,61))) {
+ //Ensure value is > 0
+ $total = $arr[$i]['D'];
+ if ($total > 0) {
+ $regimen_code = $arr[$i]['B'];
+ $regimen_desc = $arr[$i]['C'];
+ $regimen_id = $this -> getMappedRegimen($regimen_code, $regimen_desc);
+ if ($regimen_id != null && $total != null) {
+ $maps_array[$regimen_counter]["id"] = "";
+ $maps_array[$regimen_counter]["regimen_id"] = $regimen_id;
+ $maps_array[$regimen_counter]["total"] = $total;
+ $maps_array[$regimen_counter]["maps_id"] = "";
+ }
+ $regimen_counter++;
+ }
}
}
- if ($stock_type == 1) {
- $row[$trans_name] = ceil(@$total / @$pack_size);
- } else if ($stock_type == 3) {
- $row[$trans_name] = ceil(@$total / @$pack_size);
- } else {
- $row[$trans_name] = $total;
+
+ //Second column
+ for ($i = $sixth_row; $sixth_row, $i <= 60; $i++) {
+ if (!in_array($i, array(25,32,33,39,43,44,45,46,51,54))) {
+ //Ensure value is > 0
+ $total = $arr[$i]['H'];
+ if ($total > 0) {
+ $regimen_code = $arr[$i]['F'];
+ $regimen_desc = $arr[$i]['G'];
+ $regimen_id = $this -> getMappedRegimen($regimen_code, $regimen_desc);
+ if ($regimen_id != null && $total != null) {
+ $maps_array[$regimen_counter]["id"] = "";
+ $maps_array[$regimen_counter]["regimen_id"] = $regimen_id;
+ $maps_array[$regimen_counter]["total"] = $total;
+ $maps_array[$regimen_counter]["maps_id"] = "";
+ }
+ $regimen_counter++;
+ }
+ }
}
+ $main_array['ownMaps_item'] = $maps_array;
+
+ //Insert logs
+ $log_array = array();
+ $log_array['id'] = "";
+ $log_array['description'] = $status;
+ $log_array['created'] = $created;
+ $log_array['user_id'] = $this -> session -> userdata("user_id");
+ $log_array['maps_id'] = '';
+
+ $main_array['ownMaps_log'] = array($log_array);
+ $main_array = array($main_array);
+ $id = $this -> extract_order($type, $main_array);
+ $ret[] = "Your " . strtoupper($type) . " data was successfully saved !-". $filename;
}
}
- $stock = $physical_stock;
- $physical_stock = $beginning_balance + $row['Received_From'] - $row['Dispensed_to_Patients'] - $row['Losses__'] + $row['Adjustment_plus'] - $row['Adjustment__'];
- $physical_stock = ceil(@$physical_stock / @$pack_size);
- $physical_stock = $stock + $physical_stock;
+
}
}
- $row['physical_stock'] = $physical_stock;
- $row['resupply'] = $this -> getResupply($drug_id, $start_date, $facility_id);
+ $ret = implode(" ", $ret);
+ $this -> session -> set_flashdata('order_message', $ret);
+ redirect("order");
+ }
- echo json_encode($row);
+ public function getMainRegimen($regimen_code = "", $regimen_desc = "") {
+ if ($regimen_code != "") {
+ $sql = "SELECT sr.id
+ FROM sync_regimen sr
+ WHERE(sr.code='$regimen_code'
+ OR sr.name='$regimen_desc')";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ return $results[0]['id'];
+ } else {
+ return null;
+ }
+ }
+ return null;
}
public function get_aggregated_fmaps($period_start, $period_end) {//Generate aggregated fmaps
@@ -2739,7 +1660,7 @@ public function get_aggregated_fmaps($period_start, $period_end) {//Generate agg
$maps_array = array();
$maps_items_array = array();
$maps_array['reports_expected'] = $this -> expectedReports($facility_code);
- $maps_array['reports_actual'] = 0;
+ $maps_array['reports_actual'] = $this ->actualReports($facility_code,$period_start,'maps');
$maps_array['art_adult'] = 0;
$maps_array['art_child'] = 0;
$maps_array['new_male'] = 0;
@@ -2816,33 +1737,37 @@ public function get_aggregated_fmaps($period_start, $period_end) {//Generate agg
}
-
-
public function get_fmaps_details($map_id) {
$facility_code = $this -> session -> userdata('facility');
//Get maps
$sql_maps = 'SELECT m.* FROM maps m WHERE m.id="' . $map_id . '" ORDER BY m.code DESC';
- $query = $this -> db -> query($sql_maps);
- $results = $query -> result_array();
+ $query = $this->db->query($sql_maps);
+ $results = $query->result_array();
$maps_array = array();
$maps_items_array = array();
- $maps_array['reports_expected'] = $this -> expectedReports($facility_code);
- $maps_array['reports_actual'] = 0;
$maps_array['art_adult'] = 0;
$maps_array['art_child'] = 0;
- $maps_array['new_male'] = 0;
+ $maps_array['new_male'] = 0;
$maps_array['revisit_male'] = 0;
- $maps_array['new_female'] = 0;
+ $maps_array['new_female'] = 0;
$maps_array['revisit_female'] = 0;
$maps_array['new_pmtct'] = 0;
$maps_array['revisit_pmtct'] = 0;
- $maps_array['total_infant'] = 0;
+ $maps_array['total_infant'] = 0;
$maps_array['pep_adult'] = 0;
$maps_array['pep_child'] = 0;
- $maps_array['total_adult'] = 0;
- $maps_array['total_child'] = 0;
+ // Reusable variables
+ $maps_array['total_adult'] = 0;
+ $maps_array['total_child'] = 0;
$maps_array['diflucan_adult'] = 0;
$maps_array['diflucan_child'] = 0;
+ // Used in the new template. NEW ADDED******
+ $maps_array['cm&oc_adult'] = 0;
+ $maps_array['cm&oc_child'] = 0;
+ $maps_array['new_cm&oc'] = 0;
+ $maps_array['revisit_cm&oc']= 0;
+
+ // not used in the new tenplate. Discard****
$maps_array['new_cm'] = 0;
$maps_array['revisit_cm'] = 0;
$maps_array['new_oc'] = 0;
@@ -2875,8 +1800,10 @@ public function get_fmaps_details($map_id) {
$maps_array['new_oc'] = $maps_array['new_oc'] + $value['new_oc'];
$maps_array['revisit_oc'] = $maps_array['revisit_oc'] + $value['revisit_oc'];
$maps_array['comments'] = $value['comments'];
-
}
+
+ $maps_array['reports_expected'] = $this->expectedReports($facility_code);
+ $maps_array['reports_actual'] = $this ->actualReports($facility_code,$maps_array['period_begin'],'maps');
//Get maps items
$sql_items = 'SELECT id as item_id,regimen_id,maps_id, total FROM maps_item WHERE maps_id=' . $map_id . ' GROUP BY regimen_id';
@@ -2887,61 +1814,108 @@ public function get_fmaps_details($map_id) {
$data['maps_items_array'] = $maps_items_array;
echo json_encode($data);
}
+ /******oi*/
+ public function getoiPatients() {
+ $facility_code = $this -> session -> userdata("facility");
+
+ $sql = "SELECT FLOOR(DATEDIFF(CURRENT_DATE,dob)/365) AS age
+ ,drug_prophylaxis
+ FROM patient
+ WHERE current_status=1 AND
+ (drug_prophylaxis=1 OR drug_prophylaxis=2 OR drug_prophylaxis=3 OR drug_prophylaxis=4)";
+ $query = $this ->db->query($sql);
+ $results = $query->result_array();
+ $x=0;
+ $y=0;
+ $z=0;
+ $s=0;
+ $t=0;
+ $u=0;
+ $a=0;$b=0;$c=0;$d=0;$e=0;$f=0;
+ foreach($results as $oipatient)
+ {
+ $age=$oipatient['age'];
+ $drugprophilaxis=$oipatient['drug_prophylaxis'];
+
+ //cotrimoxazole
+ if($drugprophilaxis==1 AND $age >= 15){
+ $a=$x++;
+
+ }
+ if($drugprophilaxis==1 AND $age < 15){
+ $b=$y++;
+
+ }
+
+ //Dapsone
+ if($drugprophilaxis==2 AND $age >= 15){
+ $c=$z++;
+
+ }
+ if($drugprophilaxis==2 AND $age < 15){
+ $d=$s++;
+
+ }
+ //Isoniazid
+ if($drugprophilaxis==3 AND $age >= 15){
+ $e=$t++;
+
+ }
+ if($drugprophilaxis==3 AND $age < 15){
+ $f=$u++;
+
+ }
+ }
+ //get the data and convert it to an array that corresponds to the regimens
+
+ $oi_patients[] = array('OI1A'=>$a,'OI1C'=>$b,'OI2A'=>$c,'OI2C'=>$d,'OI4A'=>$e,'OI4C'=>$f);
+ echo json_encode($oi_patients);
+ }
public function getPeriodRegimenPatients($from, $to) {
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
$regimen_column = "r.map";
-
- /*if ($supplier == "KEMSA") {
- $regimen_column = "r.id";
- }*/
$sql = "SELECT count(DISTINCT(p.id)) as patients,rc.name as regimen_category,r.id as regimen_id, r.regimen_desc,r.regimen_code,$regimen_column as regimen
FROM patient p
INNER JOIN regimen r ON r.id=p.current_regimen
INNER JOIN patient_status ps ON ps.id=p.current_status
INNER JOIN regimen_category rc ON rc.id=r.category
+ -- INNER JOIN sync_regimen_category rc ON rc.id=r.category
WHERE p.date_enrolled<='$to'
AND ps.name LIKE '%active%'
AND r.id=p.current_regimen
- AND p.facility_code='$facility_code'
+ AND p.facility_code='$this->facility_code'
GROUP BY $regimen_column
ORDER BY r.regimen_code ASC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- echo json_encode($results);
+ $query = $this ->db->query($sql);
+ $results = $query->result_array();
+ echo json_encode($results);
}
-
+
public function getNotMappedRegimenPatients($from,$to){
- $facility_code = $this -> session -> userdata("facility");
- $supplier = $this -> get_supplier($facility_code);
$regimen_column = "r.map";
$sql = "SELECT count(DISTINCT(p.id)) as patients, r.id as regimen_id, r.regimen_desc,r.regimen_code FROM regimen r
INNER JOIN patient p ON p.current_regimen = r.id
INNER JOIN patient_status ps ON ps.id=p.current_status
WHERE p.date_enrolled<='$to'
AND ps.name LIKE '%active%'
- AND p.facility_code='$facility_code'
+ AND p.facility_code='$this->facility_code'
AND r.enabled='1'
AND (r.map='' OR r.map='0')
GROUP BY r.id
- ORDER BY r.regimen_code ASC
- ";
+ ORDER BY r.regimen_code ASC";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
echo json_encode($results);
}
- public function getCentralDataMaps($start_date, $end_date,$data_type ='') {//Get data when generating reports for central site
- //$start_date='2013-01-01';
- //$end_date='2013-01-31';
+ public function getCentralDataMaps($start_date, $end_date, $data_type ='') {//Get data when generating reports for central site
$data = array();
- $facility_code = $this -> session -> userdata("facility");
+ $facility_code = $this->session->userdata("facility");
if (isset($facility_code)) {
//Defines which data to get
- $counter = $this -> input -> post('counter');
+ $counter = $this->input->post('counter');
if($data_type=='new_patient'){
- //Males,females, revisit and new
+ //Males,females, revisit and new patients
//New , only get ART
$sql_clients = 'SELECT COUNT(DISTINCT(pv.id)) as total,IF(pv.gender=1,"new_male","new_female") as gender
FROM v_patient_visits pv
@@ -3048,8 +2022,7 @@ public function getCentralDataMaps($start_date, $end_date,$data_type ='') {//Get
}else if($data_type=='new_cm_oc'){
//New and revisit CM/OM
//New
- $sql_clients = "
- SELECT IF(p.other_illnesses LIKE '%cryptococcal%','new_cm',
+ $sql_clients = "SELECT IF(p.other_illnesses LIKE '%cryptococcal%','new_cm',
IF(oi.name LIKE '%oesophageal%','new_oc','')) as OI, COUNT(DISTINCT(p.patient_number_ccc)) as total
FROM patient p
LEFT JOIN patient_visit pv ON pv.patient_id = p.patient_number_ccc
@@ -3062,9 +2035,7 @@ public function getCentralDataMaps($start_date, $end_date,$data_type ='') {//Get
$query = $this -> db -> query($sql_clients);
$results = $query -> result_array();
$data['new_cm_oc'] = $results;
- }
- else if($data_type=='revisit_cm_oc'){
-
+ }else if($data_type=='revisit_cm_oc'){
//Revisit
$sql_clients="SELECT IF(temp2.other_illnesses LIKE '%cryptococcal%','revisit_cm','revisit_oc') as OI,COUNT(temp2.ccc_number) as total
FROM (SELECT DISTINCT(pv.patient_id) as ccc_number,oi.name as opportunistic_infection FROM patient_visit pv
@@ -3081,7 +2052,6 @@ public function getCentralDataMaps($start_date, $end_date,$data_type ='') {//Get
$results = $query -> result_array();
$data['revisit_cm_oc'] = $results;
}
-
echo json_encode($data);
}
}
@@ -3100,9 +2070,7 @@ public function expectedReports($facility_code) {//Get number of total expected
}
}else{
return 0;
- }
-
-
+ }
}
public function actualReports($facility_code="13050",$period_begin="2014-09-01",$type="cdrr"){
if($facility_code!=''){
@@ -3140,17 +2108,17 @@ public function base_params($data) {
public function getActualCode($code, $type) {
if ($type == "cdrr") {
if ($code == 0) {
- $code = "D-CDRR";
- } else if ($code == 3) {
+ $code = "F-CDRR_units";
+ } else if ($code == 1) {
$code = "F-CDRR_packs";
} else {
- $code = "F-CDRR_units";
+ $code = "D-CDRR";
}
} else if ($type == "maps") {
if ($code == 0) {
- $code = "D-MAPS";
- } else {
$code = "F-MAPS";
+ } else {
+ $code = "D-MAPS";
}
}
return $code;
@@ -3158,7 +2126,7 @@ public function getActualCode($code, $type) {
public function getDummyCode($code, $order_type) {
if ($code == "DCDRR") {
- $code = 0;
+ $code = 3;
} else {
$code = $order_type;
}
@@ -3186,30 +2154,10 @@ public function map_process() {
}
}
- public function checkFileType($type, $text) {
-
- if ($type == "D-CDRR") {
- $match = trim("CENTRAL SITE / DISTRICT STORE CONSUMPTION DATA REPORT AND REQUEST (D-CDRR) FOR ANTIRETROVIRAL AND OPPORTUNISTIC INFECTION MEDICINES");
- } else if ($type == "D-MAPS") {
- $match = trim("CENTRAL SITE / DISTRICT STORE MONTHLY ARV PATIENT SUMMARY (D-MAPS) REPORT");
- } else if ($type == "F-CDRR_packs" || $type == "F-CDRR_units") {
- $match = trim("FACILITY CONSUMPTION DATA REPORT AND REQUEST (F-CDRR) FOR ANTIRETROVIRAL AND OPPORTUNISTIC INFECTION MEDICINES");
- } else if ($type == "F-MAPS") {
- $match = trim("FACILITY MONTHLY ARV PATIENT SUMMARY (F-MAPS) REPORT");
- }
-
- //Test
- if (trim($text) === $match) {
- return true;
- } else {
- return false;
- }
- }
-
public function satellites_reported() {
$start_date = date('Y-m-01', strtotime("-1 month"));
$facility_code = $this -> session -> userdata("facility");
- $central_site = Sync_Facility::getId($facility_code, 0);
+ $central_site = Sync_Facility::getId($facility_code, $this->facility_type);
$central_site = $central_site['id'];
$notification = "";
@@ -3280,477 +2228,30 @@ public function getResupply($drug_id = "", $period_begin = "", $facility_id = ""
return $amc;
}
- public function logout() {
- $this -> session -> unset_userdata("api_id");
- $this -> session -> unset_userdata("api_user");
- $this -> session -> unset_userdata("api_pass");
- redirect("order");
- }
-
- public function aggregate_download($period_begin,$facility_id,$cdrr_id,$fmaps_id,$facility_code) {
- $this -> load -> library('PHPExcel');
- $dir = "Export";
- $template = "order_merge";
- $inputFileType = 'Excel5';
- $inputFileName = $_SERVER['DOCUMENT_ROOT'] . '/ADT/assets/' . $template . '.xls';
- $objReader = PHPExcel_IOFactory::createReader($inputFileType);
- $objPHPExcel = $objReader -> load($inputFileName);
- //get satellite facilities
- $central_site=array('id'=>$facility_id);
- $satellites = Sync_Facility::getSatellitesDetails($central_site['id']);
- $details = Facilities::getCodeFacility($facility_code);
- $facility_name=$details->name;
- $district = $details -> Parent_District -> Name;
-
- //1.0 set worksheet index for cdrrs
- $objWorksheet = $objPHPExcel -> setActiveSheetIndex(0);
- $highestColumm = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestColumn();
- $highestRow = $objPHPExcel -> setActiveSheetIndex(0) -> getHighestRow();
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
-
- $drug_count = 15;
- $drug_gap = 8;
-
- //range of satellites letters
- $start_column = 'F';
- $columns = array($start_column);
- $current = $start_column;
- while ($current != $highestColumm) {
- $columns[] = ++$current;
- }
-
- //loop through the drugs
- while ($drug_count <= $highestRow) {
- $drug_name = trim($arr[$drug_count]['A']);
-
- //drug exceptions that drug_id cannot be found
- $exceptions = array('Abacavir (ABC) liquid 20mg/ml' => 20, 'Lamivudine (3TC) liquid 10mg/ml' => 26, 'Lopinavir/ritonavir (LPV/r) liquid 80/20mg/ml' => 28, 'Nevirapine (NVP) Susp 10mg/ml' => 30, 'Nevirapine (NVP) Susp 10mg/ml (For PMTCT only)' => 141, 'Zidovudine (AZT) liquid 10mg/ml' => 35, 'Cotrimoxazole Suspension 240mg/5ml' => 38, 'Diflucan Suspension 50mg/5ml' => 41, 'Amphotericin B 50mg IV Injection' => 45);
- $pack_size = (int)str_ireplace(array('Packs', 'of', 'tablets', 'Bottle', 'ml', 'capsules', 'Tablets', 'Pack', 'Vials'), array(''), trim($arr[$drug_count]['B']));
- $drug_id = $this -> getMappedDrug($drug_name, $pack_size);
-
- //get drug_id for exception drugs
- if (array_key_exists($drug_name, $exceptions)) {
- $drug_id = $exceptions[$drug_name];
- }
-
- //if drug_id is not null
- if ($drug_id != null) {
- //loop through satellite facilities
- foreach ($satellites as $index => $satellite) {
- //write satellite name and level
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '10', $satellite['name']);
- $pos = stripos($satellite['keph_level'],"Level");
- if($pos !==false){
- $level = str_ireplace(array('Level'), array(''), $satellite['keph_level']);
- }else{
- $level ='';
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '11', $level);
- $facility_id = $satellite['id'];
- //query to pull data about the drug
- $sql = "SELECT *
- FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- WHERE c.facility_id='$facility_id'
- AND c.period_begin='$period_begin'
- AND ci.drug_id='$drug_id'
- ORDER BY c.id desc
- LIMIT 1";
- $query = $this -> db -> query($sql);
- $orders = $query -> result_array();
- foreach ($orders as $order) {
- //loop through order transactions and write them to excel
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . $drug_count, $order['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 1), $order['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 2), $order['dispensed_units']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 3), $order['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 4), $order['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 5), $order['count']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 6), $order['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . ($drug_count + 7), $order['resupply']);
- }
- }
- }
- $drug_count += $drug_gap;
- }
-
- //write to file(B5-central site name,C7-period_begin,J7-period_end)
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B5', $facility_name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J5', $district);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C7', date('d/m/Y', strtotime($period_begin)));
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J7', date('t/m/Y', strtotime($period_begin)));
-
- //2.0 set worksheet index for maps
- $objWorksheet = $objPHPExcel -> setActiveSheetIndex(1);
- $highestColumm = $objPHPExcel -> setActiveSheetIndex(1) -> getHighestColumn();
- $highestRow = $objPHPExcel -> setActiveSheetIndex(1)-> getHighestRow();
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
-
- $regimen_count = 16;
-
- //range of satellites letters
- $start_column = 'E';
- $columns = array($start_column);
- $current = $start_column;
- while ($current != $highestColumm) {
- $columns[] = ++$current;
- }
-
- //loop through the regimens
- while ($regimen_count < 100) {
- if ($regimen_count != 24) {
- //remove row 24
- $regimen_code = trim($arr[$regimen_count]['A']);
- if ($regimen_code != '') {
- $regimen_id='';
- $regimen_id = Sync_Regimen::getId($regimen_code);
- if ($regimen_id != "") {
- //loop through satellite facilities
- foreach ($satellites as $index => $satellite) {
- //write satellite name and level
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '10', $satellite['name']);
- $pos = stripos($satellite['keph_level'],"Level");
- if($pos !==false){
- $level = str_ireplace(array('Level'), array(''), $satellite['keph_level']);
- }else{
- $level ='';
- }
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '11', $level);
- $facility_id = $satellite['id'];
- //query to pull data about the regimen
- $sql = "SELECT *
- FROM maps m
- LEFT JOIN maps_item mi ON mi.maps_id=m.id
- WHERE m.facility_id='$facility_id'
- AND m.period_begin='$period_begin'
- AND mi.regimen_id='$regimen_id'
- ORDER BY m.id desc
- LIMIT 1";
- $query = $this -> db -> query($sql);
- $maps = $query -> result_array();
- foreach ($maps as $map) {
- //loop through maps transactions and write them to excel
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . $regimen_count, $map['total']);
- //write other data e.g total clients on ART only
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '100', $map['art_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '101', $map['art_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '102', $map['new_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '103', $map['revisit_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '104', $map['new_female']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '105', $map['revisit_female']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '106', $map['new_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '107', $map['revisit_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '108', $map['total_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '109', $map['total_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '110', $map['diflucan_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue($columns[$index] . '111', $map['diflucan_child']);
- }
- }
- }
- }
- }
- $regimen_count++;
- }
- //set facility name on regimen sheet
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B5', $facility_name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I5', $district);
-
- //3.0 set worksheet index for D-CDRR
- $objWorksheet = $objPHPExcel -> setActiveSheetIndex(2);
- $highestColumm = $objPHPExcel -> setActiveSheetIndex(2) -> getHighestColumn();
- $highestRow = $objPHPExcel -> setActiveSheetIndex(2) -> getHighestRow();
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
-
-
- //D-CDRR
- $drug_name = "CONCAT_WS('] ',CONCAT_WS(' [',sd.name,sd.abbreviation),CONCAT_WS(' ',sd.strength,sd.formulation)) as drug_map";
-
- $sql = "SELECT c.*,ci.*,cl.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(c.code='D-CDRR',CONCAT('D-CDRR#',c.id),CONCAT('F-CDRR#',c.id)) as cdrr_label,c.status as status_name,sf.name as facility_name,$drug_name
- FROM cdrr c
- LEFT JOIN cdrr_item ci ON ci.cdrr_id=c.id
- LEFT JOIN cdrr_log cl ON cl.cdrr_id=c.id
- LEFT JOIN sync_facility sf ON sf.id=c.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- LEFT JOIN counties co ON co.id=f.county
- LEFT JOIN district d ON d.id=f.district
- LEFT JOIN sync_user su ON su.id=cl.user_id
- LEFT JOIN users u ON su.id=u.map
- LEFT JOIN access_level al ON al.id=u.Access_Level
- LEFT JOIN sync_drug sd ON sd.id=ci.drug_id
- LEFT JOIN drugcode dc ON dc.map=sd.id
- WHERE c.id='$cdrr_id'";
- $query = $this -> db -> query($sql);
- $cdrr_array = $query -> result_array();
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C4', $cdrr_array[0]['name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G4', $cdrr_array[0]['facilitycode']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C5', $cdrr_array[0]['county_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G5', $cdrr_array[0]['district_name']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D7', date('d/m/y', strtotime($cdrr_array[0]['period_begin'])));
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G7', date('d/m/y', strtotime($cdrr_array[0]['period_end'])));
- if ($cdrr_array[0]['sponsors'] != "") {
- if (strtoupper($cdrr_array[0]['sponsors']) == "GOK") {
- $loc = "D";
- } else if (strtoupper($cdrr_array[0]['sponsors']) == "PEPFAR") {
- $loc = "F";
- } else if (strtoupper($cdrr_array[0]['sponsors']) == "MSF") {
- $loc = "H";
- }
- $objPHPExcel -> getActiveSheet() -> SetCellValue($loc . '9', "X");
- }
-
- $services = explode(",", $cdrr_array[0]['services']);
- if ($services != "") {
- foreach ($services as $service) {
- if (strtoupper($service) == "ART") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D11', "X");
- } else if (strtoupper($service) == "PMTCT") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F11', "X");
- } else if (strtoupper($service) == "PEP") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H11', "X");
- }
- }
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('A95', $cdrr_array[0]['comments']);
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- for ($i = 18; $i <= 93; $i++) {
- $drug = $arr[$i]['A'];
- $pack_size = $arr[$i]['B'];
- if ($drug) {
- $key = $this -> getMappedDrug($drug, $pack_size);
- if ($key !== null) {
- foreach ($cdrr_array as $cdrr_item) {
- if ($key == $cdrr_item['drug_id']) {
- if ($cdrr_array[0]['code'] == "F-CDRR_packs") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $cdrr_item['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['dispensed_units']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['dispensed_packs']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['count']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['resupply']);
- } else {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $cdrr_item['balance']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $cdrr_item['received']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $cdrr_item['dispensed_units']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $cdrr_item['losses']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $cdrr_item['adjustments']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $cdrr_item['count']);
- if ($cdrr_array[0]['code'] == "D-CDRR") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['aggr_consumed']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['aggr_on_hand']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, $cdrr_item['resupply']);
- } else {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $cdrr_item['expiry_quant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $cdrr_item['expiry_date']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $cdrr_item['out_of_stock']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $cdrr_item['resupply']);
- }
- }
- }
- }
- }
- }
- }
-
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E108', $cdrr_array[0]['reports_expected']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H108', $cdrr_array[0]['reports_actual']);
-
- $logs = Cdrr_Log::getLogs($cdrr_id);
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C111', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C113', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K111', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G113', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C115', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C117', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K115', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G117', $log -> created);
- }
- }
-
- //4.0 set worksheet index for D-MAPS
- $objWorksheet = $objPHPExcel -> setActiveSheetIndex(3);
- $highestColumm = $objPHPExcel -> setActiveSheetIndex(3) -> getHighestColumn();
- $highestRow = $objPHPExcel -> setActiveSheetIndex(3) -> getHighestRow();
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
-
- //D-MAPS
- $sql = "SELECT m.*,mi.*,ml.*,f.*,co.county as county_name,d.name as district_name,u.*,al.level_name,IF(m.code='D-MAPS',CONCAT('D-MAPS#',m.id),CONCAT('F-MAPS#',m.id)) as maps_id,m.status as status_name,sf.name as facility_name,m.id as map_id
- FROM maps m
- LEFT JOIN maps_item mi ON mi.maps_id=m.id
- LEFT JOIN maps_log ml ON ml.maps_id=m.id
- LEFT JOIN sync_facility sf ON sf.id=m.facility_id
- LEFT JOIN facilities f ON f.facilitycode=sf.code
- LEFT JOIN counties co ON co.id=f.county
- LEFT JOIN district d ON d.id=f.district
- LEFT JOIN users u ON u.map=ml.user_id
- LEFT JOIN access_level al ON al.id=u.Access_Level
- WHERE m.id='$fmaps_id'";
- $query = $this -> db -> query($sql);
- $fmaps_array = $query -> result_array();
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B4', $fmaps_array[0]['facility_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F4', $fmaps_array[0]['facilitycode']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B5', $fmaps_array[0]['county_name']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F5', $fmaps_array[0]['district_name']);
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D7', date('d/m/y', strtotime($fmaps_array[0]['period_begin'])));
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G7', date('d/m/y', strtotime($fmaps_array[0]['period_end'])));
-
- if (strtoupper($fmaps_array[0]['sponsors']) == "GOK") {
- $loc = "D";
- } else if (strtoupper($fmaps_array[0]['sponsors']) == "PEPFAR") {
- $loc = "F";
- } else if (strtoupper($fmaps_array[0]['sponsors']) == "MSF") {
- $loc = "H";
- }
- $objPHPExcel -> getActiveSheet() -> SetCellValue($loc . '9', "X");
-
- $services = explode(",", $fmaps_array[0]['services']);
- foreach ($services as $service) {
- if (strtoupper($service) == "ART") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D11', "X");
- } else if (strtoupper($service) == "PMTCT") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F11', "X");
- } else if (strtoupper($service) == "PEP") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H11', "X");
- }
- }
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D14', $fmaps_array[0]['art_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F14', $fmaps_array[0]['art_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D18', $fmaps_array[0]['new_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E18', $fmaps_array[0]['revisit_male']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F18', $fmaps_array[0]['new_female']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G18', $fmaps_array[0]['revisit_female']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H26', $fmaps_array[0]['new_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H27', $fmaps_array[0]['revisit_pmtct']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H38', $fmaps_array[0]['total_infant']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H107', $fmaps_array[0]['pep_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H108', $fmaps_array[0]['pep_child']);
-
- if ($report_type != "D-MAPS") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E124', $fmaps_array[0]['total_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G124', $fmaps_array[0]['total_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E128', $fmaps_array[0]['diflucan_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G128', $fmaps_array[0]['diflucan_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D134', $fmaps_array[0]['new_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E134', $fmaps_array[0]['revisit_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F134', $fmaps_array[0]['new_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G134', $fmaps_array[0]['revisit_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D138', $fmaps_array[0]['reports_expected']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G138', $fmaps_array[0]['reports_actual']);
- } else {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E164', $fmaps_array[0]['total_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G164', $fmaps_array[0]['total_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E168', $fmaps_array[0]['diflucan_adult']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G168', $fmaps_array[0]['diflucan_child']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D174', $fmaps_array[0]['new_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E174', $fmaps_array[0]['revisit_cm']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F174', $fmaps_array[0]['new_oc']);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G174', $fmaps_array[0]['revisit_oc']);
- }
-
- $arr = $objPHPExcel -> getActiveSheet() -> toArray(null, true, true, true);
- for ($i = 25; $i <= 120; $i++) {
- if ($i == 36 || $i == 43 || $i == 53 || $i == 68 || $i == 75 || $i == 88 || $i == 99 || $i == 105 || $i == 113) {
- continue;
- }
-
- $regimen_code = $arr[$i]['A'];
- $regimen_desc = $arr[$i]['B'];
- $key = $this -> getMappedRegimen($regimen_code, $regimen_desc);
- if ($key !== null) {
- foreach ($fmaps_array as $fmaps_item) {
- if ($key == $fmaps_item['regimen_id']) {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $fmaps_item['total']);
- }
- }
- }
- }
- //If order has changed status, check who prepared the order
- $logs = Maps_Log::getMapLogs($fmaps_id);
- foreach ($logs as $log) {
- if ($log -> description == "prepared") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B141', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B143', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G141', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E143', $log -> created);
- } else if ($log -> description == "approved") {
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B145', $log -> s_user -> name);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B147', 'N/A');
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G145', $log -> s_user -> role);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E147', $log -> created);
- }
- }
-
-
- //Delete all files in export folder
- if (is_dir($dir)) {
- $files = scandir($dir);
- foreach ($files as $object) {
- if ($object != "." && $object != "..") {
- unlink($dir . "/" . $object);
- }
- }
- } else {
- mkdir($dir);
- }
-
- //Generate file
- ob_start();
- $file = "AGGR#" . date('Ym', strtotime($period_begin)) . ".xlsx";
- $filename = $dir . "/" . urldecode($file);
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel,'Excel2007');
- $objWriter -> save($filename);
- $objPHPExcel -> disconnectWorksheets();
- unset($objPHPExcel);
- if (file_exists($filename)) {
- $filename = str_replace("#", "%23", $filename);
- redirect($filename);
- }
- }
-
public function getItems() {
- $row=array(
- 'beginning_balance'=>0,
- 'received_from'=>0,
- 'dispensed_to_patients'=>0,
- 'losses'=>0,
- 'adjustments'=>0,
- 'physical_stock'=>0,
- 'expiry_qty'=>0,
- 'expiry_month'=>"-",
- 'stock_out'=>0,
- 'resupply'=>0
- );
-
- //set parameters
+ //Default row values
+ $row = array(
+ 'beginning_balance' => 0,
+ 'received_from' => 0,
+ 'dispensed_to_patients' => 0,
+ 'losses' => 0,
+ 'adjustments' => 0,
+ 'adjustments_neg' => 0,
+ 'physical_stock' => 0,
+ 'expiry_qty' => 0,
+ 'expiry_month' => "--",
+ 'stock_out' => 0,
+ 'resupply' => 0
+ );
+
+ //Set parameters
$param=array(
- "drug_id"=>$this->input->post("drug_id"),
- "period_begin"=>$this->input->post("period_begin"),
- "facility_id"=>$this->input->post("facility_id"),
- "code"=>$this->input->post("code"),
- "stores"=>$this->input->post("stores")
- );
+ "drug_id" => $this->input->post("drug_id"),
+ "period_begin" => $this->input->post("period_begin"),
+ "facility_id" => $this->input->post("facility_id"),
+ "code" => $this->input->post("code"),
+ "stores" => $this->input->post("stores")
+ );
$code=$param['code'];
$facility_id=$param['facility_id'];
@@ -3771,7 +2272,10 @@ public function getItems() {
$row['beginning_balance']=$this->getBeginningBalance($param);
+ $row['pack_size']=$pack_size;
+
$row=$this->getOtherTransactions($param,$row);
+
if($row['stock_out']==null){
$row['stock_out']=0;
@@ -3841,15 +2345,14 @@ public function getItems() {
$row['dispensed_to_patients']=$results[0]['total'];
}
}
- //Multiply By Packsize
- //$row['dispensed_to_patients'] = round(@$row['dispensed_to_patients']/@$pack_size);
}
}
-
+ // Changes made on DCDRR
if ($code == "D-CDRR")
{
foreach ($row as $i => $v) {
- if ($i != "expiry_month" && $i !="beginning_balance") {
+ $exempted_columns = array('expiry_month','beginning_balance','reported_consumed','reported_physical_stock');
+ if (!in_array($i,$exempted_columns)) {
$row[$i] = round(@$v / @$pack_size);
}
}
@@ -3947,11 +2450,12 @@ public function getOtherTransactions($param=array(),$row=array()){
$row[$trans_name] = $total;
}
}
- //losses
+
$row['losses'] = @$row['losses_'];
+ $row['adjustments'] = @$row['adjustment_plus'];
+ $row['adjustments_neg'] = @$row['adjustment__'];
+
unset($row['losses_']);
- //adjustments
- $row['adjustments'] = @$row['adjustment_plus'] - @$row['adjustment__'];
unset($row['adjustment_plus']);
unset($row['adjustment__']);
@@ -4011,4 +2515,6 @@ public function getExpectedActualReport(){
echo json_encode($data);
}
}
+// end of buffer: Exit and Clear
+ob_get_clean();
?>
diff --git a/application/controllers/order_settings.php b/application/controllers/order_settings.php
new file mode 100644
index 0000000..004be14
--- /dev/null
+++ b/application/controllers/order_settings.php
@@ -0,0 +1,190 @@
+ session -> set_userdata("link_id", "listing/sync_drug");
+ $this -> session -> set_userdata("linkSub", "order_settings/listing/sync_drug");
+ $this -> session -> set_userdata("linkTitle", "Settings Management");
+ }
+
+ public function listing($table = "") {
+ //Setup parameters
+ $access_level = $this -> session -> userdata('user_indicator');
+ $seperator = ' | ';
+ $exclude_columns = array('Active');
+ $params = array(
+ 'sync_drug' => array(
+ 'columns' => array('ID', 'Name', 'Abbreviation', 'Strength', 'Packsize', 'Formulation', 'Options'),
+ 'query' => 'SELECT id, name, abbreviation, strength, packsize, formulation, Active FROM sync_drug'
+ ),
+ 'sync_regimen' => array(
+ 'columns' => array('ID','Code', 'Name', 'Options'),
+ 'query' => 'SELECT id, code, name, Active FROM sync_regimen'
+ ),
+ 'sync_regimen_category' => array(
+ 'columns' => array('ID', 'Name', 'Active'),
+ 'query' => 'SELECT id, name, Active FROM sync_regimen_category'
+ ),
+ 'sync_facility' => array(
+ 'columns' => array('ID', 'Name', 'Code', 'Category', 'Keph Level', 'Active'),
+ 'query' => 'SELECT id, name, code, category, keph_level, Active FROM sync_facility'
+ )
+ );
+
+ //Initialize table library
+ $this->load->library('table');
+ $tmpl = array('table_open' => ' ');
+ $this -> table -> set_template($tmpl);
+ $this->table->set_heading($params[$table]['columns']);
+
+ //Load table data
+ $query = $this->db->query($params[$table]['query']);
+ $results = $query->result_array();
+
+ //Append data to table
+ foreach($results as $result){
+ $row = array();
+ foreach($result as $index => $value){
+ if($index == 'Active'){
+ $edit_link = anchor('#'.$table.'_form', 'Edit', array('id' => $result['id'], 'table' => $table, 'role' => 'button', 'class' => 'edit_setting', 'data-toggle' => 'modal'));
+ $disable_link = anchor('order_settings/disable/' . $table . '/' . $result['id'], 'Disable', array('class' => 'disable_user'));
+ $enable_link = anchor('order_settings/enable/' . $table . '/' . $result['id'], 'Enable', array('class' => 'enable_user'));;
+ $links = $edit_link;
+ if($access_level == "facility_administrator"){
+ if ($value == 1) {
+ $links = $edit_link.$seperator.$disable_link;
+ }else{
+ $links = $edit_link.$seperator.$enable_link;
+ }
+ }
+ //Add options links
+ $row[] = $links;
+ }
+ //Add specific values
+ if(!in_array($index, $exclude_columns)){
+ $row[] = $value;
+ }
+ }
+ $this->table->add_row($row);
+ }
+
+ $data['sources'] = $this -> table -> generate();
+ $data['title'] = strtoupper($table);
+ $data['banner_text'] = strtoupper($table);
+ $data['table'] = $table;
+ $data['link'] = $table;
+ $actions = array(0 => array('Edit', 'edit'), 1 => array('Disable', 'disable'));
+ $data['actions'] = $actions;
+ $this -> base_params($data);
+ }
+
+ public function enable($table = '', $id) {
+ $name_column = 'name';
+ if($table == 'sync_regimen_category') $name_column = 'Name';
+ //Update status
+ $this -> db -> where('id', $id);
+ $this -> db -> update($table, array('Active' => 1));
+
+ //Get details
+ $result = $this-> db ->get_where($table, array('id' => $id))-> row_array();
+
+ $this -> session -> set_userdata('msg_success', $result[$name_column] . ' was enabled!');
+ $this -> session -> set_flashdata('filter_datatable', $result[$name_column]);
+ $this -> session -> set_userdata("link_id", "listing/" . $table);
+ $this -> session -> set_userdata("linkSub", "order_settings/listing/" . $table);
+ //Filter datatable
+ redirect('settings_management');
+ }
+
+ public function disable($table = '', $id) {
+ $name_column = 'name';
+ if($table == 'sync_regimen_category') $name_column = 'Name';
+ //Update status
+ $this -> db -> where('id', $id);
+ $this -> db -> update($table, array('Active' => 0));
+
+ //Get details
+ $result = $this-> db ->get_where($table, array('id' => $id))-> row_array();
+
+ $this -> session -> set_userdata('msg_error', $result[$name_column]. ' was disabled!');
+ $this -> session -> set_flashdata('filter_datatable', $result[$name_column]);
+ $this -> session -> set_userdata("link_id", "listing/" . $table);
+ $this -> session -> set_userdata("linkSub", "order_settings/listing/" . $table);
+ //Filter datatable
+ redirect('settings_management');
+ }
+
+ public function save($table = ''){
+ $this->db->insert($table, $this->input->post());
+
+ if($this->db->affected_rows() > 0){
+ $this -> session -> set_userdata('msg_success', $this -> input -> post('name') . ' was successfully Added!');
+ }else{
+ $this -> session -> set_userdata('msg_error', $this -> input -> post('name') . ' was not Added!');
+
+ }
+ $this -> session -> set_userdata('message_counter', '1');
+ $this -> session -> set_flashdata('filter_datatable', $this -> input -> post('name'));
+ $this -> session -> set_userdata("link_id", "listing/" . $table);
+ $this -> session -> set_userdata("linkSub", "order_settings/listing/" . $table);
+
+ redirect('settings_management');
+ }
+
+ public function update($table = '', $id = ''){
+ $this -> db -> where('id', $id);
+ $this -> db -> update($table, $this->input->post());
+
+ if($this->db->affected_rows() > 0){
+ $this -> session -> set_userdata('msg_success', $this -> input -> post('name') . ' was successfully Updated!');
+ }else{
+ $this -> session -> set_userdata('msg_error', $this -> input -> post('name') . ' was not Updated!');
+
+ }
+ $this -> session -> set_userdata('message_counter', '1');
+ $this -> session -> set_flashdata('filter_datatable', $this -> input -> post('name'));
+ $this -> session -> set_userdata("link_id", "listing/" . $table);
+ $this -> session -> set_userdata("linkSub", "order_settings/listing/" . $table);
+
+ redirect('settings_management');
+ }
+
+ public function fetch($table = ''){
+ //Set parameters
+ $params = array(
+ 'sync_regimen_category' => array(
+ 'name_column' => 'Name AS name',
+ 'active_column' => 'Active'),
+ 'sync_regimen' => array(
+ 'name_column' => 'CONCAT_WS(" | ",code,name) AS name',
+ 'active_column' => 'Active'),
+ 'sync_facility' => array(
+ 'name_column' => 'name',
+ 'active_column' => 'Active'),
+ 'counties' => array(
+ 'name_column' => 'county AS name',
+ 'active_column' => 'active'),
+ 'district' => array(
+ 'name_column' => 'name',
+ 'active_column' => 'active')
+ );
+ //Fetch resources
+ $this->db->select(array('id', $params[$table]['name_column']));
+ $data = $this->db->order_by('name', 'ASC')->get_where($table, array($params[$table]['active_column'] => 1))->result_array();
+ echo json_encode($data);
+ }
+
+ public function get_details($table = '', $id = ''){
+ $data = $this->db->get_where($table, array('id' => $id))->row_array();
+ echo json_encode($data);
+ }
+
+ public function base_params($data) {
+ $data['quick_link'] = "settings";
+ $this -> load -> view("mysetting_v", $data);
+ }
+
+}
\ No newline at end of file
diff --git a/application/controllers/patient_management.php b/application/controllers/patient_management.php
index 5906e09..068a606 100644
--- a/application/controllers/patient_management.php
+++ b/application/controllers/patient_management.php
@@ -1,282 +1,290 @@
load -> database();
- $this -> load -> library('PHPExcel');
- ini_set("max_execution_time", "5000");
- ini_set('memory_limit', '1024M');
- }
-
- public function index() {
- //$data['content_view'] = "patient_listing_v";
- $data['content_view'] = "patients/listing_view";
- $this -> base_params($data);
- }
- public function merge_list() {
- $data['quick_link'] = "merging";
- $data['title'] = "Patient Merging";
- $data['page_title'] = "Patient Merging Management";
- $data['link'] = "settings_management";
- $data['banner_text'] = "Patient Merging Listing";
-
- $this -> session -> set_userdata("link_id", "merge_list");
- $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
-
- $this -> load ->view("patient_merging_v",$data);
- }
-
- public function details() {
- $data['content_view'] = "patient_details_v";
- $data['hide_side_menu'] = 1;
- $this -> base_params($data);
- }
-
- public function addpatient_show() {
- $data = array();
- $data['districts'] = District::getPOB();
- $data['genders'] = Gender::getAll();
- $data['statuses'] = Patient_Status::getStatus();
- $data['sources'] = Patient_Source::getSources();
- $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
- $data['service_types'] = Regimen_Service_Type::getHydratedAll();
- $data['facilities'] = Facilities::getAll();
- $data['family_planning'] = Family_Planning::getAll();
- $data['other_illnesses'] = Other_Illnesses::getAll();
- $data['pep_reasons'] = Pep_Reason::getActive();
- $data['drugs'] = Drugcode::getAllEnabled();
- $data['who_stages'] = Who_Stage::getAllHydrated();
- $data['hide_side_menu'] = '1';
- $data['content_view'] = "add_patient_v";
- $this -> base_params($data);
- }
-
- public function checkpatient_no($patient_no) {
- //Variables
- $facility_code = $this -> session -> userdata('facility');
- $sql = "select * from patient where facility_code='$facility_code' and patient_number_ccc='$patient_no'";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- echo json_decode("1");
- } else {
- echo json_decode("0");
- }
-
- }
- public function merge_spouse($patient_no,$spouse_no){
- $spousedata=array('primary_spouse'=>$patient_no,'secondary_spouse'=>$spouse_no);
- $this->db->insert('spouses',$spousedata);
- }
-
- public function unmerge_spouse($patient_no){
- $sql="DELETE FROM spouses WHERE primary_spouse='$patient_no'";
- $this->db->query($sql);
- }
- public function merge_parent($patient_no,$parent_no){
- $childdata= array('child'=>$patient_no,'parent' =>$parent_no);
- $this->db->insert('dependants',$childdata);
- }
- public function unmerge_parent($patient_no){
- $sql="DELETE FROM dependants WHERE child='$patient_no'";
- $this->db->query($sql);
- }
-
- public function listing() {
- $access_level = $this -> session -> userdata('user_indicator');
- $facility_code = $this -> session -> userdata('facility');
- $link = "";
- //Testing, don't judge
- $data = array();
- /* Array of database columns which should be read and sent back to DataTables. Use a space where
- * you want to insert a non-database field (for example a counter or static image)
- */
- $aColumns = array('Patient_Number_CCC', 'First_Name', 'Last_Name', 'Other_Name', 'NextAppointment', 'Phone', 'Regimen_Desc', 'Name');
-
- $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
- $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
- $iSortCol_0 = $this -> input -> get_post('iSortCol_0', true);
- $iSortingCols = $this -> input -> get_post('iSortingCols', true);
- $sSearch = $this -> input -> get_post('sSearch', true);
- $sEcho = $this -> input -> get_post('sEcho', true);
-
- // Paging
- if (isset($iDisplayStart) && $iDisplayLength != '-1') {
- $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
- }
-
- // Ordering
- if (isset($iSortCol_0)) {
- for ($i = 0; $i < intval($iSortingCols); $i++) {
- $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
- $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
- $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
-
- if ($bSortable == 'true') {
- $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
- }
- }
- }
-
- /*
- * Filtering
- * NOTE this does not match the built-in DataTables filtering which does it
- * word by word on any field. It's possible to do here, but concerned about efficiency
- * on very large tables, and MySQL's regex functionality is very limited
- */
-
- $j = 0;
- for ($i = 0; $i < count($aColumns); $i++) {
- if ($i >= 1) {
- $j++;
- }
- $bSearchable = $this -> input -> get_post('bSearchable_' . $j, true);
- $sSearch_ = $this -> input -> get_post('sSearch_' . $j, true);
- // Individual column filtering
- if (isset($bSearchable) && $bSearchable == 'true' && !empty($sSearch_)) {
- if($i>=3 and $i<5){
- $i=$i+2;
- }
- $col = $aColumns[$i];
- if($col=='First_Name' ){
- $value=$this -> db -> escape_like_str($sSearch_);
- $where = "(First_Name LIKE '%$value%' OR Last_Name LIKE '%$value%' OR Last_Name LIKE '%$value%')";
+ function __construct() {
+ parent::__construct();
+ $this -> load -> database();
+ $this -> load -> library('PHPExcel');
+ ini_set("max_execution_time", "100000");
+ ini_set('memory_limit', '512M');
+ }
+
+ public function index() {
+ //$data['content_view'] = "patient_listing_v";
+ $data['content_view'] = "patients/listing_view";
+ $this -> base_params($data);
+ }
+ public function merge_list() {
+ $data['quick_link'] = "merging";
+ $data['title'] = "Patient Merging";
+ $data['page_title'] = "Patient Merging Management";
+ $data['link'] = "settings_management";
+ $data['banner_text'] = "Patient Merging Listing";
+
+ $this -> session -> set_userdata("link_id", "merge_list");
+ $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
+
+ $this -> load ->view("patient_merging_v",$data);
+ }
+
+ public function get_Last_vl_result($ccc_number){
+ $sql = "SELECT * FROM patient_viral_load WHERE patient_ccc_number = '$ccc_number' ORDER BY test_date DESC LIMIT 1";
+ $results = $this->db->query($sql)->result_array();
+ echo json_encode($results);
+ }
+
+ public function details() {
+ $data['content_view'] = "patient_details_v";
+ $data['hide_side_menu'] = 1;
+ $this -> base_params($data);
+ }
+
+ public function addpatient_show() {
+ $data = array();
+ $data['districts'] = District::getPOB();
+ $data['genders'] = Gender::getAll();
+ $data['statuses'] = Patient_Status::getStatus();
+ $data['sources'] = Patient_Source::getSources();
+ $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
+ $data['service_types'] = Regimen_Service_Type::getHydratedAll();
+ $data['facilities'] = Facilities::getAll();
+ $data['family_planning'] = Family_Planning::getAll();
+ $data['other_illnesses'] = Other_Illnesses::getAll();
+ $data['pep_reasons'] = Pep_Reason::getActive();
+ $data['drugs'] = Drugcode::getAllEnabled();
+ $data['who_stages'] = Who_Stage::getAllHydrated();
+ $data['hide_side_menu'] = '1';
+ $data['content_view'] = "add_patient_v";
+ $this -> base_params($data);
+ }
+
+ public function checkpatient_no($patient_no) {
+ //Variables
+ $facility_code = $this -> session -> userdata('facility');
+ $sql = "select * from patient where facility_code='$facility_code' and patient_number_ccc='$patient_no'";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ echo json_decode("1");
+ } else {
+ echo json_decode("0");
+ }
+
+ }
+ public function merge_spouse($patient_no,$spouse_no){
+ $spousedata=array('primary_spouse'=>$patient_no,'secondary_spouse'=>$spouse_no);
+ $this->db->insert('spouses',$spousedata);
+ }
+
+ public function unmerge_spouse($patient_no){
+ $sql="DELETE FROM spouses WHERE primary_spouse='$patient_no'";
+ $this->db->query($sql);
+ }
+ public function merge_parent($patient_no,$parent_no){
+ $childdata= array('child'=>$patient_no,'parent' =>$parent_no);
+ $this->db->insert('dependants',$childdata);
+ }
+ public function unmerge_parent($patient_no){
+ $sql="DELETE FROM dependants WHERE child='$patient_no'";
+ $this->db->query($sql);
+ }
+
+ public function listing() {
+ $access_level = $this -> session -> userdata('user_indicator');
+ $facility_code = $this -> session -> userdata('facility');
+ $link = "";
+ //Testing, don't judge
+ $data = array();
+ /* Array of database columns which should be read and sent back to DataTables. Use a space where
+ * you want to insert a non-database field (for example a counter or static image)
+ */
+ $aColumns = array('Patient_Number_CCC', 'First_Name', 'Last_Name', 'Other_Name', 'NextAppointment', 'Phone', 'Regimen_Desc', 'Name');
+
+ $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
+ $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
+ $iSortCol_0 = $this -> input -> get_post('iSortCol_0', true);
+ $iSortingCols = $this -> input -> get_post('iSortingCols', true);
+ $sSearch = $this -> input -> get_post('sSearch', true);
+ $sEcho = $this -> input -> get_post('sEcho', true);
+
+ // Paging
+ if (isset($iDisplayStart) && $iDisplayLength != '-1') {
+ $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
+ }
+
+ // Ordering
+ if (isset($iSortCol_0)) {
+ for ($i = 0; $i < intval($iSortingCols); $i++) {
+ $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
+ $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
+ $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
+
+ if ($bSortable == 'true') {
+ $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
+ }
+ }
+ }
+
+ /*
+ * Filtering
+ * NOTE this does not match the built-in DataTables filtering which does it
+ * word by word on any field. It's possible to do here, but concerned about efficiency
+ * on very large tables, and MySQL's regex functionality is very limited
+ */
+
+ $j = 0;
+ for ($i = 0; $i < count($aColumns); $i++) {
+ if ($i >= 1) {
+ $j++;
+ }
+ $bSearchable = $this -> input -> get_post('bSearchable_' . $j, true);
+ $sSearch_ = $this -> input -> get_post('sSearch_' . $j, true);
+ // Individual column filtering
+ if (isset($bSearchable) && $bSearchable == 'true' && !empty($sSearch_)) {
+ if($i>=3 and $i<5){
+ $i=$i+2;
+ }
+ $col = $aColumns[$i];
+ if($col=='First_Name' ){
+ $value=$this -> db -> escape_like_str($sSearch_);
+ $where = "(First_Name LIKE '%$value%' OR Last_Name LIKE '%$value%' OR Last_Name LIKE '%$value%')";
$this ->db -> where($where);
- }else{
- $this -> db -> like($col, $this -> db -> escape_like_str($sSearch_));
- }
-
- }
- if (isset($sSearch) && !empty($sSearch)) {
- $this -> db -> or_like($aColumns[$i], $this -> db -> escape_like_str($sSearch));
- }
- }
-
-
-
- // Select Data
- $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
-
- $this -> db -> select("p.id,p.Patient_Number_CCC,p.First_Name,p.Last_Name,p.Other_Name,p.NextAppointment,p.phone as Phone,r.Regimen_Desc,s.Name,p.Active");
- $this -> db -> from("patient p");
- $this -> db -> where("p.Facility_Code", $facility_code);
- $this -> db -> join("regimen r", "r.id=p.Current_Regimen", "left");
- $this -> db -> join("patient_status s", "s.id=p.current_status", "left");
-
- $rResult = $this -> db -> get();
- //echo $this->db->last_query();die();
-
- // Data set length after filtering
- $this -> db -> select('FOUND_ROWS() AS found_rows');
- $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
-
- // Total data set length
- $this -> db -> select("p.*");
- $this -> db -> from("patient p");
- $this -> db -> where("p.Facility_Code", $facility_code);
- $this -> db -> join("regimen r", "r.id=p.Current_Regimen", "left");
- $this -> db -> join("patient_status s", "s.id=p.current_status", "left");
- $tot_patients = $this -> db -> get();
- $iTotal = count($tot_patients -> result_array());
-
- // Output
- $output = array('sEcho' => intval($sEcho), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => array());
-
- foreach ($rResult->result_array() as $aRow) {
- $row = array();
- $col = 0;
- $name = "";
- $id = "";
- foreach ($aColumns as $col) {
- if ($col == "First_Name" or $col == "Last_Name" or $col == "Other_Name") {
- if ($col == "First_Name") {
- $name = $aRow[$col] . " ";
- $name = strtoupper($name);
- continue;
- } else {
- if ($col == "Last_Name") {
- $name .= $aRow[$col] . " ";
- $name = strtoupper($name);
- continue;
- } else if ($col == "Other_Name") {
- $name .= $aRow[$col];
- $name = strtoupper($name);
- $name = "" . $name . " ";
- }
-
- }
- } else if ($col == "Date_Enrolled") {
- $name = date('d-M-Y', strtotime($aRow[$col]));
- } else if ($col == "NextAppointment") {
- if ($aRow[$col]) {
- $name = date('d-M-Y', strtotime($aRow[$col]));
- } else {
- $name = "N/A";
- }
- }
- //Check if phone No does not exist
- else if ($col == "Phone") {
- $name = str_replace(" ", "", $aRow['Phone']);
- if ($aRow[$col] == "") {
- //$name = str_replace(" ", "", $aRow['Physical']);
- } else {
- //$name = str_replace(" ", "", $aRow['Phone']);
- }
- } else if ($col == "Regimen_Desc") {
- $name = "" . $aRow[$col] . " ";
- } else if ($col == "Name") {
- $name = "" . $aRow[$col] . " ";
- } else {
- $name = $aRow[$col];
- $name = strtoupper($name);
- }
-
- $row[] = $name;
- }
- $id = $aRow['id'];
- $link = "";
- if ($access_level == "facility_administrator") {
- if ($aRow['Active'] == 1) {
- $link = '| Disable ';
-
- } else {
- $link = '| Enable ';
- }
- }
-
- if ($aRow['Active'] == 1) {
- $row[] = 'Detail | Edit ' . $link;
- } else {
- $link = str_replace("|", "", $link);
- $link .= '| Delete ';
- $row[] = $link;
- }
-
- $output['aaData'][] = $row;
- }
- echo json_encode($output,JSON_PRETTY_PRINT);
- //die();
- }
-
- public function extract_illness($illness_list = "") {
- $illness_array = explode(",", $illness_list);
- $new_array = array();
- foreach ($illness_array as $index => $illness) {
- if ($illness == null) {
- unset($illness_array[$index]);
- } else {
- $illness = str_replace("\n", "",$illness);
- $new_array[] = trim($illness);
- }
- }
- return json_encode($new_array);
- }
-
- public function viewDetails($record_no) {
- $this -> session -> set_userdata('record_no', $record_no);
- $patient = "";
- $facility = "";
- $sql = "SELECT p.*,
+ }else{
+ $this -> db -> like($col, $this -> db -> escape_like_str($sSearch_));
+ }
+
+ }
+ if (isset($sSearch) && !empty($sSearch)) {
+ $this -> db -> or_like($aColumns[$i], $this -> db -> escape_like_str($sSearch));
+ }
+ }
+
+
+
+ // Select Data
+ $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
+
+ $this -> db -> select("p.id,p.Patient_Number_CCC,p.First_Name,p.Last_Name,p.Other_Name,p.NextAppointment,p.phone as Phone,r.Regimen_Desc,s.Name,p.Active");
+ $this -> db -> from("patient p");
+ $this -> db -> where("p.Facility_Code", $facility_code);
+ $this -> db -> join("regimen r", "r.id=p.Current_Regimen", "left");
+ $this -> db -> join("patient_status s", "s.id=p.current_status", "left");
+
+ $rResult = $this -> db -> get();
+ //echo $this->db->last_query();die();
+
+ // Data set length after filtering
+ $this -> db -> select('FOUND_ROWS() AS found_rows');
+ $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
+
+ // Total data set length
+ $this -> db -> select("p.*");
+ $this -> db -> from("patient p");
+ $this -> db -> where("p.Facility_Code", $facility_code);
+ $this -> db -> join("regimen r", "r.id=p.Current_Regimen", "left");
+ $this -> db -> join("patient_status s", "s.id=p.current_status", "left");
+ $tot_patients = $this -> db -> get();
+ $iTotal = count($tot_patients -> result_array());
+
+ // Output
+ $msg = array('sEcho' => intval($sEcho), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => array());
+
+ foreach ($rResult->result_array() as $aRow) {
+ $row = array();
+ $col = 0;
+ $name = "";
+ $id = "";
+ foreach ($aColumns as $col) {
+ if ($col == "First_Name" or $col == "Last_Name" or $col == "Other_Name") {
+ if ($col == "First_Name") {
+ $name = $aRow[$col] . " ";
+ $name = strtoupper($name);
+ continue;
+ } else {
+ if ($col == "Last_Name") {
+ $name .= $aRow[$col] . " ";
+ $name = strtoupper($name);
+ continue;
+ } else if ($col == "Other_Name") {
+ $name .= $aRow[$col];
+ $name = strtoupper($name);
+ $name = "" . $name . " ";
+ }
+
+ }
+ } else if ($col == "Date_Enrolled") {
+ $name = date('d-M-Y', strtotime($aRow[$col]));
+ } else if ($col == "NextAppointment") {
+ if ($aRow[$col]) {
+ $name = date('d-M-Y', strtotime($aRow[$col]));
+ } else {
+ $name = "N/A";
+ }
+ }
+ //Check if phone No does not exist
+ else if ($col == "Phone") {
+ $name = str_replace(" ", "", $aRow['Phone']);
+ if ($aRow[$col] == "") {
+ //$name = str_replace(" ", "", $aRow['Physical']);
+ } else {
+ //$name = str_replace(" ", "", $aRow['Phone']);
+ }
+ } else if ($col == "Regimen_Desc") {
+ $name = "" . $aRow[$col] . " ";
+ } else if ($col == "Name") {
+ $name = "" . $aRow[$col] . " ";
+ } else {
+ $name = $aRow[$col];
+ $name = strtoupper($name);
+ }
+
+ $row[] = $name;
+ }
+ $id = $aRow['id'];
+ $link = "";
+ if ($access_level == "facility_administrator") {
+ if ($aRow['Active'] == 1) {
+ $link = '| Disable ';
+
+ } else {
+ $link = '| Enable ';
+ }
+ }
+
+ if ($aRow['Active'] == 1) {
+ $row[] = 'Detail | Edit ' . $link;
+ } else {
+ $link = str_replace("|", "", $link);
+ $link .= '| Delete ';
+ $row[] = $link;
+ }
+
+ $msg['aaData'][] = $row;
+ }
+ echo json_encode($msg,JSON_PRETTY_PRINT);
+ }
+
+ public function extract_illness($illness_list = "") {
+ $illness_array = explode(",", $illness_list);
+ $new_array = array();
+ foreach ($illness_array as $index => $illness) {
+ if ($illness == null) {
+ unset($illness_array[$index]);
+ } else {
+ $illness = str_replace("\n", "",$illness);
+ $new_array[] = trim($illness);
+ }
+ }
+ return json_encode($new_array);
+ }
+
+ public function viewDetails($record_no) {
+ $this -> session -> set_userdata('record_no', $record_no);
+ $patient = "";
+ $facility = "";
+ $sql = "SELECT p.*,
rst.Name as service_name,
dp.child,
s.secondary_spouse
@@ -286,37 +294,37 @@ public function viewDetails($record_no) {
LEFT JOIN spouses s ON p.patient_number_ccc=s.primary_spouse
WHERE p.id='$record_no'
GROUP BY p.id";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
-
- $depdendant_msg = "";
- if ($results) {
- $results[0]['other_illnesses'] = $this -> extract_illness($results[0]['other_illnesses']);
- $data['results'] = $results;
- $patient = $results[0]['patient_number_ccc'];
- $facility = $this -> session -> userdata("facility");
- //Check dependedants/spouse status
- $child = $results[0]['child'];
- $spouse = $results[0]['secondary_spouse'];
- $patient_name = strtoupper($results[0]['first_name'].' '.$results[0]['last_name']);
- if($child!=NULL){
-
- $pat = $this ->getDependentStatus($child);
- if($pat!=''){
- $depdendant_msg.="Patient $patient_name\'s dependant ".$pat." is lost to follow up ";
- }
-
- }
- if($spouse!=NULL){
- $pat = $this ->getDependentStatus($spouse);
- if($pat!=''){
- $depdendant_msg.="Patient $patient_name\'s spouse ".$pat." is lost to follow up ";
- }
-
- }
- }
- //Patient History
- $sql = "SELECT pv.dispensing_date,
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+
+ $depdendant_msg = "";
+ if ($results) {
+ $results[0]['other_illnesses'] = $this -> extract_illness($results[0]['other_illnesses']);
+ $data['results'] = $results;
+ $patient = $results[0]['patient_number_ccc'];
+ $facility = $this -> session -> userdata("facility");
+ //Check dependedants/spouse status
+ $child = $results[0]['child'];
+ $spouse = $results[0]['secondary_spouse'];
+ $patient_name = strtoupper($results[0]['first_name'].' '.$results[0]['last_name']);
+ if($child!=NULL){
+
+ $pat = $this ->getDependentStatus($child);
+ if($pat!=''){
+ $depdendant_msg.="Patient $patient_name\'s dependant ".$pat." is lost to follow up ";
+ }
+
+ }
+ if($spouse!=NULL){
+ $pat = $this ->getDependentStatus($spouse);
+ if($pat!=''){
+ $depdendant_msg.="Patient $patient_name\'s spouse ".$pat." is lost to follow up ";
+ }
+
+ }
+ }
+ //Patient History
+ $sql = "SELECT pv.dispensing_date,
v.name AS visit,
u.Name AS unit,
pv.dose,
@@ -346,35 +354,35 @@ public function viewDetails($record_no) {
AND pv.active='1' AND pv.pv_active='1'
GROUP BY d.drug,pv.dispensing_date
ORDER BY pv.patient_visit_id DESC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
if ($results) {
- $data['history_logs'] = $results;
- } else {
- $data['history_logs'] = "";
- }
- $data['dependant_msg'] = $depdendant_msg;
- $data['districts'] = District::getPOB();
- $data['genders'] = Gender::getAll();
- $data['statuses'] = Patient_Status::getStatus();
- $data['sources'] = Patient_Source::getSources();
- $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
- $data['service_types'] = Regimen_Service_Type::getHydratedAll();
- $data['facilities'] = Facilities::getAll();
- $data['family_planning'] = Family_Planning::getAll();
- $data['other_illnesses'] = Other_Illnesses::getAll();
- $data['pep_reasons'] = Pep_Reason::getActive();
- $data['drugs'] = Drugcode::getEnabledDrugs();
- $data['regimens'] = Regimen::getRegimens();
- $data['who_stages'] = Who_Stage::getAllHydrated();
- $data['content_view'] = 'patient_details_v';
- //Hide side menus
- $data['hide_side_menu'] = '1';
- $this -> base_params($data);
- }
-
- public function edit($record_no) {
- $sql = "SELECT p.*,
+ $data['history_logs'] = $results;
+ } else {
+ $data['history_logs'] = "";
+ }
+ $data['dependant_msg'] = $depdendant_msg;
+ $data['districts'] = District::getPOB();
+ $data['genders'] = Gender::getAll();
+ $data['statuses'] = Patient_Status::getStatus();
+ $data['sources'] = Patient_Source::getSources();
+ $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
+ $data['service_types'] = Regimen_Service_Type::getHydratedAll();
+ $data['facilities'] = Facilities::getAll();
+ $data['family_planning'] = Family_Planning::getAll();
+ $data['other_illnesses'] = Other_Illnesses::getAll();
+ $data['pep_reasons'] = Pep_Reason::getActive();
+ $data['drugs'] = Drugcode::getEnabledDrugs();
+ $data['regimens'] = Regimen::getRegimens();
+ $data['who_stages'] = Who_Stage::getAllHydrated();
+ $data['content_view'] = 'patient_details_v';
+ //Hide side menus
+ $data['hide_side_menu'] = '1';
+ $this -> base_params($data);
+ }
+
+ public function edit($record_no) {
+ $sql = "SELECT p.*,
rst.Name as service_name,
dp.child,
s.secondary_spouse
@@ -384,410 +392,413 @@ public function edit($record_no) {
LEFT JOIN spouses s ON p.patient_number_ccc=s.primary_spouse
WHERE p.id='$record_no'
GROUP BY p.id";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $results[0]['other_illnesses'] = $this -> extract_illness($results[0]['other_illnesses']);
- $data['results'] = $results;
- }
-
- $data['record_no'] = $record_no;
- $data['districts'] = District::getPOB();
- $data['genders'] = Gender::getAll();
- $data['statuses'] = Patient_Status::getStatus();
- $data['sources'] = Patient_Source::getSources();
- $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
- $data['service_types'] = Regimen_Service_Type::getHydratedAll();
- $data['facilities'] = Facilities::getAll();
- $data['family_planning'] = Family_Planning::getAll();
- $data['other_illnesses'] = Other_Illnesses::getAll();
- $data['pep_reasons'] = Pep_Reason::getActive();
- $data['regimens'] = Regimen::getRegimens();
- $data['drugs'] = Drugcode::getAllEnabled();
- $data['who_stages'] = Who_Stage::getAllHydrated();
- $data['content_view'] = 'edit_patients_v';
- //Hide side menus
- $data['hide_side_menu'] = '1';
- $this -> base_params($data);
-
- }
-
- public function save() {
- $family_planning = "";
- $other_illness_listing = "";
- $other_allergies_listing = "";
- $patient = "";
-
- $family_planning = $this -> input -> post('family_planning_holder', TRUE);
- if ($family_planning == null) {
- $family_planning = "";
- }
- $drug_prophylaxis = $this -> input -> post('drug_prophylaxis_holder', TRUE);
- if ($drug_prophylaxis == null) {
- $drug_prophylaxis = "";
- }
- $other_illness_listing = $this -> input -> post('other_illnesses_holder', TRUE);
- if ($other_illness_listing == null) {
- $other_illness_listing = "";
- }
- $other_chronic = $this -> input -> post('other_chronic', TRUE);
- if ($other_chronic != "") {
- if ($other_illness_listing) {
- $other_illness_listing = $other_illness_listing . "," . $other_chronic;
- } else {
- $other_illness_listing = $other_chronic;
- }
- }
- //Other allergies
- $other_allergies_list = $this -> input -> post('other_allergies_listing', TRUE);
- //List of drug allergies.
- $drug_allergies = $this -> input -> post('drug_allergies_holder', TRUE);
- if ($drug_allergies == null) {
- $drug_allergies = "";
- }
-
- if ($drug_allergies != "") {
- if ($other_allergies_list) {
- $other_allergies_listing = $other_allergies_list . "," . $drug_allergies;
- } else {
- $other_allergies_listing = $drug_allergies;
- }
- }else{
- $other_allergies_listing=$other_allergies_list;
- }
-
- //Patient Information & Demographics
- $new_patient = new Patient();
- $new_patient -> Medical_Record_Number = $this -> input -> post('medical_record_number', TRUE);
- $new_patient -> Patient_Number_CCC = $this -> input -> post('patient_number', TRUE);
- $new_patient -> First_Name = $this -> input -> post('first_name', TRUE);
- $new_patient -> Last_Name = $this -> input -> post('last_name', TRUE);
- $new_patient -> Other_Name = $this -> input -> post('other_name', TRUE);
- $new_patient -> Dob = $this -> input -> post('dob', TRUE);
- $new_patient -> Pob = $this -> input -> post('pob', TRUE);
- $new_patient -> Gender = $this -> input -> post('gender', TRUE);
- $new_patient -> Pregnant = $this -> input -> post('pregnant', TRUE);
- $new_patient -> Start_Weight = $this -> input -> post('weight', TRUE);
- $new_patient -> Start_Height = $this -> input -> post('height', TRUE);
- $new_patient -> Start_Bsa = $this -> input -> post('surface_area', TRUE);
- $new_patient -> Weight = $this -> input -> post('weight', TRUE);
- $new_patient -> Height = $this -> input -> post('height', TRUE);
- $new_patient -> Sa = $this -> input -> post('surface_area', TRUE);
- $new_patient -> Phone = $this -> input -> post('phone', TRUE);
- $new_patient -> SMS_Consent = $this -> input -> post('sms_consent', TRUE);
- $new_patient -> Physical = $this -> input -> post('physical', TRUE);
- $new_patient -> Alternate = $this -> input -> post('alternate', TRUE);
-
-
- //Patient History
- $new_patient -> Partner_Status = $this -> input -> post('partner_status', TRUE);
- $new_patient -> Disclosure = $this -> input -> post('disclosure', TRUE);
- $new_patient -> Fplan = $family_planning;
- $new_patient -> Other_Illnesses = $other_illness_listing;
- $new_patient -> Other_Drugs = $this -> input -> post('other_drugs', TRUE);
- $new_patient -> Adr = $other_allergies_listing;
- //other drug allergies
- $new_patient -> Support_Group = $this -> input -> post('support_group_listing', TRUE);
- $new_patient -> Smoke = $this -> input -> post('smoke', TRUE);
- $new_patient -> Alcohol = $this -> input -> post('alcohol', TRUE);
- $new_patient -> Tb = $this -> input -> post('tb', TRUE);
- $new_patient -> tb_category = $this -> input -> post('tbcategory', TRUE);
- $new_patient -> Tbphase = $this -> input -> post('tbphase', TRUE);
- $new_patient -> Startphase = $this -> input -> post('fromphase', TRUE);
- $new_patient -> Endphase = $this -> input -> post('tophase', TRUE);
-
- //Program Information
- $new_patient -> Date_Enrolled = $this -> input -> post('enrolled', TRUE);
- $new_patient -> Current_Status = $this -> input -> post('current_status', TRUE);
- //$new_patient -> Status_Change_Date = $this -> input -> post('status_started', TRUE);
- $new_patient -> Source = $this -> input -> post('source', TRUE);
- $new_patient -> Transfer_From = $this -> input -> post('transfer_source', TRUE);
- $new_patient -> drug_prophylaxis = $this -> input -> post('drug_prophylaxis', TRUE);
- $new_patient -> Facility_Code = $this -> session -> userdata('facility');
- $new_patient -> Service = $this -> input -> post('service', TRUE);
- $new_patient -> Start_Regimen = $this -> input -> post('regimen', TRUE);
- $new_patient -> Current_Regimen = $this -> input -> post('regimen', TRUE);
- $new_patient -> Start_Regimen_Date = $this -> input -> post('service_started', TRUE);
- $new_patient -> Tb_Test = $this -> input -> post('tested_tb', TRUE);
- $new_patient -> Pep_Reason = $this -> input -> post('pep_reason', TRUE);
- $new_patient -> who_stage = $this -> input -> post('who_stage', TRUE);
- $new_patient -> drug_prophylaxis = $drug_prophylaxis;
- $new_patient -> isoniazid_start_date = $this->input->post('iso_start_date',TRUE);
- $new_patient -> isoniazid_end_date = $this->input->post('iso_end_date',TRUE);
-
- $spouse_no=$this->input->post('match_spouse');
- $patient_no=$this->input->post('patient_number');
- $child_no=$this->input->post('match_parent');
-
- $new_patient -> save();
- //Map patient to spouse
- if($spouse_no != NULL){
- $this->merge_spouse($patient_no,$spouse_no);
- }
- //Map child to parent/guardian
- if($child_no != NULL){
- $this->merge_parent($patient_no,$child_no);
- }
-
- $sql = "SELECT MAX(id) as id FROM patient";
- $query = $this -> db -> query($sql);
- $result = $query -> result_array();
- $auto_id = $result[0]['id'];
-
- $patient = $this -> input -> post('patient_number', TRUE);
- $direction = $this -> input -> post('direction', TRUE);
-
- if ($direction == 0) {
- $this -> session -> set_userdata('msg_save_transaction', 'success');
- $this -> session -> set_flashdata('dispense_updated', 'Patient: ' . $this -> input -> post('first_name', TRUE) . " " . $this -> input -> post('last_name', TRUE) . ' was Saved');
- redirect("patient_management");
- } else if ($direction == 1) {
- redirect("dispensement_management/dispense/$auto_id");
- }
- }
-
- public function getDependentStatus($patient_number_ccc){
- $sql = "SELECT ps.name,p.patient_number_ccc,p.first_name,p.last_name,p.other_name FROM patient p
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ $results[0]['other_illnesses'] = $this -> extract_illness($results[0]['other_illnesses']);
+ $data['results'] = $results;
+ }
+
+ $data['record_no'] = $record_no;
+ $data['districts'] = District::getPOB();
+ $data['genders'] = Gender::getAll();
+ $data['statuses'] = Patient_Status::getStatus();
+ $data['sources'] = Patient_Source::getSources();
+ $data['drug_prophylaxis'] = Drug_Prophylaxis::getAll();
+ $data['service_types'] = Regimen_Service_Type::getHydratedAll();
+ $data['facilities'] = Facilities::getAll();
+ $data['family_planning'] = Family_Planning::getAll();
+ $data['other_illnesses'] = Other_Illnesses::getAll();
+ $data['pep_reasons'] = Pep_Reason::getActive();
+ $data['regimens'] = Regimen::getRegimens();
+ $data['drugs'] = Drugcode::getAllEnabled();
+ $data['who_stages'] = Who_Stage::getAllHydrated();
+ $data['content_view'] = 'edit_patients_v';
+ //Hide side menus
+ $data['hide_side_menu'] = '1';
+ $this -> base_params($data);
+
+ }
+
+ public function save() {
+ $family_planning = "";
+ $other_illness_listing = "";
+ $other_allergies_listing = "";
+ $patient = "";
+
+ $family_planning = $this -> input -> post('family_planning_holder', TRUE);
+ if ($family_planning == null) {
+ $family_planning = "";
+ }
+ $drug_prophylaxis = $this -> input -> post('drug_prophylaxis_holder', TRUE);
+ if ($drug_prophylaxis == null) {
+ $drug_prophylaxis = "";
+ }
+ $other_illness_listing = $this -> input -> post('other_illnesses_holder', TRUE);
+ if ($other_illness_listing == null) {
+ $other_illness_listing = "";
+ }
+ $other_chronic = $this -> input -> post('other_chronic', TRUE);
+ if ($other_chronic != "") {
+ if ($other_illness_listing) {
+ $other_illness_listing = $other_illness_listing . "," . $other_chronic;
+ } else {
+ $other_illness_listing = $other_chronic;
+ }
+ }
+ //Other allergies
+ $other_allergies_list = $this -> input -> post('other_allergies_listing', TRUE);
+ //List of drug allergies.
+ $drug_allergies = $this -> input -> post('drug_allergies_holder', TRUE);
+ if ($drug_allergies == null) {
+ $drug_allergies = "";
+ }
+
+ if ($drug_allergies != "") {
+ if ($other_allergies_list) {
+ $other_allergies_listing = $other_allergies_list . "," . $drug_allergies;
+ } else {
+ $other_allergies_listing = $drug_allergies;
+ }
+ }else{
+ $other_allergies_listing=$other_allergies_list;
+ }
+
+ //Patient Information & Demographics
+ $new_patient = new Patient();
+ $new_patient -> Medical_Record_Number = $this -> input -> post('medical_record_number', TRUE);
+ $new_patient -> Patient_Number_CCC = $this -> input -> post('patient_number', TRUE);
+ $new_patient -> First_Name = $this -> input -> post('first_name', TRUE);
+ $new_patient -> Last_Name = $this -> input -> post('last_name', TRUE);
+ $new_patient -> Other_Name = $this -> input -> post('other_name', TRUE);
+ $new_patient -> Dob = $this -> input -> post('dob', TRUE);
+ $new_patient -> Pob = $this -> input -> post('pob', TRUE);
+ $new_patient -> Gender = $this -> input -> post('gender', TRUE);
+ $new_patient -> Pregnant = $this -> input -> post('pregnant', TRUE);
+ $new_patient -> Start_Weight = $this -> input -> post('weight', TRUE);
+ $new_patient -> Start_Height = $this -> input -> post('height', TRUE);
+ $new_patient -> Start_Bsa = $this -> input -> post('surface_area', TRUE);
+ $new_patient -> Weight = $this -> input -> post('weight', TRUE);
+ $new_patient -> Height = $this -> input -> post('height', TRUE);
+ $new_patient -> Sa = $this -> input -> post('surface_area', TRUE);
+ $new_patient -> Phone = $this -> input -> post('phone', TRUE);
+ $new_patient -> SMS_Consent = $this -> input -> post('sms_consent', TRUE);
+ $new_patient -> Physical = $this -> input -> post('physical', TRUE);
+ $new_patient -> Alternate = $this -> input -> post('alternate', TRUE);
+
+
+ //Patient History
+ $new_patient -> Partner_Status = $this -> input -> post('partner_status', TRUE);
+ $new_patient -> Disclosure = $this -> input -> post('disclosure', TRUE);
+ $new_patient -> Fplan = $family_planning;
+ $new_patient -> Other_Illnesses = $other_illness_listing;
+ $new_patient -> Other_Drugs = $this -> input -> post('other_drugs', TRUE);
+ $new_patient -> Adr = $other_allergies_listing;
+ //other drug allergies
+ $new_patient -> Support_Group = $this -> input -> post('support_group_listing', TRUE);
+ $new_patient -> Smoke = $this -> input -> post('smoke', TRUE);
+ $new_patient -> Alcohol = $this -> input -> post('alcohol', TRUE);
+ $new_patient -> Tb = $this -> input -> post('tb', TRUE);
+ $new_patient -> tb_category = $this -> input -> post('tbcategory', TRUE);
+ $new_patient -> Tbphase = $this -> input -> post('tbphase', TRUE);
+ $new_patient -> Startphase = $this -> input -> post('fromphase', TRUE);
+ $new_patient -> Endphase = $this -> input -> post('tophase', TRUE);
+
+ //Program Information
+ $new_patient -> Date_Enrolled = $this -> input -> post('enrolled', TRUE);
+ $new_patient -> Current_Status = $this -> input -> post('current_status', TRUE);
+ //$new_patient -> Status_Change_Date = $this -> input -> post('status_started', TRUE);
+ $new_patient -> Source = $this -> input -> post('source', TRUE);
+ $new_patient -> Transfer_From = $this -> input -> post('transfer_source', TRUE);
+ $new_patient -> drug_prophylaxis = $this -> input -> post('drug_prophylaxis', TRUE);
+ $new_patient -> Facility_Code = $this -> session -> userdata('facility');
+ $new_patient -> Service = $this -> input -> post('service', TRUE);
+ $new_patient -> Start_Regimen = $this -> input -> post('regimen', TRUE);
+ $new_patient -> Current_Regimen = $this -> input -> post('regimen', TRUE);
+ $new_patient -> Start_Regimen_Date = $this -> input -> post('service_started', TRUE);
+ $new_patient -> Tb_Test = $this -> input -> post('tested_tb', TRUE);
+ $new_patient -> Pep_Reason = $this -> input -> post('pep_reason', TRUE);
+ $new_patient -> who_stage = $this -> input -> post('who_stage', TRUE);
+ $new_patient -> drug_prophylaxis = $drug_prophylaxis;
+ $new_patient -> isoniazid_start_date = $this->input->post('iso_start_date',TRUE);
+ $new_patient -> isoniazid_end_date = $this->input->post('iso_end_date',TRUE);
+
+ $spouse_no=$this->input->post('match_spouse');
+ $patient_no=$this->input->post('patient_number');
+ $child_no=$this->input->post('match_parent');
+
+ $new_patient -> save();
+ //Map patient to spouse
+ if($spouse_no != NULL){
+ $this->merge_spouse($patient_no,$spouse_no);
+ }
+ //Map child to parent/guardian
+ if($child_no != NULL){
+ $this->merge_parent($patient_no,$child_no);
+ }
+
+ $sql = "SELECT MAX(id) as id FROM patient";
+ $query = $this -> db -> query($sql);
+ $result = $query -> result_array();
+ $auto_id = $result[0]['id'];
+
+ $patient = $this -> input -> post('patient_number', TRUE);
+ $direction = $this -> input -> post('direction', TRUE);
+
+ if ($direction == 0) {
+ $this -> session -> set_userdata('msg_save_transaction', 'success');
+ $this -> session -> set_flashdata('dispense_updated', 'Patient: ' . $this -> input -> post('first_name', TRUE) . " " . $this -> input -> post('last_name', TRUE) . ' was Saved');
+ redirect("patient_management");
+ } else if ($direction == 1) {
+ redirect("dispensement_management/dispense/$auto_id");
+ }
+ }
+
+ public function getDependentStatus($patient_number_ccc){
+ $sql = "SELECT ps.name,p.patient_number_ccc,p.first_name,p.last_name,p.other_name FROM patient p
INNER JOIN patient_status ps ON ps.id = p.current_status
AND p.patient_number_ccc='$patient_number_ccc'
AND ps.name LIKE '%lost%'";
- $query = $this -> db -> query($sql);
- $result = $query -> result_array();
- if(count($result)>0){
- $patient =''.strtoupper($result[0]['first_name'].' '.$result[0]['last_name'].' '.$result[0]['other_name']).' ( CCC Number:'.$result[0]['patient_number_ccc'].')';
- return $patient;
- }else{
- return '';
- }
- }
-
- public function update($record_id) {
- $family_planning = "";
- $other_illness_listing = "";
- $other_allergies_listing = "";
- $prev_appointment = "";
- $facility = "";
- $patient = "";
-
- //Check if appointment exists
- $prev_appointment = $this -> input -> post('prev_appointment_date', TRUE);
- $appointment = $this -> input -> post('next_appointment_date', TRUE);
- $facility = $this -> session -> userdata('facility');
- $patient = $this -> input -> post('patient_number', TRUE);
- if ($appointment) {
- $sql = "select * from patient_appointment where patient='$patient' and appointment='$prev_appointment' and facility='$facility'";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- $record_no = $results[0]['id'];
- //If exisiting appointment(Update new Record)
- $sql = "update patient_appointment set appointment='$appointment',patient='$patient',facility='$facility' where id='$record_no'";
- } else {
- //If no appointment(Insert new record)
- $sql = "insert patient_appointment(patient,appointment,facility)VALUES('$patient','$appointment','$facility')";
- }
- $this -> db -> query($sql);
- }
-
- $family_planning = $this -> input -> post('family_planning_holder', TRUE);
- if ($family_planning == null) {
- $family_planning = "";
- }
- $drug_prophylaxis = $this -> input -> post('drug_prophylaxis_holder', TRUE);
- if ($drug_prophylaxis == null) {
- $drug_prophylaxis = "";
- }
- $other_illness_listing = $this -> input -> post('other_illnesses_holder', TRUE);
- if ($other_illness_listing == null) {
- $other_illness_listing = "";
- }
- $other_chronic = $this -> input -> post('other_chronic', TRUE);
- if ($other_chronic != "") {
- if ($other_illness_listing) {
- $other_illness_listing = $other_illness_listing . "," . $other_chronic;
- } else {
- $other_illness_listing = $other_chronic;
- }
- }
- //Other allergies
- $other_allergies_list = $this -> input -> post('other_allergies_listing', TRUE);
- //List of drug allergies.
- $drug_allergies = $this -> input -> post('drug_allergies_holder', TRUE);
- if ($drug_allergies == null) {
- $drug_allergies = "";
- }
-
- if ($drug_allergies != "") {
- if ($other_allergies_list) {
- $other_allergies_listing = $other_allergies_list . "," . $drug_allergies;
- } else {
- $other_allergies_listing = $drug_allergies;
- }
- }else{
- $other_allergies_listing=$other_allergies_list;
- }
-
- $other_drugs = $this -> input -> post('other_drugs', TRUE);
- if (!$other_drugs) {
- $other_drugs = "";
- }
- //echo $this -> input -> post('pregnant', TRUE);die();
- $data = array(
- 'drug_prophylaxis' => $drug_prophylaxis,
- 'isoniazid_start_date'=>$this->input->post('iso_start_date',TRUE),
- 'isoniazid_end_date'=>$this->input->post('iso_end_date',TRUE),
- 'tb_test' => $this -> input -> post('tested_tb', TRUE),
- 'who_stage' => $this -> input -> post('who_stage', TRUE),
- 'pep_reason' => $this -> input -> post('pep_reason', TRUE),
- 'Medical_Record_Number' => $this -> input -> post('medical_record_number', TRUE),
- 'Patient_Number_CCC' => $this -> input -> post('patient_number', TRUE),
- 'First_Name' => $this -> input -> post('first_name', TRUE),
- 'Last_Name' => $this -> input -> post('last_name', TRUE),
- 'Other_Name' => $this -> input -> post('other_name', TRUE),
- 'Dob' => $this -> input -> post('dob', TRUE),
- 'Pob' => $this -> input -> post('pob', TRUE),
- 'Gender' => $this -> input -> post('gender', TRUE),
- 'pregnant' => $this -> input -> post('pregnant', TRUE),
- 'Start_Weight' => $this -> input -> post('start_weight', TRUE),
- 'Start_Height' => $this -> input -> post('start_height', TRUE),
- 'Start_Bsa' => $this -> input -> post('start_bsa', TRUE),
- 'Weight' => $this -> input -> post('current_weight', TRUE),
- 'Height' => $this -> input -> post('current_height', TRUE),
- 'Sa' => $this -> input -> post('current_bsa', TRUE),
- 'Phone' => $this -> input -> post('phone', TRUE),
- 'SMS_Consent' => $this -> input -> post('sms_consent', TRUE),
- 'Physical' => $this -> input -> post('physical', TRUE),
- 'Alternate' => $this -> input -> post('alternate', TRUE),
- 'Partner_Status' => $this -> input -> post('partner_status', TRUE),
- 'Disclosure' => $this -> input -> post('disclosure', TRUE),
- 'Fplan' => $family_planning,
- 'Other_Illnesses' => $other_illness_listing,
- 'Other_Drugs' => $other_drugs,
- 'Adr' => $other_allergies_listing,
- 'Smoke' => $this -> input -> post('smoke', TRUE),
- 'Alcohol' => $this -> input -> post('alcohol', TRUE),
- 'Tb' => $this -> input -> post('tb', TRUE),
- 'tb_category' => $this -> input -> post('tbcategory', TRUE),
- 'Tbphase' => $this -> input -> post('tbphase', TRUE),
- 'Startphase' => $this -> input -> post('fromphase', TRUE),
- 'Endphase' => $this -> input -> post('tophase', TRUE),
- 'Date_Enrolled' => $this -> input -> post('enrolled', TRUE),
- 'Current_Status' => $this -> input -> post('current_status', TRUE),
- 'Status_Change_Date' => $this -> input -> post('status_started', TRUE),
- 'Source' => $this -> input -> post('source', TRUE),
- 'Transfer_From' => $this -> input -> post('transfer_source', TRUE),
- 'Supported_By' => $this -> input -> post('support', TRUE),
- 'Facility_Code' => $this -> session -> userdata('facility'),
- 'Service' => $this -> input -> post('service', TRUE),
- 'Start_Regimen' => $this -> input -> post('regimen', TRUE),
- 'Start_Regimen_Date' => $this -> input -> post('service_started', TRUE),
- 'Current_Regimen' => $this -> input -> post('current_regimen', TRUE),
- 'Nextappointment' => $this -> input -> post('next_appointment_date', TRUE));
-
- $this -> db -> where('id', $record_id);
- $this -> db -> update('patient', $data);
-
- $spouse_no=$this->input->post('match_spouse');
- $patient_no=$this->input->post('patient_number');
- $child_no=$this->input->post('match_parent');
- //Map patient to spouse but unmap all for this patient to remove duplicates
- if($spouse_no != NULL){
- $this->unmerge_spouse($patient_no);
- $this->merge_spouse($patient_no,$spouse_no);
- }
- //Map child to parent/guardian but unmap all for this patient to remove duplicates
- if($child_no != NULL){
- $this->unmerge_parent($patient_no);
- $this->merge_parent($patient_no,$child_no);
- }
-
- //Set session for notications
- $this -> session -> set_userdata('msg_save_transaction', 'success');
- $this -> session -> set_userdata('user_updated', $this -> input -> post('first_name'));
- //redirect("patient_management/viewDetails/$record_id");
- redirect("patient_management/load_view/details/$record_id");
- }
-
- public function update_visit() {
- $original_patient_number = $this -> input -> post("original_patient_number", TRUE);
- $patient_number = $this -> input -> post("patient_number", TRUE);
- //update patient visits
- $this -> db -> where('patient_id', $original_patient_number);
- $this -> db -> update('patient_visit', array("patient_id" => $patient_number));
- //update spouses
- $this->unmerge_spouse($original_patient_number);
+ $query = $this -> db -> query($sql);
+ $result = $query -> result_array();
+ if(count($result)>0){
+ $patient =''.strtoupper($result[0]['first_name'].' '.$result[0]['last_name'].' '.$result[0]['other_name']).' ( CCC Number:'.$result[0]['patient_number_ccc'].')';
+ return $patient;
+ }else{
+ return '';
+ }
+ }
+
+ public function update($record_id) {
+ $family_planning = "";
+ $other_illness_listing = "";
+ $other_allergies_listing = "";
+ $prev_appointment = "";
+ $facility = "";
+ $patient = "";
+
+ //Check if appointment exists
+ $prev_appointment = $this -> input -> post('prev_appointment_date', TRUE);
+ $appointment = $this -> input -> post('next_appointment_date', TRUE);
+ $facility = $this -> session -> userdata('facility');
+ $patient = $this -> input -> post('patient_number', TRUE);
+
+ if ($appointment) {
+ $sql = "select * from patient_appointment where patient='$patient' and appointment='$prev_appointment' and facility='$facility'";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+
+ if ($results) {
+ $record_no = $results[0]['id'];
+ //If exisiting appointment(Update new Record)
+ $sql = "update patient_appointment set appointment='$appointment',patient='$patient',facility='$facility' where id='$record_no'";
+ } else {
+ //If no appointment(Insert new record)
+ $sql = "insert patient_appointment(patient,appointment,facility)VALUES('$patient','$appointment','$facility')";
+ }
+ $this -> db -> query($sql);
+ }
+
+
+ $family_planning = $this -> input -> post('family_planning_holder', TRUE);
+ if ($family_planning == null) {
+ $family_planning = "";
+ }
+ $drug_prophylaxis = $this -> input -> post('drug_prophylaxis_holder', TRUE);
+ if ($drug_prophylaxis == null) {
+ $drug_prophylaxis = "";
+ }
+ $other_illness_listing = $this -> input -> post('other_illnesses_holder', TRUE);
+ if ($other_illness_listing == null) {
+ $other_illness_listing = "";
+ }
+ $other_chronic = $this -> input -> post('other_chronic', TRUE);
+ if ($other_chronic != "") {
+ if ($other_illness_listing) {
+ $other_illness_listing = $other_illness_listing . "," . $other_chronic;
+ } else {
+ $other_illness_listing = $other_chronic;
+ }
+ }
+ //Other allergies
+ $other_allergies_list = $this -> input -> post('other_allergies_listing', TRUE);
+ //List of drug allergies.
+ $drug_allergies = $this -> input -> post('drug_allergies_holder', TRUE);
+ if ($drug_allergies == null) {
+ $drug_allergies = "";
+ }
+
+ if ($drug_allergies != "") {
+ if ($other_allergies_list) {
+ $other_allergies_listing = $other_allergies_list . "," . $drug_allergies;
+ } else {
+ $other_allergies_listing = $drug_allergies;
+ }
+ }else{
+ $other_allergies_listing=$other_allergies_list;
+ }
+
+ $other_drugs = $this -> input -> post('other_drugs', TRUE);
+ if (!$other_drugs) {
+ $other_drugs = "";
+ }
+ //echo $this -> input -> post('pregnant', TRUE);die();
+ $data = array(
+ 'drug_prophylaxis' => $drug_prophylaxis,
+ 'isoniazid_start_date'=>$this->input->post('iso_start_date',TRUE),
+ 'isoniazid_end_date'=>$this->input->post('iso_end_date',TRUE),
+ 'tb_test' => $this -> input -> post('tested_tb', TRUE),
+ 'who_stage' => $this -> input -> post('who_stage', TRUE),
+ 'pep_reason' => $this -> input -> post('pep_reason', TRUE),
+ 'Medical_Record_Number' => $this -> input -> post('medical_record_number', TRUE),
+ 'Patient_Number_CCC' => $this -> input -> post('patient_number', TRUE),
+ 'First_Name' => $this -> input -> post('first_name', TRUE),
+ 'Last_Name' => $this -> input -> post('last_name', TRUE),
+ 'Other_Name' => $this -> input -> post('other_name', TRUE),
+ 'Dob' => $this -> input -> post('dob', TRUE),
+ 'Pob' => $this -> input -> post('pob', TRUE),
+ 'Gender' => $this -> input -> post('gender', TRUE),
+ 'pregnant' => $this -> input -> post('pregnant', TRUE),
+ 'Start_Weight' => $this -> input -> post('start_weight', TRUE),
+ 'Start_Height' => $this -> input -> post('start_height', TRUE),
+ 'Start_Bsa' => $this -> input -> post('start_bsa', TRUE),
+ 'Weight' => $this -> input -> post('current_weight', TRUE),
+ 'Height' => $this -> input -> post('current_height', TRUE),
+ 'Sa' => $this -> input -> post('current_bsa', TRUE),
+ 'Phone' => $this -> input -> post('phone', TRUE),
+ 'SMS_Consent' => $this -> input -> post('sms_consent', TRUE),
+ 'Physical' => $this -> input -> post('physical', TRUE),
+ 'Alternate' => $this -> input -> post('alternate', TRUE),
+ 'Partner_Status' => $this -> input -> post('partner_status', TRUE),
+ 'Disclosure' => $this -> input -> post('disclosure', TRUE),
+ 'Fplan' => $family_planning,
+ 'Other_Illnesses' => $other_illness_listing,
+ 'Other_Drugs' => $other_drugs,
+ 'Adr' => $other_allergies_listing,
+ 'Smoke' => $this -> input -> post('smoke', TRUE),
+ 'Alcohol' => $this -> input -> post('alcohol', TRUE),
+ 'Tb' => $this -> input -> post('tb', TRUE),
+ 'tb_category' => $this -> input -> post('tbcategory', TRUE),
+ 'Tbphase' => $this -> input -> post('tbphase', TRUE),
+ 'Startphase' => $this -> input -> post('fromphase', TRUE),
+ 'Endphase' => $this -> input -> post('tophase', TRUE),
+ 'Date_Enrolled' => $this -> input -> post('enrolled', TRUE),
+ 'Current_Status' => $this -> input -> post('current_status', TRUE),
+ 'status_change_date' => $this -> input -> post('status_started', TRUE),
+ 'Source' => $this -> input -> post('source', TRUE),
+ 'Transfer_From' => $this -> input -> post('transfer_source', TRUE),
+ 'Supported_By' => $this -> input -> post('support', TRUE),
+ 'Facility_Code' => $this -> session -> userdata('facility'),
+ 'Service' => $this -> input -> post('service', TRUE),
+ 'Start_Regimen' => $this -> input -> post('regimen', TRUE),
+ 'Start_Regimen_Date' => $this -> input -> post('service_started', TRUE),
+ 'Current_Regimen' => $this -> input -> post('current_regimen', TRUE),
+ 'Nextappointment' => $this -> input -> post('next_appointment_date', TRUE));
+ $this -> db -> update('patients');
+ $this -> db -> where('id', $record_id);
+ $this -> db -> update('patient', $data);
+
+ $spouse_no=$this->input->post('match_spouse');
+ $patient_no=$this->input->post('patient_number');
+ $child_no=$this->input->post('match_parent');
+ //Map patient to spouse but unmap all for this patient to remove duplicates
+ if($spouse_no != NULL){
+ $this->unmerge_spouse($patient_no);
+ $this->merge_spouse($patient_no,$spouse_no);
+ }
+ //Map child to parent/guardian but unmap all for this patient to remove duplicates
+ if($child_no != NULL){
+ $this->unmerge_parent($patient_no);
+ $this->merge_parent($patient_no,$child_no);
+ }
+
+ //Set session for notications
+ $this -> session -> set_userdata('msg_save_transaction', 'success');
+ $this -> session -> set_userdata('user_updated', $this -> input -> post('first_name'));
+ //redirect("patient_management/viewDetails/$record_id");
+ redirect("patient_management/load_view/details/$record_id");
+ }
+
+ public function update_visit() {
+ $original_patient_number = $this -> input -> post("original_patient_number", TRUE);
+ $patient_number = $this -> input -> post("patient_number", TRUE);
+ //update patient visits
+ $this -> db -> where('patient_id', $original_patient_number);
+ $this -> db -> update('patient_visit', array("patient_id" => $patient_number));
+ //update spouses
+ $this->unmerge_spouse($original_patient_number);
//update dependants
- $this->unmerge_parent($original_patient_number);
- }
-
- public function base_params($data) {
- $data['title'] = "webADT | Patients";
- $data['banner_text'] = "Facility Patients";
- $data['link'] = "patients";
- $this -> load -> view('template', $data);
- }
-
- public function create_timestamps() {
- $visits = Patient_Visit::getAll();
- foreach ($visits as $visit) {
- $current_date = $visit -> Dispensing_Date;
- $changed_date = strtotime($current_date);
- $visit -> Dispensing_Date_Timestamp = $changed_date;
- $visit -> save();
- }
- }
-
- public function regimen_breakdown() {
- $selected_facility = $this -> input -> post('facility');
- if (isset($selected_facility)) {
- $facility = $this -> input -> post('facility');
- }
- $data = array();
- $data['current'] = "patient_management";
- $data['title'] = "webADT | Patient Regimen Breakdown";
- $data['content_view'] = "patient_regimen_breakdown_v";
- $data['banner_text'] = "Patient Regimen Breakdown";
- $data['facilities'] = Reporting_Facility::getAll();
- //Get the regimen data
- $data['optimal_regimens'] = Regimen::getOptimalityRegimens("1");
- $data['sub_optimal_regimens'] = Regimen::getOptimalityRegimens("2");
- $months = 12;
- $months_previous = 11;
- $regimen_data = array();
- for ($current_month = 1; $current_month <= $months; $current_month++) {
- $start_date = date("Y-m-01", strtotime("-$months_previous months"));
- $end_date = date("Y-m-t", strtotime("-$months_previous months"));
- //echo $start_date." to ".$end_date."";
- if ($facility) {
- $get_month_statistics_sql = "SELECT regimen,count(patient_id) as patient_numbers,sum(months_of_stock) as months_of_stock FROM (select distinct patient_id,months_of_stock,regimen,dispensing_date from `patient_visit` where facility = '" . $facility . "' and dispensing_date between str_to_date('" . $start_date . "','%Y-%m-%d') and str_to_date('" . $end_date . "','%Y-%m-%d')) patient_visits group by regimen";
- } else {
- $get_month_statistics_sql = "SELECT regimen,count(patient_id) as patient_numbers,sum(months_of_stock) as months_of_stock FROM (select distinct patient_id,months_of_stock,regimen,dispensing_date from `patient_visit` where dispensing_date between str_to_date('" . $start_date . "','%Y-%m-%d') and str_to_date('" . $end_date . "','%Y-%m-%d')) patient_visits group by regimen";
- }
- $month_statistics_query = $this -> db -> query($get_month_statistics_sql);
- foreach ($month_statistics_query->result_array() as $month_data) {
- $regimen_data[$month_data['regimen']][$start_date] = array("patient_numbers" => $month_data['patient_numbers'], "mos" => $month_data['months_of_stock']);
- }
- //echo $get_month_statistics_sql . " ";
- $months_previous--;
- }
- $data['regimen_data'] = $regimen_data;
- $this -> load -> view("platform_template", $data);
- }
-
- public function create_appointment_timestamps() {
- /*$appointments = Patient_Appointment::getAll();
- foreach($appointments as $appointment){
- $app_date = $appointment->Appointment;
- $changed_date = strtotime($app_date);
- //echo $app_date." currently becomes ".$changed_date." which was initially ".date("m/d/Y",$changed_date)." ";
- $appointment->Appointment = $changed_date;
- $appointment->save();
- }*/
- }
-
- public function export() {
- $facility_code = $this -> session -> userdata('facility');
- $sql = "SELECT medical_record_number,patient_number_ccc,first_name,last_name,other_name,dob,pob,IF(gender=1,'MALE','FEMALE')as gender,IF(pregnant=1,'YES','NO')as pregnant,weight as Current_Weight,height as Current_height,sa as Current_BSA,p.phone,physical as Physical_Address,alternate as Alternate_Address,other_illnesses,other_drugs,adr as Drug_Allergies,IF(tb=1,'YES','NO')as TB,IF(smoke=1,'YES','NO')as smoke,IF(alcohol=1,'YES','NO')as alcohol,date_enrolled,ps.name as Patient_source,s.Name as supported_by,timestamp,facility_code,rst.name as Service,r1.regimen_desc as Start_Regimen,start_regimen_date,pst.Name as Current_status,migration_id,machine_code,IF(sms_consent=1,'YES','NO') as SMS_Consent,fplan as Family_Planning,tbphase,startphase,endphase,IF(partner_status=1,'Concordant',IF(partner_status=2,'Discordant','')) as partner_status,status_change_date,IF(partner_type=1,'YES','NO') as Disclosure,support_group,r.regimen_desc as Current_Regimen,nextappointment,start_height,start_weight,start_bsa,IF(p.transfer_from !='',f.name,'N/A') as Transfer_From,DATEDIFF(nextappointment,CURDATE()) AS Days_to_NextAppointment,dp.name as prophylaxis
+ $this->unmerge_parent($original_patient_number);
+ }
+
+ public function base_params($data) {
+ $data['title'] = "webADT | Patients";
+ $data['banner_text'] = "Facility Patients";
+ $data['link'] = "patients";
+ $this -> load -> view('template', $data);
+ }
+
+ public function create_timestamps() {
+ $visits = Patient_Visit::getAll();
+ foreach ($visits as $visit) {
+ $current_date = $visit -> Dispensing_Date;
+ $changed_date = strtotime($current_date);
+ $visit -> Dispensing_Date_Timestamp = $changed_date;
+ $visit -> save();
+ }
+ }
+
+ public function regimen_breakdown() {
+ $selected_facility = $this -> input -> post('facility');
+ if (isset($selected_facility)) {
+ $facility = $this -> input -> post('facility');
+ }
+ $data = array();
+ $data['current'] = "patient_management";
+ $data['title'] = "webADT | Patient Regimen Breakdown";
+ $data['content_view'] = "patient_regimen_breakdown_v";
+ $data['banner_text'] = "Patient Regimen Breakdown";
+ $data['facilities'] = Reporting_Facility::getAll();
+ //Get the regimen data
+ $data['optimal_regimens'] = Regimen::getOptimalityRegimens("1");
+ $data['sub_optimal_regimens'] = Regimen::getOptimalityRegimens("2");
+ $months = 12;
+ $months_previous = 11;
+ $regimen_data = array();
+ for ($current_month = 1; $current_month <= $months; $current_month++) {
+ $start_date = date("Y-m-01", strtotime("-$months_previous months"));
+ $end_date = date("Y-m-t", strtotime("-$months_previous months"));
+ //echo $start_date." to ".$end_date."";
+ if ($facility) {
+ $get_month_statistics_sql = "SELECT regimen,count(patient_id) as patient_numbers,sum(months_of_stock) as months_of_stock FROM (select distinct patient_id,months_of_stock,regimen,dispensing_date from `patient_visit` where facility = '" . $facility . "' and dispensing_date between str_to_date('" . $start_date . "','%Y-%m-%d') and str_to_date('" . $end_date . "','%Y-%m-%d')) patient_visits group by regimen";
+ } else {
+ $get_month_statistics_sql = "SELECT regimen,count(patient_id) as patient_numbers,sum(months_of_stock) as months_of_stock FROM (select distinct patient_id,months_of_stock,regimen,dispensing_date from `patient_visit` where dispensing_date between str_to_date('" . $start_date . "','%Y-%m-%d') and str_to_date('" . $end_date . "','%Y-%m-%d')) patient_visits group by regimen";
+ }
+ $month_statistics_query = $this -> db -> query($get_month_statistics_sql);
+ foreach ($month_statistics_query->result_array() as $month_data) {
+ $regimen_data[$month_data['regimen']][$start_date] = array("patient_numbers" => $month_data['patient_numbers'], "mos" => $month_data['months_of_stock']);
+ }
+ //echo $get_month_statistics_sql . " ";
+ $months_previous--;
+ }
+ $data['regimen_data'] = $regimen_data;
+ $this -> load -> view("platform_template", $data);
+ }
+
+ public function create_appointment_timestamps() {
+ /*$appointments = Patient_Appointment::getAll();
+ foreach($appointments as $appointment){
+ $app_date = $appointment->Appointment;
+ $changed_date = strtotime($app_date);
+ //echo $app_date." currently becomes ".$changed_date." which was initially ".date("m/d/Y",$changed_date)." ";
+ $appointment->Appointment = $changed_date;
+ $appointment->save();
+ }*/
+ }
+
+ public function export() {
+ $facility_code = $this -> session -> userdata('facility');
+ $sql = "SELECT medical_record_number,patient_number_ccc,first_name,last_name,other_name,dob,pob,IF(gender=1,'MALE','FEMALE')as gender,IF(pregnant=1,'YES','NO')as pregnant,weight as Current_Weight,height as Current_height,sa as Current_BSA,p.phone,physical as Physical_Address,alternate as Alternate_Address,other_illnesses,other_drugs,adr as Drug_Allergies,IF(tb=1,'YES','NO')as TB,IF(smoke=1,'YES','NO')as smoke,IF(alcohol=1,'YES','NO')as alcohol,date_enrolled,ps.name as Patient_source,s.Name as supported_by,timestamp,facility_code,rst.name as Service,r1.regimen_desc as Start_Regimen,start_regimen_date,pst.Name as Current_status,migration_id,machine_code,IF(sms_consent=1,'YES','NO') as SMS_Consent,fplan as Family_Planning,tbphase,startphase,endphase,IF(partner_status=1,'Concordant',IF(partner_status=2,'Discordant','')) as partner_status,status_change_date,IF(partner_type=1,'YES','NO') as Disclosure,support_group,r.regimen_desc as Current_Regimen,nextappointment,start_height,start_weight,start_bsa,IF(p.transfer_from !='',f.name,'N/A') as Transfer_From,DATEDIFF(nextappointment,CURDATE()) AS Days_to_NextAppointment,dp.name as prophylaxis
FROM patient p
left join regimen r on r.id=p.current_regimen
left join regimen r1 on r1.id=p.start_regimen
@@ -799,189 +810,189 @@ public function export() {
left join drug_prophylaxis dp on dp.id=p.drug_prophylaxis
WHERE facility_code='$facility_code'
ORDER BY p.patient_number_ccc ASC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
-
- $objPHPExcel = new PHPExcel();
- $objPHPExcel -> setActiveSheetIndex(0);
- $i = 1;
-
- $objPHPExcel -> getActiveSheet() -> SetCellValue('A' . $i, "medical_record_number");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B' . $i, "patient_number_ccc");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, "first_name");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, "last_name");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, "other_name");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, "dob");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, "pob");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, "gender");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, "pregnant");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, "Current_Weight");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, "Current_height");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, "Current_BSA");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, "phone");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, "Physical_Address");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('O' . $i, "Alternate_Address");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('P' . $i, "other_illnesses");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Q' . $i, "other_drugs");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('R' . $i, "Drug_Allergies");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('S' . $i, "TB");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('T' . $i, "smoke");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('U' . $i, "alcohol");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('V' . $i, "date_enrolled");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('W' . $i, "Patient_source");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('X' . $i, "supported_by");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Y' . $i, "timestamp");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Z' . $i, "facility_code");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AA' . $i, "pob");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AB' . $i, "Service");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AC' . $i, "Start_Regimen");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AD' . $i, "start_regimen_date");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AE' . $i, "Current_status");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AF' . $i, "migration_id");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AG' . $i, "machine_code");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AH' . $i, "SMS_Consent");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AI' . $i, "Family_Planning");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AJ' . $i, "tbphase");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AK' . $i, "startphase");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AL' . $i, "endphase");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AM' . $i, "partner_status");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AN' . $i, "status_change_date");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AO' . $i, "Disclosure");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AP' . $i, "support_group");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AQ' . $i, "Current_Regimen");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AR' . $i, "nextappointment");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AS' . $i, "start_height");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AT' . $i, "start_weight");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AU' . $i, "start_bsa");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AV' . $i, "Transfer_From");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AW' . $i, "Days_To_NextAppointment");
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AY' . $i, "Drug_Prophylaxis");
-
- foreach ($results as $result) {
- $i++;
- $objPHPExcel -> getActiveSheet() -> SetCellValue('A' . $i, $result["medical_record_number"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('B' . $i, $result["patient_number_ccc"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $result["first_name"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $result["last_name"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $result["other_name"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $result["dob"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $result["pob"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $result["gender"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $result["pregnant"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $result["Current_Weight"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $result["Current_height"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $result["Current_BSA"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $result["phone"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, $result["Physical_Address"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('O' . $i, $result["Alternate_Address"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('P' . $i, $result["other_illnesses"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Q' . $i, $result["other_drugs"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('R' . $i, $result["Drug_Allergies"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('S' . $i, $result["TB"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('T' . $i, $result["smoke"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('U' . $i, $result["alcohol"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('V' . $i, $result["date_enrolled"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('W' . $i, $result["Patient_source"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('X' . $i, $result["supported_by"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Y' . $i, $result["timestamp"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('Z' . $i, $result["facility_code"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AA' . $i, $result["pob"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AB' . $i, $result["Service"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AC' . $i, $result["Start_Regimen"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AD' . $i, $result["start_regimen_date"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AE' . $i, $result["Current_status"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AF' . $i, $result["migration_id"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AG' . $i, $result["machine_code"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AH' . $i, $result["SMS_Consent"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AI' . $i, $result["Family_Planning"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AJ' . $i, $result["tbphase"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AK' . $i, $result["startphase"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AL' . $i, $result["endphase"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AM' . $i, $result["partner_status"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AN' . $i, $result["status_change_date"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AO' . $i, $result["Disclosure"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AP' . $i, $result["support_group"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AQ' . $i, $result["Current_Regimen"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AR' . $i, $result["nextappointment"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AS' . $i, $result["start_height"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AT' . $i, $result["start_weight"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AU' . $i, $result["start_bsa"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AV' . $i, $result["Transfer_From"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AW' . $i, $result["Days_to_NextAppointment"]);
- $objPHPExcel -> getActiveSheet() -> SetCellValue('AY' . $i, $result["prophylaxis"]);
-
- }
-
- if (ob_get_contents())
- ob_end_clean();
- $filename = "Patient Master For " . $facility_code . ".csv";
- header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
- header("Cache-Control: no-store, no-cache, must-revalidate");
- header("Cache-Control: post-check=0, pre-check=0", false);
- header("Pragma: no-cache");
- header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
- header('Content-Disposition: attachment;filename=' . $filename);
-
- $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
-
- $objWriter -> save('php://output');
-
- $objPHPExcel -> disconnectWorksheets();
- unset($objPHPExcel);
-
- }
-
- public function enable($id) {
- $sql = "update patient set active='1' where id='$id'";
- $this -> db -> query($sql);
- $get_user = "select first_name FROM patient WHERE id='$id' LIMIT 1";
- $user_sql = $this -> db -> query($get_user);
- $user_array = $user_sql -> result_array();
- $first_name = "";
- foreach ($user_array as $value) {
- $first_name = $value['first_name'];
- }
- //Set session for notications
- $this -> session -> set_userdata('msg_save_transaction', 'success');
- $this -> session -> set_userdata('user_enabled', $first_name." was enabled!");
- redirect("patient_management");
- }
-
- public function disable($id) {
- $sql = "update patient set active='0' where id='$id'";
- $this -> db -> query($sql);
- $get_user = "select first_name FROM patient WHERE id='$id' LIMIT 1";
- $user_sql = $this -> db -> query($get_user);
- $user_array = $user_sql -> result_array();
- $first_name = "";
- foreach ($user_array as $value) {
- $first_name = $value['first_name'];
- }
- //Set session for notications
- $this -> session -> set_userdata('msg_save_transaction', 'success');
- $this -> session -> set_userdata('user_disabled', $first_name." was disabled!");
- redirect("patient_management");
- }
-
- public function delete($id) {
- $sql = "DELETE FROM patient where id='$id' and active='0'";
- $this -> db -> query($sql);
- //Set session for notications
- $this -> session -> set_userdata('msg_save_transaction', 'success');
- $this -> session -> set_userdata('user_disabled', "User Deleted");
- redirect("patient_management");
- }
-
- public function getAppointments($appointment = "") {
- $results = "";
- $sql = "select count(distinct(patient)) as total_appointments,weekend_max,weekday_max from patient_appointment pa,facilities f where pa.appointment = '$appointment' and f.facilitycode=pa.facility";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- echo json_encode($results);
- }
-
- public function getSixMonthsDispensing($patient_no) {
- $dyn_table = "";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+
+ $objPHPExcel = new PHPExcel();
+ $objPHPExcel -> setActiveSheetIndex(0);
+ $i = 1;
+
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('A' . $i, "medical_record_number");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('B' . $i, "patient_number_ccc");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, "first_name");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, "last_name");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, "other_name");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, "dob");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, "pob");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, "gender");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, "pregnant");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, "Current_Weight");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, "Current_height");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, "Current_BSA");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, "phone");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, "Physical_Address");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('O' . $i, "Alternate_Address");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('P' . $i, "other_illnesses");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Q' . $i, "other_drugs");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('R' . $i, "Drug_Allergies");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('S' . $i, "TB");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('T' . $i, "smoke");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('U' . $i, "alcohol");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('V' . $i, "date_enrolled");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('W' . $i, "Patient_source");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('X' . $i, "supported_by");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Y' . $i, "timestamp");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Z' . $i, "facility_code");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AA' . $i, "pob");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AB' . $i, "Service");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AC' . $i, "Start_Regimen");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AD' . $i, "start_regimen_date");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AE' . $i, "Current_status");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AF' . $i, "migration_id");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AG' . $i, "machine_code");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AH' . $i, "SMS_Consent");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AI' . $i, "Family_Planning");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AJ' . $i, "tbphase");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AK' . $i, "startphase");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AL' . $i, "endphase");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AM' . $i, "partner_status");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AN' . $i, "status_change_date");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AO' . $i, "Disclosure");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AP' . $i, "support_group");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AQ' . $i, "Current_Regimen");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AR' . $i, "nextappointment");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AS' . $i, "start_height");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AT' . $i, "start_weight");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AU' . $i, "start_bsa");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AV' . $i, "Transfer_From");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AW' . $i, "Days_To_NextAppointment");
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AY' . $i, "Drug_Prophylaxis");
+
+ foreach ($results as $result) {
+ $i++;
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('A' . $i, $result["medical_record_number"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('B' . $i, $result["patient_number_ccc"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('C' . $i, $result["first_name"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('D' . $i, $result["last_name"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('E' . $i, $result["other_name"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('F' . $i, $result["dob"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('G' . $i, $result["pob"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('H' . $i, $result["gender"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('I' . $i, $result["pregnant"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('J' . $i, $result["Current_Weight"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('K' . $i, $result["Current_height"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('L' . $i, $result["Current_BSA"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('M' . $i, $result["phone"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('N' . $i, $result["Physical_Address"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('O' . $i, $result["Alternate_Address"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('P' . $i, $result["other_illnesses"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Q' . $i, $result["other_drugs"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('R' . $i, $result["Drug_Allergies"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('S' . $i, $result["TB"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('T' . $i, $result["smoke"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('U' . $i, $result["alcohol"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('V' . $i, $result["date_enrolled"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('W' . $i, $result["Patient_source"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('X' . $i, $result["supported_by"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Y' . $i, $result["timestamp"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('Z' . $i, $result["facility_code"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AA' . $i, $result["pob"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AB' . $i, $result["Service"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AC' . $i, $result["Start_Regimen"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AD' . $i, $result["start_regimen_date"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AE' . $i, $result["Current_status"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AF' . $i, $result["migration_id"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AG' . $i, $result["machine_code"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AH' . $i, $result["SMS_Consent"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AI' . $i, $result["Family_Planning"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AJ' . $i, $result["tbphase"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AK' . $i, $result["startphase"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AL' . $i, $result["endphase"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AM' . $i, $result["partner_status"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AN' . $i, $result["status_change_date"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AO' . $i, $result["Disclosure"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AP' . $i, $result["support_group"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AQ' . $i, $result["Current_Regimen"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AR' . $i, $result["nextappointment"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AS' . $i, $result["start_height"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AT' . $i, $result["start_weight"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AU' . $i, $result["start_bsa"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AV' . $i, $result["Transfer_From"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AW' . $i, $result["Days_to_NextAppointment"]);
+ $objPHPExcel -> getActiveSheet() -> SetCellValue('AY' . $i, $result["prophylaxis"]);
+
+ }
+
+ if (ob_get_contents())
+ ob_end_clean();
+ $filename = "Patient Master For " . $facility_code . ".csv";
+ header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
+ header("Cache-Control: no-store, no-cache, must-revalidate");
+ header("Cache-Control: post-check=0, pre-check=0", false);
+ header("Pragma: no-cache");
+ header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
+ header('Content-Disposition: attachment;filename=' . $filename);
+
+ $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'CSV');
+
+ $objWriter -> save('php://output');
+
+ $objPHPExcel -> disconnectWorksheets();
+ unset($objPHPExcel);
+
+ }
+
+ public function enable($id) {
+ $sql = "update patient set active='1' where id='$id'";
+ $this -> db -> query($sql);
+ $get_user = "select first_name FROM patient WHERE id='$id' LIMIT 1";
+ $user_sql = $this -> db -> query($get_user);
+ $user_array = $user_sql -> result_array();
+ $first_name = "";
+ foreach ($user_array as $value) {
+ $first_name = $value['first_name'];
+ }
+ //Set session for notications
+ $this -> session -> set_userdata('msg_save_transaction', 'success');
+ $this -> session -> set_userdata('user_enabled', $first_name." was enabled!");
+ redirect("patient_management");
+ }
+
+ public function disable($id) {
+ $sql = "update patient set active='0' where id='$id'";
+ $this -> db -> query($sql);
+ $get_user = "select first_name FROM patient WHERE id='$id' LIMIT 1";
+ $user_sql = $this -> db -> query($get_user);
+ $user_array = $user_sql -> result_array();
+ $first_name = "";
+ foreach ($user_array as $value) {
+ $first_name = $value['first_name'];
+ }
+ //Set session for notications
+ $this -> session -> set_userdata('msg_save_transaction', 'success');
+ $this -> session -> set_userdata('user_disabled', $first_name." was disabled!");
+ redirect("patient_management");
+ }
+
+ public function delete($id) {
+ $sql = "DELETE FROM patient where id='$id' and active='0'";
+ $this -> db -> query($sql);
+ //Set session for notications
+ $this -> session -> set_userdata('msg_save_transaction', 'success');
+ $this -> session -> set_userdata('user_disabled', "User Deleted");
+ redirect("patient_management");
+ }
+
+ public function getAppointments($appointment = "") {
+ $results = "";
+ $sql = "select count(distinct(patient)) as total_appointments,weekend_max,weekday_max from patient_appointment pa,facilities f where pa.appointment = '$appointment' and f.facilitycode=pa.facility";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ echo json_encode($results);
+ }
+
+ public function getSixMonthsDispensing($patient_no) {
+ $dyn_table = "";
$facility = $this -> session -> userdata("facility");
$sql = "SELECT
@@ -999,410 +1010,410 @@ public function getSixMonthsDispensing($patient_no) {
WHERE pv.patient_id LIKE '%$patient_no%'
AND pv.facility = '$facility'
ORDER BY pv.dispensing_date DESC";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
-
- if ($results)
- {
- foreach ($results as $result)
- {
- $dyn_table .= "";
- $dyn_table .= "" . $result['dispensing_date'] . " ";
- $dyn_table .= "" . $result['drug'] . " ";
- $dyn_table .= "" . $result['quantity'] . " ";
- $dyn_table .= "" . $result['pill_count'] . " ";
- $dyn_table .= "" . $result['missed_pills'] . " ";
- $dyn_table .= "" . $result['pill_adh'] . "% ";
- $dyn_table .= "" . $result['missed_adh'] . "% ";
-
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+
+ if ($results)
+ {
+ foreach ($results as $result)
+ {
+ $dyn_table .= " ";
+ $dyn_table .= "" . $result['dispensing_date'] . " ";
+ $dyn_table .= "" . $result['drug'] . " ";
+ $dyn_table .= "" . $result['quantity'] . " ";
+ $dyn_table .= "" . $result['pill_count'] . " ";
+ $dyn_table .= "" . $result['missed_pills'] . " ";
+ $dyn_table .= "" . $result['pill_adh'] . "% ";
+ $dyn_table .= "" . $result['missed_adh'] . "% ";
+
$adherence = doubleval(str_replace(array("%","<",">","="), "", $result['adherence']));
- $average_adherence = (( doubleval($result['pill_adh']) + doubleval($result['missed_adh']) + $adherence) / 3);
- $dyn_table .= "" . $adherence . "% ";
- $dyn_table .= "" . number_format($average_adherence,2) . "% ";
- $dyn_table .= " "; }
- }
- echo $dyn_table;
- }
-
- public function old_getSixMonthsDispensing($patient_no) {
- $facility = $this -> session -> userdata("facility");
- $dyn_table = "";
- $sql ="SELECT pv.pill_count,"
- . "pv.missed_pills,"
- . "ds.frequency,"
- . "ds.value,"
- . "pv.months_of_stock,"
- . "pv.adherence,"
- . "pv.dispensing_date,"
- . "d.drug,"
- . "pv.quantity"
- . " from patient_visit pv"
- . " left join drugcode d on d.id=pv.drug_id "
- . "left join dose ds on ds.Name=pv.dose "
- . "where patient_id = '$patient_no' "
- . "and datediff(curdate(),dispensing_date)<=360 "
- . "and datediff(curdate(),dispensing_date)>=0 "
- . "and pv.facility='$facility'"
- . "and pv.active='1'"
- . "order by pv.dispensing_date desc";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- foreach ($results as $result) {
- if ($result['pill_count'] == "") {
- $result['pill_count'] = "-";
- }
- if ($result['missed_pills'] == "") {
- $result['missed_pills'] = "-";
- }
- //Calculate Adherence for Missed Pills
- if ($result['frequency'] == 1) {
- if ($result['missed_pills'] <= 0) {
- $self_reporting = "100%";
- } else if ($result['missed_pills'] < 2 && $result['missed_pills'] > 0) {
- $self_reporting = "≥95%";
- } else if ($result['missed_pills'] >= 2 && $result['missed_pills'] <= 4) {
- $self_reporting = "84-94%";
- } else if ($result['missed_pills'] >= 5) {
- $self_reporting = "<85%";
- }
- } else if ($result['frequency'] == 2) {
- if ($result['missed_pills'] <= 0) {
- $self_reporting = "100%";
- } else if ($result['missed_pills'] <= 3 && $result['missed_pills'] > 0) {
- $self_reporting = "≥95%";
- } else if ($result['missed_pills'] >= 4 && $result['missed_pills'] <= 8) {
- $self_reporting = "84-94%";
- } else if ($result['missed_pills'] >= 9) {
- $self_reporting = "<85%";
- }
- } else {
- $self_reporting = "-";
- }
-
- //Calculate Adherence for Pill Count(formula)
- $dosage_frequency = ($result['frequency'] * $result['value']);
- $actual_pill_count = $result['pill_count'];
- $expected_pill_count = $result['months_of_stock'];
-
- $numerator = ($expected_pill_count - $actual_pill_count);
- $denominator = ($dosage_frequency * 30);
- //$denominator=$expected_pill_count;
- if ($denominator > 0) {
- $pill_count_reporting = ($numerator / $denominator) * 100;
- $pill_count_reporting = number_format($pill_count_reporting, 2) . "%";
- } else {
- $pill_count_reporting = "-";
- }
-
- if ($result['adherence'] == " ") {
- $result['adherence'] = "-";
- }
-
- $dyn_table .= "" . date('d-M-Y', strtotime($result['dispensing_date'])) . " " . $result['drug'] . " " . $result['quantity'] . " " . $result['pill_count'] . " " . $result['missed_pills'] . " " . $pill_count_reporting . " " . $self_reporting . " " . $result['adherence'] . " ";
- }
- }
- echo $dyn_table;
- }
-
- public function getRegimenChange($patient_no) {
- $dyn_table = "";
- $facility = $this -> session -> userdata("facility");
- $sql = "select dispensing_date, r1.regimen_desc as current_regimen, r2.regimen_desc as previous_regimen, if(rc.name is null,pv.regimen_change_reason,rc.name) as reason "
- . "from patient_visit pv "
- . "left join regimen r1 on pv.regimen = r1.id"
- . " left join regimen r2 on pv.last_regimen = r2.id"
- . " left join regimen_change_purpose rc on pv.regimen_change_reason = rc.id "
- . "where pv.patient_id LIKE '%$patient_no%' "
- . "and pv.facility = '$facility' "
- . "and pv.regimen != pv.last_regimen "
- . "group by dispensing_date,pv.regimen "
- . "order by pv.dispensing_date desc";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- foreach ($results as $result) {
- if ($result['current_regimen'] == "") {
- $result['current_regimen'] = "-";
- }
- if ($result['previous_regimen'] == "") {
- $result['previous_regimen'] = "-";
- }
- if ($result['reason'] == "") {
- $result['reason'] = "-";
- } elseif ($result['reason'] == "undefined") {
- $result['reason'] = "-";
- } elseif ($result['reason'] == "null") {
- $result['reason'] = "-";
- }
- //if ($result['current_regimen'] == "-") {
- $dyn_table .= "" . date('d-M-Y', strtotime($result['dispensing_date'])) . " " . $result['current_regimen'] . " " . $result['previous_regimen'] . " " . $result['reason'] . " ";
- //}
- }
- }
- echo $dyn_table;
- }
-
- public function getAppointmentHistory($patient_no) {
- $dyn_table = "";
- $status = "";
- $facility = $this -> session -> userdata("facility");
- $sql = "SELECT pa.appointment,IF(pa.appointment=pv.dispensing_date,'Visited',DATEDIFF(pa.appointment,curdate()))as Days_To
+ $average_adherence = (( doubleval($result['pill_adh']) + doubleval($result['missed_adh']) + $adherence) / 3);
+ $dyn_table .= "" . $adherence . "% ";
+ $dyn_table .= "" . number_format($average_adherence,2) . "% ";
+ $dyn_table .= ""; }
+ }
+ echo $dyn_table;
+ }
+
+ public function old_getSixMonthsDispensing($patient_no) {
+ $facility = $this -> session -> userdata("facility");
+ $dyn_table = "";
+ $sql ="SELECT pv.pill_count,"
+ . "pv.missed_pills,"
+ . "ds.frequency,"
+ . "ds.value,"
+ . "pv.months_of_stock,"
+ . "pv.adherence,"
+ . "pv.dispensing_date,"
+ . "d.drug,"
+ . "pv.quantity"
+ . " from patient_visit pv"
+ . " left join drugcode d on d.id=pv.drug_id "
+ . "left join dose ds on ds.Name=pv.dose "
+ . "where patient_id = '$patient_no' "
+ . "and datediff(curdate(),dispensing_date)<=360 "
+ . "and datediff(curdate(),dispensing_date)>=0 "
+ . "and pv.facility='$facility'"
+ . "and pv.active='1'"
+ . "order by pv.dispensing_date desc";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ foreach ($results as $result) {
+ if ($result['pill_count'] == "") {
+ $result['pill_count'] = "-";
+ }
+ if ($result['missed_pills'] == "") {
+ $result['missed_pills'] = "-";
+ }
+ //Calculate Adherence for Missed Pills
+ if ($result['frequency'] == 1) {
+ if ($result['missed_pills'] <= 0) {
+ $self_reporting = "100%";
+ } else if ($result['missed_pills'] < 2 && $result['missed_pills'] > 0) {
+ $self_reporting = "≥95%";
+ } else if ($result['missed_pills'] >= 2 && $result['missed_pills'] <= 4) {
+ $self_reporting = "84-94%";
+ } else if ($result['missed_pills'] >= 5) {
+ $self_reporting = "<85%";
+ }
+ } else if ($result['frequency'] == 2) {
+ if ($result['missed_pills'] <= 0) {
+ $self_reporting = "100%";
+ } else if ($result['missed_pills'] <= 3 && $result['missed_pills'] > 0) {
+ $self_reporting = "≥95%";
+ } else if ($result['missed_pills'] >= 4 && $result['missed_pills'] <= 8) {
+ $self_reporting = "84-94%";
+ } else if ($result['missed_pills'] >= 9) {
+ $self_reporting = "<85%";
+ }
+ } else {
+ $self_reporting = "-";
+ }
+
+ //Calculate Adherence for Pill Count(formula)
+ $dosage_frequency = ($result['frequency'] * $result['value']);
+ $actual_pill_count = $result['pill_count'];
+ $expected_pill_count = $result['months_of_stock'];
+
+ $numerator = ($expected_pill_count - $actual_pill_count);
+ $denominator = ($dosage_frequency * 30);
+ //$denominator=$expected_pill_count;
+ if ($denominator > 0) {
+ $pill_count_reporting = ($numerator / $denominator) * 100;
+ $pill_count_reporting = number_format($pill_count_reporting, 2) . "%";
+ } else {
+ $pill_count_reporting = "-";
+ }
+
+ if ($result['adherence'] == " ") {
+ $result['adherence'] = "-";
+ }
+
+ $dyn_table .= "" . date('d-M-Y', strtotime($result['dispensing_date'])) . " " . $result['drug'] . " " . $result['quantity'] . " " . $result['pill_count'] . " " . $result['missed_pills'] . " " . $pill_count_reporting . " " . $self_reporting . " " . $result['adherence'] . " ";
+ }
+ }
+ echo $dyn_table;
+ }
+
+ public function getRegimenChange($patient_no) {
+ $dyn_table = "";
+ $facility = $this -> session -> userdata("facility");
+ $sql = "select dispensing_date, r1.regimen_desc as current_regimen, r2.regimen_desc as previous_regimen, if(rc.name is null,pv.regimen_change_reason,rc.name) as reason "
+ . "from patient_visit pv "
+ . "left join regimen r1 on pv.regimen = r1.id"
+ . " left join regimen r2 on pv.last_regimen = r2.id"
+ . " left join regimen_change_purpose rc on pv.regimen_change_reason = rc.id "
+ . "where pv.patient_id LIKE '%$patient_no%' "
+ . "and pv.facility = '$facility' "
+ . "and pv.regimen != pv.last_regimen "
+ . "group by dispensing_date,pv.regimen "
+ . "order by pv.dispensing_date desc";
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ foreach ($results as $result) {
+ if ($result['current_regimen'] == "") {
+ $result['current_regimen'] = "-";
+ }
+ if ($result['previous_regimen'] == "") {
+ $result['previous_regimen'] = "-";
+ }
+ if ($result['reason'] == "") {
+ $result['reason'] = "-";
+ } elseif ($result['reason'] == "undefined") {
+ $result['reason'] = "-";
+ } elseif ($result['reason'] == "null") {
+ $result['reason'] = "-";
+ }
+ //if ($result['current_regimen'] == "-") {
+ $dyn_table .= "" . date('d-M-Y', strtotime($result['dispensing_date'])) . " " . $result['current_regimen'] . " " . $result['previous_regimen'] . " " . $result['reason'] . " ";
+ //}
+ }
+ }
+ echo $dyn_table;
+ }
+
+ public function getAppointmentHistory($patient_no) {
+ $dyn_table = "";
+ $status = "";
+ $facility = $this -> session -> userdata("facility");
+ $sql = "SELECT pa.appointment,IF(pa.appointment=pv.dispensing_date,'Visited',DATEDIFF(pa.appointment,curdate()))as Days_To
FROM(SELECT patient,appointment FROM patient_appointment pa WHERE patient LIKE '%$patient_no%' AND facility='$facility') as pa,(SELECT patient_id,dispensing_date FROM patient_visit WHERE patient_id LIKE '%$patient_no%' AND facility='$facility') as pv GROUP BY pa.appointment ORDER BY pa.appointment desc";
- $query = $this -> db -> query($sql);
- $results = $query -> result_array();
- if ($results) {
- foreach ($results as $result) {
-
- if ($result['Days_To'] > 0) {
- $status = "" . $result['Days_To'] . " Days To ";
- } else if ($result['Days_To'] < 0) {
- $mysql = "select dispensing_date,DATEDIFF(dispensing_date,'" . @$result['appointment'] . "')as days from patient_visit where patient_id='$patient_no' and dispensing_date>'" . @$result['appointment'] . "' and facility='$facility' ORDER BY dispensing_date asc LIMIT 1";
- $myquery = $this -> db -> query($mysql);
- $myresults = $myquery -> result_array();
- $result['dispensing_date'] = date('Y-m-d');
- if ($myresults) {
- $result['dispensing_date'] = $myresults[0]['dispensing_date'];
- $result['Days_To'] = $myresults[0]['days'];
- }
- $result['Days_To'] = str_replace("-", "", $result['Days_To']);
- $status = " Late By " . $result['Days_To'] . " Days (" . date('d-M-Y', strtotime($result['dispensing_date'])) . ") ";
- } else {
- $status = "" . $result['Days_To'] . " ";
- }
-
- $dyn_table .= "" . date('d-M-Y', strtotime($result['appointment'])) . " $status ";
- }
- }
- echo $dyn_table;
- }
-
- public function updateLastRegimen() {
-
- //Get list of patients who changed regimen
- $sql_patient = "SELECT DISTINCT(p.id) as patient_id FROM patient p
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ if ($results) {
+ foreach ($results as $result) {
+
+ if ($result['Days_To'] > 0) {
+ $status = "" . $result['Days_To'] . " Days To ";
+ } else if ($result['Days_To'] < 0) {
+ $mysql = "select dispensing_date,DATEDIFF(dispensing_date,'" . @$result['appointment'] . "')as days from patient_visit where patient_id='$patient_no' and dispensing_date>'" . @$result['appointment'] . "' and facility='$facility' ORDER BY dispensing_date asc LIMIT 1";
+ $myquery = $this -> db -> query($mysql);
+ $myresults = $myquery -> result_array();
+ $result['dispensing_date'] = date('Y-m-d');
+ if ($myresults) {
+ $result['dispensing_date'] = $myresults[0]['dispensing_date'];
+ $result['Days_To'] = $myresults[0]['days'];
+ }
+ $result['Days_To'] = str_replace("-", "", $result['Days_To']);
+ $status = " Late By " . $result['Days_To'] . " Days (" . date('d-M-Y', strtotime($result['dispensing_date'])) . ") ";
+ } else {
+ $status = "" . $result['Days_To'] . " ";
+ }
+
+ $dyn_table .= "" . date('d-M-Y', strtotime($result['appointment'])) . " $status ";
+ }
+ }
+ echo $dyn_table;
+ }
+
+ public function updateLastRegimen() {
+
+ //Get list of patients who changed regimen
+ $sql_patient = "SELECT DISTINCT(p.id) as patient_id FROM patient p
LEFT JOIN patient_visit pv ON pv.patient_id=p.id
WHERE pv.regimen_change_reason IS NOT NULL";
- $query_exec = $this -> db -> query($sql_patient);
- $patients = $query_exec -> result_array();
- foreach ($patients as $patient) {
- $patient_id = $patient["patient_id"];
- $sql = "SELECT * FROM patient_visit WHERE regimen_change_reason IS NOT NULL AND patient_id =" . $patient_id . " ORDER BY dispensing_date ASC";
-
- $query = $this -> db -> query($sql);
- $result = $query -> result_array();
- foreach ($result as $key => $value) {
-
- if ($key == 0) {//For the first in the list, get the previous regimen under which the patient was
- $curr_disp = $result[$key]["dispensing_date"];
- $s = "SELECT * from patient_visit WHERE dispensing_date <'" . $curr_disp . "' AND patient_id =" . $patient_id . " ORDER BY dispensing_date DESC LIMIT 1";
-
- $q = $this -> db -> query($s);
- $res = $q -> result_array();
-
- if (count($res) > 0) {
- //echo (count($res))." ";
- $regimen = $res[0]["regimen"];
- $sql = "UPDATE patient_visit SET last_regimen =" . $regimen . " WHERE id =" . $result[$key]["id"];
- $q = $this -> db -> query($sql);
- }
- } else {
- $x = $key - 1;
- //Get last regimen
-
- //Check if patients was not dispensed under same regimen
- if ($result[$x]["regimen"] != $result[$key]["regimen"]) {
- //Update current_patient visit last regimen column
- $sql = "UPDATE patient_visit SET last_regimen =" . $result[$x]["regimen"] . " WHERE id =" . $result[$key]["id"];
- $query = $this -> db -> query($sql);
- $count = $this -> db -> affected_rows();
- }
- }
- }
- }
-
- }
-
- public function updatePregnancyStatus(){
- $patient_ccc = $this -> input ->post("patient_ccc");
- //Check if patient is on PMTCT and change them to ART
- $sql = "SELECT rst.name FROM patient p
+ $query_exec = $this -> db -> query($sql_patient);
+ $patients = $query_exec -> result_array();
+ foreach ($patients as $patient) {
+ $patient_id = $patient["patient_id"];
+ $sql = "SELECT * FROM patient_visit WHERE regimen_change_reason IS NOT NULL AND patient_id =" . $patient_id . " ORDER BY dispensing_date ASC";
+
+ $query = $this -> db -> query($sql);
+ $result = $query -> result_array();
+ foreach ($result as $key => $value) {
+
+ if ($key == 0) {//For the first in the list, get the previous regimen under which the patient was
+ $curr_disp = $result[$key]["dispensing_date"];
+ $s = "SELECT * from patient_visit WHERE dispensing_date <'" . $curr_disp . "' AND patient_id =" . $patient_id . " ORDER BY dispensing_date DESC LIMIT 1";
+
+ $q = $this -> db -> query($s);
+ $res = $q -> result_array();
+
+ if (count($res) > 0) {
+ //echo (count($res))." ";
+ $regimen = $res[0]["regimen"];
+ $sql = "UPDATE patient_visit SET last_regimen =" . $regimen . " WHERE id =" . $result[$key]["id"];
+ $q = $this -> db -> query($sql);
+ }
+ } else {
+ $x = $key - 1;
+ //Get last regimen
+
+ //Check if patients was not dispensed under same regimen
+ if ($result[$x]["regimen"] != $result[$key]["regimen"]) {
+ //Update current_patient visit last regimen column
+ $sql = "UPDATE patient_visit SET last_regimen =" . $result[$x]["regimen"] . " WHERE id =" . $result[$key]["id"];
+ $query = $this -> db -> query($sql);
+ $count = $this -> db -> affected_rows();
+ }
+ }
+ }
+ }
+
+ }
+
+ public function updatePregnancyStatus(){
+ $patient_ccc = $this -> input ->post("patient_ccc");
+ //Check if patient is on PMTCT and change them to ART
+ $sql = "SELECT rst.name FROM patient p
LEFT JOIN regimen_service_type rst ON p.service = rst.id
WHERE p.patient_number_ccc ='$patient_ccc'";
- $query = $this ->db ->query($sql);
- $result = $query ->result_array();
- $service = $result[0]['name'];
- $extra ='';
- if (stripos($service, "pmtct")===0){
- $sql_get_art = "SELECT id FROM regimen_service_type WHERE name LIKE '%art%'";
- $query = $this ->db ->query($sql_get_art);
- $result = $query ->result_array();
- $art_service_id = $result[0]['id'];
- $extra = ", service = '$art_service_id' ";
- }
- $sql = "UPDATE patient SET pregnant = '0' $extra WHERE patient_number_ccc ='$patient_ccc'";
- $this ->db ->query($sql);
- $count = $this -> db -> affected_rows();
-
- }
- public function update_tb_status() {
- $patient_ccc = $this -> input ->post("patient_ccc");
- $tb_sql = "UPDATE patient SET tb = '0' WHERE patient_number_ccc ='$patient_ccc'";
- $this ->db ->query($tb_sql);
- $count = $this -> db -> affected_rows();
- }
-
- public function getWhoStage(){
- $patient_ccc = $this -> input ->post("patient_ccc");
- $sql = "SELECT who_stage FROM patient WHERE patient_number_ccc ='$patient_ccc' LIMIT 1";
- $res = $this ->db ->query($sql);
- $result = $res ->result_array();
- $data['patient_who'] = trim($result[0]['who_stage']);
- $sql = "SELECT * FROM who_stage";
- $res = $this ->db ->query($sql);
- $result = $res ->result_array();
- $data['who_stage'] = $result;
- echo json_encode($data);
- }
-
- public function updateWhoStage(){
- $patient_ccc = $this -> input ->post("patient_ccc");
- $who_stage = $this -> input ->post("who_stage");
- $sql = "UPDATE patient SET who_stage = '$who_stage' WHERE patient_number_ccc ='$patient_ccc'";
- $this ->db ->query($sql);
- $count = $this -> db -> affected_rows();
- }
-
- public function getPatientMergeList(){
- $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
- $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
- $iSortCol_0 = $this -> input -> get_post('iSortCol_0', false);
- $iSortingCols = $this -> input -> get_post('iSortingCols', true);
- $sSearch = $this -> input -> get_post('sSearch', true);
- $sEcho = $this -> input -> get_post('sEcho', true);
- $where="";
- $facility_code=$this->session->userdata("facility");
+ $query = $this ->db ->query($sql);
+ $result = $query ->result_array();
+ $service = $result[0]['name'];
+ $extra ='';
+ if (stripos($service, "pmtct")===0){
+ $sql_get_art = "SELECT id FROM regimen_service_type WHERE name LIKE '%art%'";
+ $query = $this ->db ->query($sql_get_art);
+ $result = $query ->result_array();
+ $art_service_id = $result[0]['id'];
+ $extra = ", service = '$art_service_id' ";
+ }
+ $sql = "UPDATE patient SET pregnant = '0' $extra WHERE patient_number_ccc ='$patient_ccc'";
+ $this ->db ->query($sql);
+ $count = $this -> db -> affected_rows();
+
+ }
+ public function update_tb_status() {
+ $patient_ccc = $this -> input ->post("patient_ccc");
+ $tb_sql = "UPDATE patient SET tb = '0' WHERE patient_number_ccc ='$patient_ccc'";
+ $this ->db ->query($tb_sql);
+ $count = $this -> db -> affected_rows();
+ }
+
+ public function getWhoStage(){
+ $patient_ccc = $this -> input ->post("patient_ccc");
+ $sql = "SELECT who_stage FROM patient WHERE patient_number_ccc ='$patient_ccc' LIMIT 1";
+ $res = $this ->db ->query($sql);
+ $result = $res ->result_array();
+ $data['patient_who'] = trim($result[0]['who_stage']);
+ $sql = "SELECT * FROM who_stage";
+ $res = $this ->db ->query($sql);
+ $result = $res ->result_array();
+ $data['who_stage'] = $result;
+ echo json_encode($data);
+ }
+
+ public function updateWhoStage(){
+ $patient_ccc = $this -> input ->post("patient_ccc");
+ $who_stage = $this -> input ->post("who_stage");
+ $sql = "UPDATE patient SET who_stage = '$who_stage' WHERE patient_number_ccc ='$patient_ccc'";
+ $this ->db ->query($sql);
+ $count = $this -> db -> affected_rows();
+ }
+
+ public function getPatientMergeList(){
+ $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
+ $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
+ $iSortCol_0 = $this -> input -> get_post('iSortCol_0', false);
+ $iSortingCols = $this -> input -> get_post('iSortingCols', true);
+ $sSearch = $this -> input -> get_post('sSearch', true);
+ $sEcho = $this -> input -> get_post('sEcho', true);
+ $where="";
+ $facility_code=$this->session->userdata("facility");
//columns
$aColumns = array('id',
- 'patient_number_ccc',
- 'first_name',
- 'other_name',
- 'last_name',
- 'active');
+ 'patient_number_ccc',
+ 'first_name',
+ 'other_name',
+ 'last_name',
+ 'active');
$count = 0;
- // Paging
- if (isset($iDisplayStart) && $iDisplayLength != '-1') {
- $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
- }
-
- // Ordering
- if (isset($iSortCol_0)) {
- for ($i = 0; $i < intval($iSortingCols); $i++) {
- $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
- $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
- $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
-
- if ($bSortable == 'true') {
- $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
- }
- }
- }
- //Filtering
- if (isset($sSearch) && !empty($sSearch)) {
- $column_count=0;
- for ($i = 0; $i < count($aColumns); $i++) {
- $bSearchable = $this -> input -> get_post('bSearchable_' . $i, true);
-
- // Individual column filtering
- if (isset($bSearchable) && $bSearchable == 'true') {
- if($column_count==0){
- $where.="(";
- }else{
- $where.=" OR ";
- }
- $where.=$aColumns[$i]." LIKE '%".$this -> db -> escape_like_str($sSearch)."%'";
- $column_count++;
- }
- }
- }
-
- //data
- $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
- $this -> db -> from("patient p");
- $this -> db -> where("p.facility_code",$facility_code);
- //search sql clause
- if($where !=""){
- $where.=")";
- $this ->db -> where($where);
- }
- $rResult = $this -> db -> get();
-
- // Data set length after filtering
- $this -> db -> select('FOUND_ROWS() AS found_rows');
- $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
-
- // Total data set length
- $this -> db -> select("p.*");
- $this -> db -> from("patient p");
- $this -> db -> where("p.facility_code",$facility_code);
- $total = $this -> db -> get();
- $iTotal = count($total -> result_array());
-
- // Output
- $output = array('sEcho' => intval($sEcho),
- 'iTotalRecords' => $iTotal,
- 'iTotalDisplayRecords' => $iFilteredTotal,
- 'aaData' => array());
-
- //loop through data to parse to josn array
- foreach ($rResult->result() as $patient) {
- $row = array();
- //options
- $links = "unmerge ";
- $checkbox = " ";
+ // Paging
+ if (isset($iDisplayStart) && $iDisplayLength != '-1') {
+ $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
+ }
+
+ // Ordering
+ if (isset($iSortCol_0)) {
+ for ($i = 0; $i < intval($iSortingCols); $i++) {
+ $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
+ $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
+ $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
+
+ if ($bSortable == 'true') {
+ $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
+ }
+ }
+ }
+ //Filtering
+ if (isset($sSearch) && !empty($sSearch)) {
+ $column_count=0;
+ for ($i = 0; $i < count($aColumns); $i++) {
+ $bSearchable = $this -> input -> get_post('bSearchable_' . $i, true);
+
+ // Individual column filtering
+ if (isset($bSearchable) && $bSearchable == 'true') {
+ if($column_count==0){
+ $where.="(";
+ }else{
+ $where.=" OR ";
+ }
+ $where.=$aColumns[$i]." LIKE '%".$this -> db -> escape_like_str($sSearch)."%'";
+ $column_count++;
+ }
+ }
+ }
+
+ //data
+ $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
+ $this -> db -> from("patient p");
+ $this -> db -> where("p.facility_code",$facility_code);
+ //search sql clause
+ if($where !=""){
+ $where.=")";
+ $this ->db -> where($where);
+ }
+ $rResult = $this -> db -> get();
+
+ // Data set length after filtering
+ $this -> db -> select('FOUND_ROWS() AS found_rows');
+ $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
+
+ // Total data set length
+ $this -> db -> select("p.*");
+ $this -> db -> from("patient p");
+ $this -> db -> where("p.facility_code",$facility_code);
+ $total = $this -> db -> get();
+ $iTotal = count($total -> result_array());
+
+ // Output
+ $msg = array('sEcho' => intval($sEcho),
+ 'iTotalRecords' => $iTotal,
+ 'iTotalDisplayRecords' => $iFilteredTotal,
+ 'aaData' => array());
+
+ //loop through data to parse to josn array
+ foreach ($rResult->result() as $patient) {
+ $row = array();
+ //options
+ $links = "unmerge ";
+ $checkbox = " ";
if ($patient -> active == 1) {
- $links = "Merge ";
- $checkbox = " ";
+ $links = "Merge ";
+ $checkbox = " ";
}
- $row[] = $checkbox." ".$patient -> patient_number_ccc;
- $patient_name=$patient -> first_name." ".$patient -> other_name." ".$patient -> last_name;
- $row[] =str_replace(" "," ", $patient_name);
+ $row[] = $checkbox." ".$patient -> patient_number_ccc;
+ $patient_name=$patient -> first_name." ".$patient -> other_name." ".$patient -> last_name;
+ $row[] =str_replace(" "," ", $patient_name);
$row[] =$links;
- $output['aaData'][] = $row;
- }
- echo json_encode($output,JSON_PRETTY_PRINT);
- }
-
- public function merge(){
- //Handle the array with all patients that are to be merged
- $target_patient_id = $this -> input -> post('target_ccc');
- $patients = $this -> input -> post('patients');
- $patients = array_diff($patients, array($target_patient_id));
-
- //Get Target CCC_NO
+ $msg['aaData'][] = $row;
+ }
+ echo json_encode($msg,JSON_PRETTY_PRINT);
+ }
+
+ public function merge(){
+ //Handle the array with all patients that are to be merged
+ $target_patient_id = $this -> input -> post('target_ccc');
+ $patients = $this -> input -> post('patients');
+ $patients = array_diff($patients, array($target_patient_id));
+
+ //Get Target CCC_NO
$sql="SELECT patient_number_ccc FROM patient WHERE id='".$target_patient_id."'";
$query=$this->db->query($sql);
$results=$query->result_array();
if($results){
- $target_patient_ccc=$results[0]['patient_number_ccc'];
+ $target_patient_ccc=$results[0]['patient_number_ccc'];
}
//loop through merged patients
foreach($patients as $patient){
- //Merging patients involves disabling the patients being merged.
- $sql="UPDATE patient SET active='0' WHERE id='".$patient."'";
- $this->db->query($sql);
- //Get CCC_NO
- $sql="SELECT patient_number_ccc FROM patient WHERE id='".$patient."'";
- $query=$this->db->query($sql);
- $results=$query->result_array();
- if($results){
- $ccc_no=$results[0]['patient_number_ccc'];
- }
- //Transfer appointments to target patient
- $sql="UPDATE patient_appointment pa
+ //Merging patients involves disabling the patients being merged.
+ $sql="UPDATE patient SET active='0' WHERE id='".$patient."'";
+ $this->db->query($sql);
+ //Get CCC_NO
+ $sql="SELECT patient_number_ccc FROM patient WHERE id='".$patient."'";
+ $query=$this->db->query($sql);
+ $results=$query->result_array();
+ if($results){
+ $ccc_no=$results[0]['patient_number_ccc'];
+ }
+ //Transfer appointments to target patient
+ $sql="UPDATE patient_appointment pa
SET pa.merge='".$ccc_no."',
pa.patient='".$target_patient_ccc."'
WHERE pa.patient='".$ccc_no."'";
@@ -1416,17 +1427,17 @@ public function merge(){
$patient_no[]=$ccc_no;
}
- $patients_to_remove = implode(",", $patient_no);
+ $patients_to_remove = implode(",", $patient_no);
- $this -> session -> set_userdata('message_counter', '1');
- $this -> session -> set_userdata('msg_success','['.$patients_to_remove . '] was Merged to ['.$target_patient_ccc.'] !');
- $this -> session -> set_userdata("link_id", "merge_list");
- $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
- }
+ $this -> session -> set_userdata('message_counter', '1');
+ $this -> session -> set_userdata('msg_success','['.$patients_to_remove . '] was Merged to ['.$target_patient_ccc.'] !');
+ $this -> session -> set_userdata("link_id", "merge_list");
+ $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
+ }
- public function unmerge(){
- //Handle the array with all patients that are to be unmerged
- $target_patient_id = $this -> input -> post('target_ccc');
+ public function unmerge(){
+ //Handle the array with all patients that are to be unmerged
+ $target_patient_id = $this -> input -> post('target_ccc');
//Merging patients involves disabling the patients being merged.
$sql="UPDATE patient SET active='1' WHERE id='".$target_patient_id."'";
@@ -1436,7 +1447,7 @@ public function unmerge(){
$query=$this->db->query($sql);
$results=$query->result_array();
if($results){
- $target_patient_ccc=$results[0]['patient_number_ccc'];
+ $target_patient_ccc=$results[0]['patient_number_ccc'];
}
//Transfer appointments to original patient
$sql="UPDATE patient_appointment pa
@@ -1451,217 +1462,212 @@ public function unmerge(){
WHERE pv.migration_id='".$target_patient_ccc."'";
$this->db->query($sql);
- $this -> session -> set_userdata('message_counter', '1');
- $this -> session -> set_userdata('msg_success','['.$target_patient_ccc . '] was unmerged!');
- $this -> session -> set_userdata("link_id", "merge_list");
- $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
- }
+ $this -> session -> set_userdata('message_counter', '1');
+ $this -> session -> set_userdata('msg_success','['.$target_patient_ccc . '] was unmerged!');
+ $this -> session -> set_userdata("link_id", "merge_list");
+ $this -> session -> set_userdata("linkSub", "patient_management/merge_list");
+ }
- public function load_view( $page_id = NULL ,$id = NULL)
- {
+ public function load_view( $page_id = NULL ,$id = NULL)
+ {
$config['details'] = array(
- 'patient_id' => $id,
- 'content_view' => 'patients/details_v',
- 'hide_side_menu' => '0',
- 'patient_msg' => $this->get_patient_relations($id)
- );
+ 'patient_id' => $id,
+ 'content_view' => 'patients/details_v',
+ 'hide_side_menu' => '1',
+ 'patient_msg' => $this->get_patient_relations($id)
+ );
$this -> base_params($config[$page_id]);
- }
-
- public function get_patient_relations( $patient_id = NULL)
- {
-
- $this->db->select("p.first_name,p.last_name,LOWER(ps.name) as status,dp.child,s.secondary_spouse");
- $this->db->from("patient p");
- $this->db->join("patient_status ps","ps.id=p.current_status","left");
- $this->db->join("dependants dp","p.patient_number_ccc=dp.parent","left");
- $this->db->join("spouses s","p.patient_number_ccc=s.primary_spouse","left");
- $this->db->where("p.id",$patient_id);
- $query = $this->db->get();
- $results = $query -> result_array();
+ }
+
+ public function get_patient_relations( $patient_id = NULL)
+ {
+
+ $this->db->select("p.first_name,p.last_name,LOWER(ps.name) as status,dp.child,s.secondary_spouse");
+ $this->db->from("patient p");
+ $this->db->join("patient_status ps","ps.id=p.current_status","left");
+ $this->db->join("dependants dp","p.patient_number_ccc=dp.parent","left");
+ $this->db->join("spouses s","p.patient_number_ccc=s.primary_spouse","left");
+ $this->db->where("p.id",$patient_id);
+ $query = $this->db->get();
+ $results = $query -> result_array();
$dependant_msg = "";
- if ($results)
- {
+ if ($results)
+ {
$status = $results[0]['status'];
//Check dependedants/spouse status
- $child = $results[0]['child'];
- $spouse = $results[0]['secondary_spouse'];
- $patient_name = strtoupper($results[0]['first_name'].' '.$results[0]['last_name']);
- if($child!=NULL){
- $pat = $this ->getDependentStatus($child);
- if($pat!=''){
- $dependant_msg.="Patient $patient_name\'s dependant ".$pat." is lost to follow up ";
- }
- }
- if($spouse!=NULL){
- $pat = $this ->getDependentStatus($spouse);
- if($pat!=''){
- $dependant_msg.="Patient $patient_name\'s spouse ".$pat." is lost to follow up ";
- }
- }
- }
-
- return array('status'=>$status,'message'=>$dependant_msg);
-
- }
-
- public function load_form($form_id = NULL)
- {
+ $child = $results[0]['child'];
+ $spouse = $results[0]['secondary_spouse'];
+ $patient_name = strtoupper($results[0]['first_name'].' '.$results[0]['last_name']);
+ if($child!=NULL){
+ $pat = $this ->getDependentStatus($child);
+ if($pat!=''){
+ $dependant_msg.="Patient $patient_name\'s dependant ".$pat." is lost to follow up ";
+ }
+ }
+ if($spouse!=NULL){
+ $pat = $this ->getDependentStatus($spouse);
+ if($pat!=''){
+ $dependant_msg.="Patient $patient_name\'s spouse ".$pat." is lost to follow up ";
+ }
+ }
+ }
+
+ return array('status'=>$status,'message'=>$dependant_msg);
+
+ }
+
+ public function load_form($form_id = NULL)
+ {
if($form_id == "patient_details"){
- $data['pob'] = District::getItems();
- $data['gender'] = Gender::getItems();
- $data['current_status'] = Patient_Status::getItems();
- $data['source'] = Patient_Source::getItems();
- $data['drug_prophylaxis'] = Drug_Prophylaxis::getItems();
- $data['service'] = Regimen_Service_Type::getItems();
- $data['fplan'] = Family_Planning::getItems();
- $data['other_illnesses'] = Other_Illnesses::getItems();
- $data['pep_reason'] = Pep_Reason::getItems();
- $data['drug_allergies'] = Drugcode::getItems();
- $regimens = Regimen::getItems();
- $data['start_regimen'] = $regimens;
- $data['current_regimen'] = $regimens;
- $data['who_stage'] = Who_Stage::getItems();
-
+ $data['pob'] = District::getItems();
+ $data['gender'] = Gender::getItems();
+ $data['current_status'] = Patient_Status::getItems();
+ $data['source'] = Patient_Source::getItems();
+ $data['drug_prophylaxis'] = Drug_Prophylaxis::getItems();
+ $data['service'] = Regimen_Service_Type::getItems();
+ $data['fplan'] = Family_Planning::getItems();
+ $data['other_illnesses'] = Other_Illnesses::getItems();
+ $data['pep_reason'] = Pep_Reason::getItems();
+ $data['drug_allergies'] = Drugcode::getItems();
+ $regimens = Regimen::getItems();
+ $data['start_regimen'] = $regimens;
+ $data['current_regimen'] = $regimens;
+ $data['who_stage'] = Who_Stage::getItems();
+
//Get facilities beacuse of UTF-8 encoding
- $this -> db-> select('facilitycode AS id, name AS Name');
- $query = $this ->db -> get('facilities');
- $facilities = $query -> result_array();
- foreach($facilities as $facility){
+ $this -> db-> select('facilitycode AS id, name AS Name');
+ $query = $this ->db -> get('facilities');
+ $facilities = $query -> result_array();
+ foreach($facilities as $facility){
$facility_list[]=array('id' => $facility['id'],'Name' => utf8_encode($facility['Name']));
- }
- $data['transfer_from'] = $facility_list;
- }
-
- echo json_encode($data);
- }
-
- public function load_patient($id = NULL)
- {
- $columns = array(
- 'p.Medical_Record_Number AS medical_record_number',
- 'p.Patient_Number_CCC AS patient_number_ccc',
- 'p.First_Name AS first_name',
- 'p.Last_Name AS last_name',
- 'p.Other_Name AS other_name',
- 'DATE_FORMAT(p.Dob,"%Y-%m-%d") AS dob',
- 'p.Pob AS pob',
- 'p.dependant.parent as parent',
- 'p.Gender AS gender',
- 'p.Pregnant AS pregnant',
- 'FLOOR(DATEDIFF(p.Date_Enrolled,p.Dob)/365) AS start_age',
- 'FLOOR(DATEDIFF(CURDATE(),p.Dob)/365) AS age',
- 'p.Start_Weight AS start_weight',
- 'p.Weight AS weight',
- 'p.Start_Height AS start_height',
- 'p.Height AS height',
- 'p.Start_Bsa AS start_bsa',
- 'p.Sa AS sa',
- 'p.Phone AS phone',
- 'IF(p.SMS_Consent ="1","sms_yes","sms_no") AS sms_consent',
- 'p.Physical AS physical',
- 'p.Alternate AS alternate',
- 'p.Support_Group AS support_group',
- 'p.Partner_Status AS partner_status',
- 'IF(p.Disclosure ="1","disclosure_yes","disclosure_no") AS disclosure',
- 'p.Spouse.secondary_spouse AS secondary_spouse',
- 'Fplan AS fplan',
- 'Other_Illnesses AS other_illnesses',
- 'Drug_Allergies AS drug_allergies',
- 'p.Other_Drugs AS other_drugs',
- 'p.Adr AS adr',
- 'p.Smoke AS smoke',
- 'p.Alcohol AS alcohol',
- 'p.Tb_Test AS tb_test',
- 'p.Tb AS tb',
- 'p.tb_category AS tb_category',
- 'p.Tbphase AS tbphase',
- 'p.Startphase AS startphase',
- 'p.Endphase AS endphase',
- 'p.NextAppointment AS nextappointment',
- 'DATEDIFF(p.NextAppointment,CURDATE()) AS days_to_next',
- 'p.Date_Enrolled AS date_enrolled',
- 'p.Current_Status AS current_status',
- 'p.Status_Change_Date AS status_change_date',
- 'p.Source AS source',
- 'p.Transfer_From AS transfer_from',
- 'p.Service AS service',
- 'p.Pep_Reason AS pep_reason',
- 'p.Start_Regimen AS start_regimen',
- 'p.Start_Regimen_Date AS start_regimen_date',
- 'p.Current_Regimen AS current_regimen',
- 'p.who_stage',
- 'p.drug_prophylaxis AS drug_prophylaxis',
- 'p.isoniazid_start_date',
- 'p.isoniazid_end_date');
+ }
+ $data['transfer_from'] = $facility_list;
+ }
+
+ echo json_encode($data);
+ }
+
+ public function load_patient($id = NULL)
+ {
+ $columns = array(
+ 'p.Medical_Record_Number AS medical_record_number',
+ 'p.Patient_Number_CCC AS patient_number_ccc',
+ 'p.First_Name AS first_name',
+ 'p.Last_Name AS last_name',
+ 'p.Other_Name AS other_name',
+ 'DATE_FORMAT(p.Dob,"%Y-%m-%d") AS dob',
+ 'p.Pob AS pob',
+ 'p.dependant.parent as parent',
+ 'p.Gender AS gender',
+ 'p.Pregnant AS pregnant',
+ 'FLOOR(DATEDIFF(p.Date_Enrolled,p.Dob)/365) AS start_age',
+ 'FLOOR(DATEDIFF(CURDATE(),p.Dob)/365) AS age',
+ 'p.Start_Weight AS start_weight',
+ 'p.Weight AS weight',
+ 'p.Start_Height AS start_height',
+ 'p.Height AS height',
+ 'p.Start_Bsa AS start_bsa',
+ 'p.Sa AS sa',
+ 'p.Phone AS phone',
+ 'IF(p.SMS_Consent ="1","sms_yes","sms_no") AS sms_consent',
+ 'p.Physical AS physical',
+ 'p.Alternate AS alternate',
+ 'p.Support_Group AS support_group',
+ 'p.Partner_Status AS partner_status',
+ 'IF(p.Disclosure ="1","disclosure_yes","disclosure_no") AS disclosure',
+ 'p.Spouse.secondary_spouse AS secondary_spouse',
+ 'Fplan AS fplan',
+ 'Other_Illnesses AS other_illnesses',
+ 'Drug_Allergies AS drug_allergies',
+ 'p.Other_Drugs AS other_drugs',
+ 'p.Adr AS adr',
+ 'p.Smoke AS smoke',
+ 'p.Alcohol AS alcohol',
+ 'p.Tb_Test AS tb_test',
+ 'p.Tb AS tb',
+ 'p.tb_category AS tb_category',
+ 'p.Tbphase AS tbphase',
+ 'p.Startphase AS startphase',
+ 'p.Endphase AS endphase',
+ 'p.NextAppointment AS nextappointment',
+ 'DATEDIFF(p.NextAppointment,CURDATE()) AS days_to_next',
+ 'p.Date_Enrolled AS date_enrolled',
+ 'p.Current_Status AS current_status',
+ 'p.Status_Change_Date AS status_change_date',
+ 'p.Source AS source',
+ 'p.Transfer_From AS transfer_from',
+ 'p.Service AS service',
+ 'p.Pep_Reason AS pep_reason',
+ 'p.Start_Regimen AS start_regimen',
+ 'p.Start_Regimen_Date AS start_regimen_date',
+ 'p.Current_Regimen AS current_regimen',
+ 'p.who_stage',
+ 'p.drug_prophylaxis AS drug_prophylaxis',
+ 'p.isoniazid_start_date',
+ 'p.isoniazid_end_date');
$details = Patient::get_patient( $id , implode(",", $columns) );
- //Sanitize data
- foreach($details as $index=> $detail){
- if( $index == "other_illnesses" )
- {
+ //Sanitize data
+ foreach($details as $index=> $detail){
+ if( $index == "other_illnesses" )
+ {
$illnesses = explode(",", $detail);
$others = $this -> get_other_chronic($illnesses);
$data[$index] = $others[$index];
$data["other_chronic"] = $others['other_chronic'];
- }else{
- $data[$index] = utf8_encode($detail);
- }
- }
-
- echo json_encode($data,JSON_PRETTY_PRINT);
- }
-
- public function get_visits( $patient_id = NULL )
- {
- $facility_code = $this -> session -> userdata("facility");
-
- $sql = "SELECT pv.dispensing_date,
- v.name AS visit,
- pv.dose,
- pv.duration,
- pv.id AS record_id,
- d.drug,
- pv.quantity,
- pv.current_weight,
- r.regimen_desc,
- pv.batch_number,
- pv.pill_count,
- pv.adherence,
- pv.user,
- rcp.name AS regimen_change_reason
- FROM patient_visit pv
- LEFT JOIN patient p ON pv.patient_id = p.patient_number_ccc
- LEFT JOIN drugcode d ON pv.drug_id = d.id
- LEFT JOIN regimen r ON pv.regimen=r.id
- LEFT JOIN regimen r1 ON pv.last_regimen = r1.id
- LEFT JOIN visit_purpose v ON pv.visit_purpose = v.id
- LEFT JOIN regimen_change_purpose rcp ON rcp.id=pv.regimen_change_reason
- WHERE p.id = '$patient_id'
- AND pv.facility = '$facility_code'
- AND pv.active = 1
- GROUP BY d.drug,pv.dispensing_date
- ORDER BY pv.dispensing_date DESC";
+ }else{
+ $data[$index] = utf8_encode($detail);
+ }
+ }
- $query = $this -> db -> query($sql);
- $visits = $query ->result_array();
+ echo json_encode($data,JSON_PRETTY_PRINT);
+ }
+
+ public function get_visits( $patient_id = NULL )
+ {
+ $facility_code = $this -> session -> userdata("facility");
+
+ $sql = "select v_v.dispensing_date,
+ v_v.visit_purpose_name AS visit,
+ v_v.dose,
+ v_v.duration,
+ v_v.patient_visit_id AS record_id,
+ D.drug,
+ v_v.quantity,
+ v_v.current_weight,
+ R.regimen_desc,
+ v_v.batch_number,
+ v_v.pill_count,
+ v_v.adherence,
+ v_v.user,
+ v_v.regimen_change_reason AS regimen_change_reason
+ from v_patient_visits as v_v
+ INNER JOIN regimen as R ON R.id = v_v.current_regimen
+ INNER JOIN drugcode as D ON D.id = v_v.drug_id
+ WHERE v_v.id = $patient_id
+ AND v_v.pv_active = 1
+ GROUP BY v_v.drug_id,v_v.dispensing_date
+ ORDER BY v_v.dispensing_date DESC";
+
+ $query = $this->db->query($sql);
+ $visits = $query->result_array();
$temp = array();
foreach($visits as $counter => $visit)
- {
- foreach ($visit as $key => $value)
- {
+ {
+ foreach ($visit as $key => $value)
+ {
if($key == "record_id")
{
- $link=base_url().'dispensement_management/edit/'.$value;
- $value = "Edit ";
- }
+ $link=base_url().'dispensement_management/edit/'.$value;
+ $value = "Edit ";
+ }
- $temp[$counter][] = $value;
- }
+ $temp[$counter][] = $value;
+ }
}
@@ -1673,201 +1679,210 @@ public function get_visits( $patient_id = NULL )
//echo "";
- }
-
- public function load_visits( $patient_id = NULL)
- {
-
- $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
- $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
- $iSortCol_0 = $this -> input -> get_post('iSortCol_0', true);
- $iSortingCols = $this -> input -> get_post('iSortingCols', true);
- $sSearch = $this -> input -> get_post('sSearch', true);
- $sEcho = $this -> input -> get_post('sEcho', true);
- $facility_code = $this -> session -> userdata("facility");
-
- //Selected columns
- $aColumns = array(
- 'pv.dispensing_date',
- 'v.name AS visit',
- 'pv.dose',
- 'pv.duration',
- 'pv.id AS record_id',
- 'd.drug',
- 'pv.quantity',
- 'pv.current_weight',
- 'r1.regimen_desc',
- 'pv.batch_number',
- 'pv.pill_count',
- 'pv.adherence',
- 'pv.user',
- 'rcp.name AS regimen_change_reason'
- );
-
- // Paging
- if (isset($iDisplayStart) && $iDisplayLength != '-1') {
- $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
- }
-
- // Ordering
- if (isset($iSortCol_0)) {
- for ($i = 0; $i < intval($iSortingCols); $i++) {
- $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
- $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
- $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
-
- if ($bSortable == 'true') {
- $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
- }
- }
- }
-
- /*
- * Filtering
- * NOTE this does not match the built-in DataTables filtering which does it
- * word by word on any field. It's possible to do here, but concerned about efficiency
- * on very large tables, and MySQL's regex functionality is very limited
- */
- $sWhere = "";
- if ( isset($sSearch) && !empty($sSearch) )
- {
- for ($i = 0; $i < count($aColumns); $i++)
- {
- $bSearchable = $this -> input -> get_post('bSearchable_' . $i, true);
-
- // Individual column filtering
- if (isset($bSearchable) && $bSearchable == 'true')
- {
- //If 'AS' is found remove it
- $col = $aColumns[$i];
- $pos = strpos($col,"AS");
-
- if( $pos !== FALSE)
- {
- $col = trim( $col = substr( $col , 0, $pos) );
- }
-
- $sSearch = mysql_real_escape_string($sSearch);
-
- if ($i != 0)
- {
- $sWhere .= " OR ".$col." LIKE '%".$sSearch."%'";
- }
- else
- {
- $sWhere .= "( ".$col." LIKE '%".$sSearch."%'";
- }
-
- }
- }
- $sWhere .= ")";
- }
-
- // Select Data
- $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
- $this -> db -> from("patient_visit pv");
- $this -> db -> join("patient p", "pv.patient_id = p.patient_number_ccc", "left");
- $this -> db -> join("drugcode d", "pv.drug_id = d.id", "left");
- $this -> db -> join("regimen r", "pv.regimen", "left");
- $this -> db -> join("regimen r1", "pv.last_regimen = r1.id", "left");
- $this -> db -> join("visit_purpose v", "pv.visit_purpose = v.id", "left");
- $this -> db -> join("regimen_change_purpose rcp", "rcp.id=pv.regimen_change_reason", "left");
- $this -> db -> where("p.id", $patient_id);
- $this -> db -> where("pv.facility", $facility_code);
- $this -> db -> where("pv.active", 1);
- if($sWhere)
- {
- $this -> db -> where( $sWhere );
- }
- $this -> db -> group_by(array("d.drug,pv.dispensing_date"));
-
- $rResult = $this -> db -> get();
-
- echo $this->db->last_query();die();
-
- // Data set length after filtering
- $this -> db -> select('FOUND_ROWS() AS found_rows');
- $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
-
- // Total data set length
- $this -> db -> select("pv.*");
- $this -> db -> from("patient_visit pv");
- $this -> db -> join("patient p", "pv.patient_id = p.patient_number_ccc", "left");
- $this -> db -> join("drugcode d", "pv.drug_id = d.id", "left");
- $this -> db -> join("regimen r", "pv.regimen", "left");
- $this -> db -> join("regimen r1", "pv.last_regimen = r1.id", "left");
- $this -> db -> join("visit_purpose v", "pv.visit_purpose = v.id", "left");
- $this -> db -> join("regimen_change_purpose rcp", "rcp.id=pv.regimen_change_reason", "left");
- $this -> db -> where("p.id", $patient_id);
- $this -> db -> where("pv.facility", $facility_code);
- $this -> db -> where("pv.active", 1);
- if($sWhere)
- {
- $this -> db -> where( $sWhere );
- }
- $this -> db -> group_by(array("d.drug,pv.dispensing_date"));
- $total = $this -> db -> get();
- $iTotal = count($total -> result_array());
-
- // Output
- $output = array(
- 'sEcho' => intval($sEcho),
- 'iTotalRecords' => $iTotal,
- 'iTotalDisplayRecords' => $iFilteredTotal,
- 'aaData' => array()
- );
-
- foreach ($rResult->result_array() as $count => $aRow) {
- $data = array();
- foreach($aRow as $col => $value){
- if($col == "record_id"){
- $link=base_url().'dispensement_management/edit/'.$value;
- $data[] = "Edit ";
- }else{
- $data[] = $value;
- }
- }
- $output['aaData'][] = $data;
- }
-
- echo json_encode($output,JSON_PRETTY_PRINT);
- }
-
- public function get_other_chronic($illnesses){
- $illness_list = array('other_illnesses'=>'','other_chronic' => '');
- $other_chronic = array();
- $chronic = array();
+ }
+
+
+ public function load_visits( $patient_id = NULL)
+ {
+
+ $iDisplayStart = $this -> input -> get_post('iDisplayStart', true);
+ $iDisplayLength = $this -> input -> get_post('iDisplayLength', true);
+ $iSortCol_0 = $this -> input -> get_post('iSortCol_0', true);
+ $iSortingCols = $this -> input -> get_post('iSortingCols', true);
+ $sSearch = $this -> input -> get_post('sSearch', true);
+ $sEcho = $this -> input -> get_post('sEcho', true);
+ $facility_code = $this -> session -> userdata("facility");
+
+ //Selected columns
+ $aColumns = array(
+ 'pv.dispensing_date',
+ 'v.name AS visit',
+ 'pv.dose',
+ 'pv.duration',
+ 'pv.id AS record_id',
+ 'd.drug',
+ 'pv.quantity',
+ 'pv.current_weight',
+ 'r1.regimen_desc',
+ 'pv.batch_number',
+ 'pv.pill_count',
+ 'pv.adherence',
+ 'pv.user',
+ 'rcp.name AS regimen_change_reason'
+ );
+
+ // Paging
+ if (isset($iDisplayStart) && $iDisplayLength != '-1') {
+ $this -> db -> limit($this -> db -> escape_str($iDisplayLength), $this -> db -> escape_str($iDisplayStart));
+ }
+
+ // Ordering
+ if (isset($iSortCol_0)) {
+ for ($i = 0; $i < intval($iSortingCols); $i++) {
+ $iSortCol = $this -> input -> get_post('iSortCol_' . $i, true);
+ $bSortable = $this -> input -> get_post('bSortable_' . intval($iSortCol), true);
+ $sSortDir = $this -> input -> get_post('sSortDir_' . $i, true);
+
+ if ($bSortable == 'true') {
+ $this -> db -> order_by($aColumns[intval($this -> db -> escape_str($iSortCol))], $this -> db -> escape_str($sSortDir));
+ }
+ }
+ }
+
+ /*
+ * Filtering
+ * NOTE this does not match the built-in DataTables filtering which does it
+ * word by word on any field. It's possible to do here, but concerned about efficiency
+ * on very large tables, and MySQL's regex functionality is very limited
+ */
+ $sWhere = "";
+ if ( isset($sSearch) && !empty($sSearch) )
+ {
+ for ($i = 0; $i < count($aColumns); $i++)
+ {
+ $bSearchable = $this -> input -> get_post('bSearchable_' . $i, true);
+
+ // Individual column filtering
+ if (isset($bSearchable) && $bSearchable == 'true')
+ {
+ //If 'AS' is found remove it
+ $col = $aColumns[$i];
+ $pos = strpos($col,"AS");
+
+ if( $pos !== FALSE)
+ {
+ $col = trim( $col = substr( $col , 0, $pos) );
+ }
+
+ $sSearch = mysql_real_escape_string($sSearch);
+
+ if ($i != 0)
+ {
+ $sWhere .= " OR ".$col." LIKE '%".$sSearch."%'";
+ }
+ else
+ {
+ $sWhere .= "( ".$col." LIKE '%".$sSearch."%'";
+ }
+
+ }
+ }
+ $sWhere .= ")";
+ }
+
+ // Select Data
+ $this -> db -> select('SQL_CALC_FOUND_ROWS ' . str_replace(' , ', ' ', implode(', ', $aColumns)), false);
+ $this -> db -> from("patient_visit pv");
+ $this -> db -> join("patient p", "pv.patient_id = p.patient_number_ccc", "left");
+ $this -> db -> join("drugcode d", "pv.drug_id = d.id", "left");
+ $this -> db -> join("regimen r", "pv.regimen", "left");
+ $this -> db -> join("regimen r1", "pv.last_regimen = r1.id", "left");
+ $this -> db -> join("visit_purpose v", "pv.visit_purpose = v.id", "left");
+ $this -> db -> join("regimen_change_purpose rcp", "rcp.id=pv.regimen_change_reason", "left");
+ $this -> db -> where("p.id", $patient_id);
+ $this -> db -> where("pv.facility", $facility_code);
+ $this -> db -> where("pv.active", 1);
+ if($sWhere)
+ {
+ $this -> db -> where( $sWhere );
+ }
+ $this -> db -> group_by(array("d.drug,pv.dispensing_date"));
+
+ $rResult = $this -> db -> get();
+
+ echo $this->db->last_query();die();
+
+ // Data set length after filtering
+ $this -> db -> select('FOUND_ROWS() AS found_rows');
+ $iFilteredTotal = $this -> db -> get() -> row() -> found_rows;
+
+ // Total data set length
+ $this -> db -> select("pv.*");
+ $this -> db -> from("patient_visit pv");
+ $this -> db -> join("patient p", "pv.patient_id = p.patient_number_ccc", "left");
+ $this -> db -> join("drugcode d", "pv.drug_id = d.id", "left");
+ $this -> db -> join("regimen r", "pv.regimen", "left");
+ $this -> db -> join("regimen r1", "pv.last_regimen = r1.id", "left");
+ $this -> db -> join("visit_purpose v", "pv.visit_purpose = v.id", "left");
+ $this -> db -> join("regimen_change_purpose rcp", "rcp.id=pv.regimen_change_reason", "left");
+ $this -> db -> where("p.id", $patient_id);
+ $this -> db -> where("pv.facility", $facility_code);
+ $this -> db -> where("pv.active", 1);
+ if($sWhere)
+ {
+ $this -> db -> where( $sWhere );
+ }
+ $this -> db -> group_by(array("d.drug,pv.dispensing_date"));
+ $total = $this -> db -> get();
+ $iTotal = count($total -> result_array());
+
+ // Output
+ $msg = array(
+ 'sEcho' => intval($sEcho),
+ 'iTotalRecords' => $iTotal,
+ 'iTotalDisplayRecords' => $iFilteredTotal,
+ 'aaData' => array()
+ );
+
+ foreach ($rResult->result_array() as $count => $aRow) {
+ $data = array();
+ foreach($aRow as $col => $value){
+ if($col == "record_id"){
+ $link=base_url().'dispensement_management/edit/'.$value;
+ $data[] = "Edit ";
+ }else{
+ $data[] = $value;
+ }
+ }
+ $msg['aaData'][] = $data;
+ }
+
+ echo json_encode($msg,JSON_PRETTY_PRINT);
+ }
+
+ public function get_other_chronic($illnesses){
+ $illness_list = array('other_illnesses'=>'','other_chronic' => '');
+ $other_chronic = array();
+ $chronic = array();
if($illnesses)
- {
- $indicators = Other_Illnesses::getIndicators();
- foreach($illnesses as $illness)
- {
- if(in_array($illness, $indicators))
- {
- $chronic[] = $illness;
- }else{
+ {
+ $indicators = Other_Illnesses::getIndicators();
+ foreach($illnesses as $illness)
+ {
+ if(in_array($illness, $indicators))
+ {
+ $chronic[] = $illness;
+ }else{
$other_chronic[] = $illness;
- }
- }
+ }
+ }
- $illness_list['other_illnesses'] = implode(",", $chronic);
- $illness_list['other_chronic'] = implode(",", $other_chronic);
+ $illness_list['other_illnesses'] = implode(",", $chronic);
+ $illness_list['other_chronic'] = implode(",", $other_chronic);
}
return $illness_list;
- }
+ }
+
+ public function load_summary( $patient_id = NULL )
+ {
+ //procedure
- public function load_summary( $patient_id = NULL )
- {
- //procedure
-
- }
+ }
- public function get_patients()
- {
- $facility_code = $this -> session -> userdata("facility");
- $access_level = $this -> session -> userdata('user_indicator');
+ public function get_patients($status=null)
+ {
+ $filter = "";
+ if ($status != NULL){
+ if($status=='inactive'){
+ $filter.="AND ps.Name NOT LIKE '%active%'";
+ }
+ }else{
+ $filter.="AND ps.Name LIKE '%active%'";
+ }
+ $facility_code = $this -> session -> userdata("facility");
+ $access_level = $this -> session -> userdata('user_indicator');
- $sql = "SELECT
+ $sql = "SELECT
p.patient_number_ccc as ccc_no,
UPPER(CONCAT_WS(' ',CONCAT_WS(' ',p.first_name,p.other_name),p.last_name)) as patient_name,
DATE_FORMAT(p.nextappointment,'%b %D, %Y') as appointment,
@@ -1875,62 +1890,155 @@ public function get_patients()
CONCAT_WS(' | ',r.regimen_code,r.regimen_desc) as regimen,
ps.name as status,
p.active,
- p.id
+ p.id,
+ p.current_status
FROM patient p
LEFT JOIN regimen r ON r.id=p.current_regimen
LEFT JOIN patient_status ps ON ps.id=p.current_status
WHERE p.facility_code = '$facility_code'
- AND p.patient_number_ccc != '' AND ps.id=1";
- $query = $this -> db -> query($sql);
- $patients = $query ->result_array();
+ AND p.patient_number_ccc != '' $filter ";
+ $query = $this -> db -> query($sql);
+ $patients = $query ->result_array();
$temp = array();
foreach($patients as $counter => $patient)
- {
- foreach ($patient as $key => $value) {
- if ($key == "active")
- {
- $id = $patient['id'];
- $link = "";
+ {
+ foreach ($patient as $key => $value) {
+ if ($key == "active")
+ {
+ $id = $patient['id'];
+ $link = "";
//Active Patient
- if($access_level == "facility_administrator")
- {
- if ($value==1)
- {
- $link = '| Disable ';
- }else
- {
- $link = '| Enable ';
- }
- }
-
-
- if ($value==1)
- {
- $link = 'Dispense |Detail | Edit ' . $link;
- }else{
- $link = str_replace("|", "", $link);
- $link .= '| Delete ';
- }
-
- $value = $link;
- unset($patient['id']);
- }
- $temp [$counter][] = $value;
- }
-
+ if($access_level == "facility_administrator")
+ {
+ if ($value==1)
+ {
+ $link = '| Disable ';
+ }else
+ {
+ $link = '| Enable ';
+ }
+ }
+ if ($value==1)
+ {
+ if(strtolower($patient['status']) != 'active'){
+ $link = 'Detail | Edit ' . $link;
+ }else{
+ $link = 'Dispense |Detail | Edit ' . $link;
+ }
+ }else{
+ $link = str_replace("|", "", $link);
+ $link .= '| Delete ';
+ }
+
+ $value = $link;
+ unset($patient['id']);
+ }
+ $temp [$counter][] = $value;
+ }
+
}
$data['aaData'] = $temp;
echo json_encode($data,JSON_PRETTY_PRINT);
- }
+ }
-public function get_patient_details(){
- $patient_id = $this ->input ->post('patient_id');
- $query = patient::get_patient_details($patient_id);
- echo json_encode($query);
-}
+ public function get_patient_details($patient_id=null,$type=null){
+ if(!isset($patient_id)){
+ $patient_id = $this ->input ->post('patient_id');
+ }
+
+ $query = patient::get_patient_details($patient_id);
+ if(isset($type)){
+ return $query;
+ }else{
+ echo json_encode($query);
+ }
+ }
+
+
+ //to get the dose for a child patient
+ public function get_peadiatric_dose(){
+ $weight = $this ->input ->post('weight');
+ $drug_id = $this ->input ->post('drug_id');
+ $sql="select do.id,Name,value,frequency from dossing_chart d
+ inner join dose do on do.id=d.dose_id
+ where min_weight <= '$weight' and max_weight >= '$weight' and drug_id='$drug_id' and is_active = '1'";
+ $query = $this -> db -> query($sql);
+ $data = $query -> row();
+ echo json_encode($data);
+ }
+ //get the viral _load_information
+ public function get_viral_load_info($patient_id){
+ $patient_details = $this->get_patient_details($patient_id,'array');
+
+ $patient_ccc = $patient_details['Patient_Number_CCC'];
+
+ $msg=0;
+ $max_days_from_enrolled=180;
+ $max_days_to_notification=10;
+ $max_days_to_LDL_test=365;
+ $max_days_for_greater_1000_test=90;
+ $sql="SELECT p.patient_number_ccc,pv.result,pv.test_date,DATEDIFF(NOW(), test_date) AS test_date_diff, DATEDIFF(NOW(), start_regimen_date) AS start_regimen_date_diff FROM patient p left JOIN patient_viral_load pv ON p.patient_number_ccc = pv.patient_ccc_number and p.patient_number_ccc = '$patient_ccc'
+ Where p.patient_number_ccc = '$patient_ccc' group by p.patient_number_ccc order by test_date desc";
+ $query = $this -> db -> query($sql);
+ $datas = $query -> result_array();
+ foreach ($datas as $data) {
+ $viral_load_test_date=$data['test_date'];
+ //if patient has no viral_load_test date
+ if (empty($viral_load_test_date))
+ { //check the viral load test date
+ $start_regimen_date_diff= $data['start_regimen_date_diff'];
+ //if patient is enrolled in care and there is ten or less days to viral load test date
+ if($start_regimen_date_diff < $max_days_from_enrolled && (($max_days_from_enrolled-$start_regimen_date_diff)<=$max_days_to_notification))
+ {
+ $msg="This patient needs to do viral Load test before "+$start_regimen_date_diff+" days from today";
+ }
+ // no patient_viral load info and 180 days has passed.
+ else if($start_regimen_date_diff > $max_days_from_enrolled)
+ {
+ $msg="This patient requires a viral load test as there is no viral load Information and 6 months has passed from the date of start regimen";
+ }
+ }
+ //if patient has viral load test date
+ else
+ {
+ $result=$data['result'];
+ $test_date_diff=$data['test_date_diff'];
+ //if LDL
+ if($result=='< LDL copies/ml')
+ {
+ if($test_date_diff < $max_days_to_LDL_test && (($max_days_to_LDL_test-$test_date_diff)<=$max_days_to_notification ))
+ {
+ $msg="This patient needs to do viral Load test before ".$max_days_to_LDL_test-$test_date_diff." days from today";
+
+ }
+ else if($test_date_diff > $max_days_to_LDL_test)
+ {
+ $msg="This patient needs to do viral Load test urgently as one year has elapsed from the last test";
+ }
+ }
+ //else viral is more than 1000
+ else if($result > 1000)
+ {
+ if($test_date_diff <$max_days_for_greater_1000_test && (($max_days_for_greater_1000_test-$test_date_diff)<=$max_days_to_notification))
+ {
+ $diff=$max_days_for_greater_1000_test-$test_date_diff;
+ $msg="This patient needs to do viral Load test ".$diff." days from today";
+ }
+ else if($test_date_diff > $max_days_for_greate_100_test)
+ {
+ $msg="This patient needs to do viral Load test as 90 days has passed";
+ }
+
+ }
+ }
+
+ }
+ echo json_encode($msg);
+ }
}
+ob_get_clean();
?>
\ No newline at end of file
diff --git a/application/controllers/regimen_drug_management.php b/application/controllers/regimen_drug_management.php
index 96971e7..cd646b4 100644
--- a/application/controllers/regimen_drug_management.php
+++ b/application/controllers/regimen_drug_management.php
@@ -1,4 +1,6 @@
\ No newline at end of file
diff --git a/application/controllers/regimen_management.php b/application/controllers/regimen_management.php
index b713e77..15f7b39 100644
--- a/application/controllers/regimen_management.php
+++ b/application/controllers/regimen_management.php
@@ -303,7 +303,7 @@ public function getAllDrugs($regimen) {
public function getNonMappedRegimens($param='0'){
$data = array();
- $query = $this -> db -> query("SELECT s.id,s.code,s.name,sr.Name as category_name,s.category_id
+ $query = $this->db->query("SELECT s.id,s.code,s.name,sr.Name as category_name,s.category_id
FROM sync_regimen s
LEFT JOIN sync_regimen_category sr ON sr.id = s.category_id
WHERE s.id NOT IN(SELECT r.map
@@ -311,7 +311,7 @@ public function getNonMappedRegimens($param='0'){
WHERE r.map !='0')
OR s.name LIKE '%other%'
ORDER BY s.category_id,s.code asc");
- $data['sync_regimen'] = $query -> result_array();
+ $data['sync_regimen'] = $query->result_array();
if($param==1){
echo json_encode($data['sync_regimen']);
die();
diff --git a/application/controllers/regimenchange_management.php b/application/controllers/regimenchange_management.php
index 3efa2d9..80711d6 100644
--- a/application/controllers/regimenchange_management.php
+++ b/application/controllers/regimenchange_management.php
@@ -1,4 +1,6 @@
load -> view("regimenchange_listing_v", $data);
}
-
-
-
}
+// create a buffer
+ob_get_clean();
+?>
\ No newline at end of file
diff --git a/application/controllers/report_management.php b/application/controllers/report_management.php
index 3d88b88..6ef9894 100644
--- a/application/controllers/report_management.php
+++ b/application/controllers/report_management.php
@@ -22,7 +22,7 @@ public function index() {
$this -> listing();
}
- public function getMOHForm($type = "711", $period_start = "", $period_end) {
+ public function getMOHForm($type = "", $period_start = "", $period_end) {
$this -> load -> library('PHPExcel');
$dir = "Export";
if ($type == "711") {
@@ -956,9 +956,9 @@ public function on_ctx($period = "March-2014") {
public function enrolled_in_care($selected_period = "") {
//Variables
$period = explode('-', $selected_period);
- $year = $period[1];
- $month = date('m', strtotime($period[0]));
- $today = date('Y-m-d', strtotime("01-$selected_period"));
+ $year = date('Y', strtotime($selected_period));
+ $month = date('m', strtotime($selected_period));
+ $today = date('Y-m-d', strtotime("$selected_period"));
$below_one_year = 0;
$male_below_fifteen_years = 0;
$female_below_fifteen_years = 0;
@@ -974,6 +974,7 @@ public function enrolled_in_care($selected_period = "") {
AND active='1'";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
+
if ($results) {
$below_one_year = $results[0]['total'];
}
@@ -986,7 +987,7 @@ public function enrolled_in_care($selected_period = "") {
AND DATEDIFF('$today',dob)>=365
AND DATEDIFF('$today',dob)<(365*15)
AND active='1' group by gender";
- $query = $this -> db -> query($sql);
+ $query = $this -> db-> query($sql);
$results = $query -> result_array();
if ($results) {
foreach ($results as $result) {
@@ -1021,7 +1022,7 @@ public function enrolled_in_care($selected_period = "") {
$data = array();
$data['J13'] = $below_one_year;
$data['J14'] = $male_below_fifteen_years;
- $data['L15'] = $female_below_fifteen_years;
+ $data['L14'] = $female_below_fifteen_years;
$data['J15'] = $male_above_fifteen_years;
$data['L15'] = $female_above_fifteen_years;
return $data;
@@ -1057,7 +1058,7 @@ public function currently_in_care($selected_period = "March-2014") {
AND ps.Name LIKE '%active%'
GROUP BY p.patient_number_ccc";
$query = $this -> db -> query($sql);
- $results = $query -> result_array();
+ $results = $query->result_array();
if ($results) {
foreach ($results as $result) {
if (strtolower($result['gender']) == "female") {
@@ -2227,6 +2228,8 @@ public function getScheduledPatients($from = "", $to = "") {
Last Regimen
Appointment Date
Visit Status
+ Source
+
";
@@ -2258,7 +2261,7 @@ public function getScheduledPatients($from = "", $to = "") {
$status = "Not Visited ";
}
}
- $sql = "select patient_number_ccc as art_no,UPPER(first_name)as first_name,UPPER(other_name)as other_name,UPPER(last_name)as last_name, IF(gender=1,'Male','Female')as gender,UPPER(physical) as physical,phone,alternate,FLOOR(DATEDIFF('$today',dob)/365) as age,r.regimen_desc as last_regimen from patient,regimen r where patient_number_ccc='$patient' and current_regimen=r.id and facility_code='$facility_code'";
+ $sql = "select patient_number_ccc as art_no,UPPER(first_name)as first_name,pss.name as source,UPPER(other_name)as other_name,UPPER(last_name)as last_name, IF(gender=1,'Male','Female')as gender,UPPER(physical) as physical,phone,alternate,FLOOR(DATEDIFF('$today',dob)/365) as age,r.regimen_desc as last_regimen from patient LEFT JOIN patient_source pss on pss.id=patient.source,regimen r where patient_number_ccc='$patient' and current_regimen=r.id and facility_code='$facility_code'";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
if ($results) {
@@ -2276,8 +2279,9 @@ public function getScheduledPatients($from = "", $to = "") {
$age = $result['age'];
$last_regimen = $result['last_regimen'];
$appointment = date('d-M-Y', strtotime($appointment));
+ $source=$result['source'];
}
- $row_string .= "$patient_id $first_name $other_name $last_name $phone $address $gender $age $last_regimen $appointment $status ";
+ $row_string .= "$patient_id $first_name $other_name $last_name $phone $address $gender $age $last_regimen $appointment $status $source ";
$overall_total++;
}
}
@@ -2336,6 +2340,7 @@ public function getPatientMissingAppointments($from = "", $to = "") {
Contacts/Address
Appointment Date
Late by (days)
+ Source
";
if ($results) {
@@ -2355,12 +2360,14 @@ public function getPatientMissingAppointments($from = "", $to = "") {
UPPER(first_name)as first_name,
UPPER(other_name)as other_name,
UPPER(last_name)as last_name,
+ pss.name as source,
FLOOR(DATEDIFF('$today',dob)/365) as age,
IF(gender=1,'Male','Female')as gender,
UPPER(physical) as physical,
DATEDIFF('$today',nextappointment) as days_late,
rst.name AS service_type
FROM patient
+ LEFT JOIN patient_source pss on pss.id=patient.source
LEFT JOIN regimen_service_type rst
ON rst.id=patient.service
WHERE patient_number_ccc='$patient'
@@ -2379,7 +2386,8 @@ public function getPatientMissingAppointments($from = "", $to = "") {
$address = $result['physical'];
$appointment = date('d-M-Y', strtotime($appointment));
$days_late_by = $result['days_late'];
- $row_string .= "$patient_no $patient_name $service_type $gender $age $address $appointment $days_late_by ";
+ $source=$result['source'];
+ $row_string .= "$patient_no $patient_name $service_type $gender $age $address $appointment $days_late_by $source ";
}
}
$overall_total++;
@@ -2415,8 +2423,9 @@ public function getPatientsStartedonDate($from = "", $to = "") {
$from = date('Y-m-d', strtotime($from));
$to = date('Y-m-d', strtotime($to));
- $sql = "SELECT p.patient_number_ccc as art_no,UPPER(p.first_name) as first_name,UPPER(p.last_name) as last_name,UPPER(p.other_name)as other_name,FLOOR(DATEDIFF('$today',p.dob)/365) as age, p.dob, IF(p.gender=1,'Male','Female') as gender, p.weight, r.regimen_desc,r.regimen_code,p.start_regimen_date, t.name AS service_type, s.name AS supported_by
+ $sql = "SELECT p.patient_number_ccc as art_no,UPPER(p.first_name) as first_name,pss.name as source, UPPER(p.last_name) as last_name,UPPER(p.other_name)as other_name,FLOOR(DATEDIFF('$today',p.dob)/365) as age, p.dob, IF(p.gender=1,'Male','Female') as gender, p.weight, r.regimen_desc,r.regimen_code,p.start_regimen_date, t.name AS service_type, s.name AS supported_by
from patient p
+ LEFT JOIN patient_source pss on pss.id=p.source
LEFT JOIN regimen r ON p.start_regimen =r.id
LEFT JOIN regimen_service_type t ON t.id = p.service
LEFT JOIN supporter s ON s.id = p.supported_by
@@ -2437,6 +2446,7 @@ public function getPatientsStartedonDate($from = "", $to = "") {
Start Regimen Date
Regimen
Current Weight (Kg)
+ Source
";
@@ -2451,7 +2461,8 @@ public function getPatientsStartedonDate($from = "", $to = "") {
$start_regimen_date = date('d-M-Y', strtotime($result['start_regimen_date']));
$regimen_desc = "" . $result['regimen_code'] . " |" . $result['regimen_desc'];
$weight = number_format($result['weight'], 2);
- $row_string .= "$patient_no $service_type $supported_by $patient_name $gender $age $start_regimen_date $regimen_desc $weight ";
+ $source = $result['source'];
+ $row_string .= "$patient_no $service_type $supported_by $patient_name $gender $age $start_regimen_date $regimen_desc $weight $source ";
$overall_total++;
}
@@ -2474,6 +2485,233 @@ public function getPatientsStartedonDate($from = "", $to = "") {
$this -> load -> view('template', $data);
}
+//************************************************************added patients on isoniazid*****************************************************************8
+ public function getisoniazidPatients($from = "", $to = "") {
+ //Variables
+
+ $row_string = "";
+ $status = "";
+ $overall_total = 0;
+ $today = date('Y-m-d');
+ $late_by = "";
+ $facility_code = $this -> session -> userdata("facility");
+ $from = date('Y-m-d', strtotime($from));
+ $to = date('Y-m-d', strtotime($to));
+
+ //Get all patients who have apppointments on the selected date range
+
+ //Routine Isoniazid
+ //male adult
+ $sql1 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$to') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query1 = $this -> db -> query($sql1);
+ $result = $query1 ->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql2 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$to') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query2 = $this -> db -> query($sql2);
+ $result1 = $query2 -> num_rows();
+ //male child
+ $sql3 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$to') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query3 = $this -> db -> query($sql3);
+ $result3 = $query3 -> num_rows();
+ //female adult
+ $sql4 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$to') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1 ";
+
+ $query4 = $this -> db -> query($sql4);
+ $result4 = $query4 -> num_rows();
+
+ //started on isoniazid
+ //male adult
+ $sql5 = "SELECT * FROM patient WHERE (isoniazid_start_date > '$from') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1 ";
+
+ $query5 = $this -> db -> query($sql5);
+ $result5 = $query5 ->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql6 = "SELECT * FROM patient WHERE (isoniazid_start_date > '$from') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query6 = $this -> db -> query($sql6);
+ $result6= $query6 -> num_rows();
+//male child
+ $sql7 = "SELECT * FROM patient WHERE (isoniazid_start_date > '$from') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query7 = $this -> db -> query($sql7);
+ $result7 = $query7 -> num_rows();
+ //female adult
+ $sql8 = "SELECT * FROM patient WHERE (isoniazid_start_date > '$from') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query8 = $this -> db -> query($sql8);
+ $result8 = $query8 -> num_rows();
+
+ //completed on isoniazid
+ //male adult
+ $sql9 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$from') AND (isoniazid_end_date < '$to') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1 ";
+
+ $query9 = $this -> db -> query($sql9);
+ $result9 = $query9 ->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql10 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$from') AND (isoniazid_end_date < '$to') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query10 = $this -> db -> query($sql10);
+ $result10= $query10 -> num_rows();
+ //male child
+ $sql11 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$from') AND (isoniazid_end_date < '$to') AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query11 = $this -> db -> query($sql11);
+ $result11 = $query11 -> num_rows();
+ //female adult
+ $sql12 = "SELECT * FROM patient WHERE (isoniazid_end_date > '$from') AND (isoniazid_end_date < '$to') AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query12 = $this -> db -> query($sql12);
+ $result12 = $query12 -> num_rows();
+
+ //cotrimoxazole
+ //male adult
+ $sql13 = "SELECT * FROM patient WHERE drug_prophylaxis=1 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query13 = $this -> db -> query($sql13);
+ $result13 = $query13 ->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql14 = "SELECT * FROM patient WHERE drug_prophylaxis=1 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query14 = $this -> db -> query($sql14);
+ $result14= $query14 -> num_rows();
+ //male child
+ $sql15 = "SELECT * FROM patient WHERE drug_prophylaxis=1 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query15 = $this -> db -> query($sql15);
+ $result15 = $query15 -> num_rows();
+ //female adult
+ $sql16 = "SELECT * FROM patient WHERE drug_prophylaxis=1 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query16 = $this -> db -> query($sql16);
+ $result16 = $query16 -> num_rows();
+
+ //dapsone
+ //male adult
+ $sql17 = "SELECT * FROM patient WHERE drug_prophylaxis=2 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1 ";
+
+ $query17 = $this -> db -> query($sql17);
+ $result17 = $query17 ->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql18 = "SELECT * FROM patient WHERE drug_prophylaxis=2 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query18 = $this -> db -> query($sql18);
+ $result18= $query18 -> num_rows();
+ //male child
+ $sql19 = "SELECT * FROM patient WHERE drug_prophylaxis=2 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1 ";
+
+ $query19 = $this -> db -> query($sql19);
+ $result19 = $query19 -> num_rows();
+ //female adult
+ $sql20 = "SELECT * FROM patient WHERE drug_prophylaxis=2 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query20 = $this -> db -> query($sql20);
+ $result20 = $query20 -> num_rows();
+
+ //Fluconazole
+ //male adult
+ $sql21 = "SELECT * FROM patient WHERE drug_prophylaxis=4 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query21 = $this -> db -> query($sql21);
+ $result21 = $query21->num_rows();
+ //$count=$result['COUNT(*)'];
+ //female adult
+ $sql22 = "SELECT * FROM patient WHERE drug_prophylaxis=4 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)>15 AND current_status=1";
+
+ $query22 = $this -> db -> query($sql22);
+ $result22= $query22 -> num_rows();
+ //male child
+ $sql23 = "SELECT * FROM patient WHERE drug_prophylaxis=4 AND gender=1 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query23 = $this -> db -> query($sql23);
+ $result23 = $query23 -> num_rows();
+ //female adult
+ $sql24 = "SELECT * FROM patient WHERE drug_prophylaxis=4 AND gender=2 AND FLOOR(DATEDIFF('$from',dob)/365)<15 AND current_status=1";
+
+ $query24 = $this -> db -> query($sql24);
+ $result24 = $query24 -> num_rows();
+
+ $row_string = "
+
+
+
+
+ Male Adults
+ Female Adults
+ Male Children
+ Female Children
+
+
+
+
+
+ No of patients on Routine isoniazid
+ ".$result."
+ ".$result1."
+ ".$result3 ."
+ ".$result4."
+
+
+ No of patients started on isoniazid
+ ".$result5."
+ ".$result6."
+ ".$result7 ."
+ ".$result8."
+
+
+ No of patients completed isoniazid
+ ".$result9."
+ ".$result10."
+ ".$result11 ."
+ ".$result12."
+
+
+ No of patients on Cotrimoxazole
+ ".$result13."
+ ".$result14."
+ ".$result15 ."
+ ".$result16."
+
+
+ No of patients on Dapsone
+ ".$result17."
+ ".$result18."
+ ".$result19 ."
+ ".$result20."
+
+
+ No of patients on Fluconazole
+ ".$result21."
+ ".$result22."
+ ".$result23 ."
+ ".$result24."
+
+ ";
+
+
+ $row_string .= "
";
+ $data['from'] = date('d-M-Y', strtotime($from));
+ $data['to'] = date('d-M-Y', strtotime($to));
+ $data['dyn_table'] = $row_string;
+ $data['visited_later'] = $visited_later;
+
+ $data['title'] = "webADT | Reports";
+ $data['hide_side_menu'] = 1;
+ $data['banner_text'] = "Facility Reports";
+ //$data['selected_report_type_link'] = "visiting_patient_report_row";
+ //$data['selected_report_type'] = "Visiting Patients";
+ $data['report_title'] = "List of Patients on isoniazid";
+ $data['facility_name'] = $this -> session -> userdata('facility_name');
+ $data['content_view'] = 'reports/patients_on_isoniazid_v';
+ $this -> load -> view('template', $data);
+ }
public function getPatientsforRefill($from = "", $to = "") {
//Variables
@@ -2483,20 +2721,113 @@ public function getPatientsforRefill($from = "", $to = "") {
$from = date('Y-m-d', strtotime($from));
$to = date('Y-m-d', strtotime($to));
+ $sql = "SELECT pv.*
+ FROM vw_routine_refill_visit pv
+ WHERE pv.visit_date
+ BETWEEN '$from'
+ AND '$to'";
+
+ $query = $this -> db -> query($sql);
+ $results = $query -> result_array();
+ $row_string = "
+
+
+ Patient No
+ Type of Service
+ Client Support
+ Patient Name
+ Current Age
+ Sex
+ Regimen
+ Visit Date
+ Current Weight (Kg)
+ Missed Pills Adherence (%)
+ Pill Count Adherence (%)
+ Appointment Adherence (%)
+ Average Adherence (%)
+ Source
+
+
+ ";
+ if ($results) {
+ foreach ($results as $result) {
+ $patient_no = $result['patient_number'];
+ $service_type = $result['type_of_service'];
+ $supported_by = $result['client_support'];
+ $patient_name = $result['patient_name'];
+ $age = $result['current_age'];
+ $gender = $result['sex'];
+ $appointments = $result['appointment_adherence'];
+ $appointments = str_replace(">","",$appointments);
+ $appointments = str_replace("=","",$appointments);
+ if(strpos($appointments, "-")!==false){
+ $pos = strpos($appointments, "-");
+ $val1 = substr($appointments, 0,$pos);
+ $val2 = substr($appointments,$pos+1);
+ $sum = intval($val1)+intval($val2);
+ $appointments = $sum / 2;
+ }
+ $dispensing_date = date('d-M-Y', strtotime($result['visit_date']));
+ $regimen_desc = "" . $result['regimen'] . " ";
+ $weight = $result['current_weight'];
+ $source = $result['source'];
+ $pill_count = $result['pill_count_adherence'];
+ $missed_pills = $result['missed_pill_adherence'];
+ $adherence_array = array($missed_pills, $pill_count, $appointments );
+ $avg_adherence = number_format(array_sum($adherence_array) / count($adherence_array), 2);
+ $row_string .= "$patient_no $service_type $supported_by $patient_name $age $gender $regimen_desc $dispensing_date $weight
+ $missed_pills $pill_count $appointments $avg_adherence $source ";
+
+ $overall_total++;
+ }
+
+ } else {
+ //$row_string .= "No Data Available ";
+ }
+
+ $row_string .= "
";
+ $data['from'] = date('d-M-Y', strtotime($from));
+ $data['to'] = date('d-M-Y', strtotime($to));
+ $data['dyn_table'] = $row_string;
+ $data['all_count'] = $overall_total;
+ $data['title'] = "webADT | Reports";
+ $data['hide_side_menu'] = 1;
+ $data['banner_text'] = "Facility Reports";
+ $data['selected_report_type_link'] = "visiting_patient_report_row";
+ $data['selected_report_type'] = "Visiting Patients";
+ $data['report_title'] = "List of Patients Visited For Refill";
+ $data['facility_name'] = $this -> session -> userdata('facility_name');
+ $data['content_view'] = 'reports/patients_for_refill_v';
+ $this -> load -> view('template', $data);
+ }
+
+
+ public function getPatientsforRefill1($from = "", $to = "") {
+ //Variables
+ $overall_total = 0;
+ $today = date('Y-m-d');
+ $facility_code = $this -> session -> userdata("facility");
+ $from = date('Y-m-d', strtotime($from));
+ $to = date('Y-m-d', strtotime($to));
+
$sql = "SELECT
pv.patient_id as art_no,
+ pv.pill_count,
+ pv.missed_pills,
pv.dispensing_date,
t.name AS service_type,
s.name AS supported_by,
UPPER(p.first_name) as first_name ,
UPPER(p.other_name) as other_name ,
UPPER(p.last_name)as last_name,
+ pss.name as source,
FLOOR(DATEDIFF('$today',p.dob)/365) as age,
pv.current_weight as weight,
IF(p.gender=1,'Male','Female')as gender,
r.regimen_desc,
r.regimen_code,
+ DATEDIFF(pv.dispensing_date,pa.appointment) as no_of_days,
AVG(pv.adherence) as avg_adherence
FROM patient_visit pv
LEFT JOIN patient p ON p.patient_number_ccc=pv.patient_id
@@ -2504,13 +2835,16 @@ public function getPatientsforRefill($from = "", $to = "") {
LEFT JOIN supporter s ON s.id=p.supported_by
LEFT JOIN regimen r ON r.id=p.current_regimen
LEFT JOIN regimen_service_type t ON t.id=p.service
+ LEFT JOIN patient_source pss on pss.id=p.source
LEFT JOIN patient_status ps ON ps.id=p.current_status
- WHERE pv.dispensing_date
+ LEFT JOIN patient_appointment pa ON p.patient_number_ccc=pa.patient
+ WHERE (pv.dispensing_date
BETWEEN '$from'
- AND '$to'
+ AND '$to')
AND v.name like '%routine%'
AND ps.name LIKE '%active%'
AND pv.facility = '$facility_code'
+ AND (pa.appointment BETWEEN '$from' AND '$to')
GROUP BY pv.patient_id,pv.dispensing_date";
$query = $this -> db -> query($sql);
@@ -2527,7 +2861,11 @@ public function getPatientsforRefill($from = "", $to = "") {
Regimen
Visit Date
Current Weight (Kg)
+ Missed Pills
+ Pill Count
+ Appointment
Average Adherence
+ Source
";
@@ -2539,11 +2877,33 @@ public function getPatientsforRefill($from = "", $to = "") {
$patient_name = $result['first_name'] . " " . $result['other_name'] . " " . $result['last_name'];
$age = $result['age'];
$gender = $result['gender'];
+ $appointments = $result['no_of_days'];
+ if($appointments >= 90){
+ $appointment="Lost Followup";
+
+ }
+ else if($appointments >= 15 && $appointments <= 90){
+ $appointment="Defaulter";
+
+ }
+ else if($appointments >= 3 && $appointments <= 14){
+
+ $appointment = "Missed";
+ }
+ else if($appointments <= 2) {
+ $appointment = "On time";
+ }
+
$dispensing_date = date('d-M-Y', strtotime($result['dispensing_date']));
$regimen_desc = "" . $result['regimen_code'] . " |" . $result['regimen_desc'];
$weight = $result['weight'];
+ $source = $result['source'];
+ $pill_count = $result['pill_count'];
+ $missed_pills = $result['missed_pills'];
$avg_adherence = number_format($result['avg_adherence'], 2);
- $row_string .= "$patient_no $service_type $supported_by $patient_name $age $gender $regimen_desc $dispensing_date $weight $avg_adherence ";
+ $row_string .= "$patient_no $service_type $supported_by $patient_name $age $gender $regimen_desc $dispensing_date $weight
+ $missed_pills $pill_count $appointment $avg_adherence $source ";
+
$overall_total++;
}
@@ -2727,7 +3087,7 @@ public function getStartedonART($from = "", $to = "", $supported_by = 0) {
$total_adult_male_art = number_format($total_adult_male);
$total_adult_male_art_percentage = number_format(($total_adult_male / $source_total) * 100, 1);
} else if ($service_name == "PEP") {
- $overall_adult_male_pep += $total_adult_male;
+ $oaverall_adult_male_pep += $total_adult_male;
$total_adult_male_pep = number_format($total_adult_male);
$total_adult_male_pep_percentage = number_format(($total_adult_male_pep / $source_total) * 100, 1);
} else if ($service_name == "OI Only") {
@@ -3357,13 +3717,18 @@ public function drug_consumption($year = "",$pack_unit="unit") {
$tot_drugs = $this -> db -> get();
$iTotal = count($tot_drugs -> result_array());
+ //echo "";print_r($rResult->result_array());die;
// Output
- $output = array('sEcho' => intval($sEcho), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => array());
-
+ $output = array('sEcho' => intval($sEcho), 'iTotalRecords' => $iTotal, 'iTotalDisplayRecords' => $iFilteredTotal, 'aaData' => array());
foreach ($rResult->result_array() as $aRow) {
+ /*json is sensitive on ' so we need to replace the drugs with ' to have /
+ Victoria Wasonga
+ */
+ $aRow['drug'] = addslashes($aRow['drug']);
$sql = "select '" . $aRow['drug'] . "' as drug_name,'" . $aRow['pack_size'] . "' as pack_size,'" . $aRow['name'] . "' as unit, month(DATE(d_c.period)) as month,d_c.amount as total_consumed
from drug_cons_balance d_c
where d_c.drug_id='" . $aRow['id'] . "' and d_c.period LIKE '%" . $year . "%' and facility='" . $facility_code . "' order by d_c.period asc";
+
$drug_details_sql = $this -> db -> query($sql);
$sql_array = $drug_details_sql -> result_array();
$drug_consumption = array();
@@ -3408,7 +3773,7 @@ public function drug_consumption($year = "",$pack_unit="unit") {
}
}
$output['aaData'][] = $row;
- }
+ }
echo json_encode($output);
}
@@ -4284,7 +4649,8 @@ public function graph_patients_enrolled_in_year($year = "") {
WHERE YEAR(p.date_enrolled)='$year'
AND MONTH(p.date_enrolled)='$month'
AND rst.name LIKE '%$service%'
- AND p.facility_code='$facility_code'";
+ AND p.facility_code='$facility_code'
+ AND p.active = '1'";
$query = $this -> db -> query($sql);
$results = $query -> result_array();
if($results){
@@ -4364,326 +4730,457 @@ public function graphical_adherence($type="appointment",$start_date = "", $end_d
$data['banner_text'] = "Facility Reports";
$data['selected_report_type_link'] = "early_warning_report_select";
$data['selected_report_type'] = "Early Warning Indicators";
-
- if($type=="appointment"){
- $data['report_title'] = "Graphical Patient Adherence By Appointment";
- }
- else if($type=="pill_count"){
- $data['report_title'] = "Graphical Patient Adherence By Pill Count";
- }
-
+ $data['report_title'] = "Graphical Patient Adherence By ".ucwords(str_replace('_', ' ', $type));
$data['facility_name'] = $this -> session -> userdata('facility_name');
$data['content_view'] = 'reports/graphical_adherence_v';
$this -> load -> view('template', $data);
}
- public function getAdherence($type="appointment",$start_date = "", $end_date = "" ,$type = "")
+ public function getAdherence($name="appointment",$start_date = "", $end_date = "" ,$type = "")
{
- $ontime = 0;
- $missed = 0;
- $defaulter = 0;
- $lost_to_followup = 0;
- $overview_total = 0;
-
- $art_total = 0;
- $non_art_total = 0;
- $male_total = 0;
- $female_total = 0;
- $fifteen_total = 0;
- $over_fifteen_total = 0;
- $twenty_four_total = 0;
-
- $adherence = array(
- 'total' => 0,
- 'on_time' => 0,
- 'missed' => 0,
- 'defaulter'=> 0,
- 'lost_to_followup'=> 0);
-
- $art_adherence['art'] = array(
- 'total' => 0,
- 'on_time' => 0,
- 'missed' => 0,
- 'defaulter'=> 0,
- 'lost_to_followup'=> 0);
- $art_adherence['non_art'] = array(
+ if($name == "appointment"){
+ $ontime = 0;
+ $missed = 0;
+ $defaulter = 0;
+ $lost_to_followup = 0;
+ $overview_total = 0;
+
+ $art_total = 0;
+ $non_art_total = 0;
+ $male_total = 0;
+ $female_total = 0;
+ $fifteen_total = 0;
+ $over_fifteen_total = 0;
+ $twenty_four_total = 0;
+
+ $adherence = array(
+ 'total' => 0,
+ 'on_time' => 0,
+ 'missed' => 0,
+ 'defaulter'=> 0,
+ 'lost_to_followup'=> 0);
+
+ $art_adherence['art'] = array(
'total' => 0,
'on_time' => 0,
'missed' => 0,
'defaulter'=> 0,
'lost_to_followup'=> 0);
-
- $gender_adherence['male'] = array(
- 'total' => 0,
- 'on_time' => 0,
- 'missed' => 0,
- 'defaulter'=> 0,
- 'lost_to_followup'=> 0);
- $gender_adherence['female'] = array(
- 'total' => 0,
- 'on_time' => 0,
- 'missed' => 0,
- 'defaulter'=> 0,
- 'lost_to_followup'=> 0);
-
- $age_adherence['<15'] = array(
- 'total' => 0,
- 'on_time' => 0,
- 'missed' => 0,
- 'defaulter'=> 0,
- 'lost_to_followup'=> 0);
- $age_adherence['15_24'] = array(
- 'total' => 0,
+ $art_adherence['non_art'] = array(
+ 'total' => 0,
+ 'on_time' => 0,
+ 'missed' => 0,
+ 'defaulter'=> 0,
+ 'lost_to_followup'=> 0);
+
+ $gender_adherence['male'] = array(
+ 'total' => 0,
'on_time' => 0,
'missed' => 0,
'defaulter'=> 0,
'lost_to_followup'=> 0);
-
- $age_adherence['>24'] = array(
- 'total' => 0,
+ $gender_adherence['female'] = array(
+ 'total' => 0,
+ 'on_time' => 0,
+ 'missed' => 0,
+ 'defaulter'=> 0,
+ 'lost_to_followup'=> 0);
+
+ $age_adherence['<15'] = array(
+ 'total' => 0,
'on_time' => 0,
'missed' => 0,
'defaulter'=> 0,
'lost_to_followup'=> 0);
+ $age_adherence['15_24'] = array(
+ 'total' => 0,
+ 'on_time' => 0,
+ 'missed' => 0,
+ 'defaulter'=> 0,
+ 'lost_to_followup'=> 0);
+
+ $age_adherence['>24'] = array(
+ 'total' => 0,
+ 'on_time' => 0,
+ 'missed' => 0,
+ 'defaulter'=> 0,
+ 'lost_to_followup'=> 0);
+
+
+
+ /*
+ * Get all appointments for a patient in selected period
+ * For each appointment, get corresponding visit that is equal or greater than date of appointment
+ * e.g. if appointment is 2014-09-01 and visits for this period are 2014-09-03, 2014-09-15, use 2014-09-03
+ * Calculate the difference of days between those two dates and find adherence
+ */
+ $sql = "SELECT
+ pa.appointment,
+ pa.patient,
+ IF(UPPER(rst.Name) ='ART','art','non_art') as service,
+ IF(UPPER(g.name) ='MALE','male','female') as gender,
+ IF(FLOOR(DATEDIFF(CURDATE(),p.dob)/365)<15,'<15', IF(FLOOR(DATEDIFF(CURDATE(),p.dob)/365) >= 15 AND FLOOR(DATEDIFF(CURDATE(),p.dob)/365) <= 24,'15_24','>24')) as age
+ FROM patient_appointment pa
+ LEFT JOIN patient p ON p.patient_number_ccc = pa.patient
+ LEFT JOIN regimen_service_type rst ON rst.id = p.service
+ LEFT JOIN gender g ON g.id = p.gender
+ WHERE pa.appointment
+ BETWEEN '$start_date'
+ AND '$end_date'
+ GROUP BY pa.patient,pa.appointment
+ ORDER BY pa.appointment";
+ $query = $this ->db ->query($sql);
+ $results = $query -> result_array();
+ if($results)
+ {
+ foreach($results as $result){
+ $patient = $result['patient'];
+ $appointment = $result['appointment'];
+ $service = $result['service'];
+ $gender = $result['gender'];
+ $age = $result['age'];
+
+ $sql = "SELECT
+ DATEDIFF('$appointment',pv.dispensing_date) as no_of_days
+ FROM v_patient_visits pv
+ WHERE pv.patient_id='$patient'
+ AND pv.dispensing_date >= '$appointment'
+ GROUP BY pv.patient_id,pv.dispensing_date
+ ORDER BY pv.dispensing_date ASC
+ LIMIT 1";
+ $query = $this ->db ->query($sql);
+ $results = $query -> result_array();
+
+ /*
+ Create date object for appointment date (datetime1)
+ Get the date difference between the appointment date and now (datetime2)
+ */
+ $datetime1 = new DateTime($appointment);
+ $datetime2 = new DateTime('now');
+ $interval = $datetime1->diff($datetime2);
+ $period = $interval->format('%a');
+
+ if($results)
+ {
+ $period = $results[0]['no_of_days'];
+ }
+ if($type == "overview")
+ {
+ //Add period to array
+ if($period < 3){
+ $ontime++;
+ $adherence['on_time'] += 1;
+ }
+ else if($period >= 3 && $period <= 14){
+ $missed++;
+ $adherence['missed'] += 1;
+ }
+ else if($period >= 15 && $period <= 89){
+ $defaulter++;
+ $adherence['defaulter'] += 1;
+ }
+ else{
+ $lost_to_followup++;
+ $adherence['lost_to_followup'] += 1;
+ }
+ $overview_total++;
+ }
+ else if($type == "service")
+ {
+ //Add period to array
+ if($period < 3){
+ $ontime++;
+ $art_adherence[$service]['on_time'] += 1;
+ }
+ else if($period >= 3 && $period <= 14){
+ $missed++;
+ $art_adherence[$service]['missed'] += 1;
+ }
+ else if($period >= 15 && $period <= 89){
+ $defaulter++;
+ $art_adherence[$service]['defaulter'] += 1;
+ }
+ else{
+ $lost_to_followup++;
+ $art_adherence[$service]['lost_to_followup'] += 1;
+ }
-
- /*
- * Get all appointments for a patient in selected period
- * For each appointment, get corresponding visit that is equal or greater than date of appointment
- * e.g. if appointment is 2014-09-01 and visits for this period are 2014-09-03, 2014-09-15, use 2014-09-03
- * Calculate the difference of days between those two dates and find adherence
- */
- $sql = "SELECT
- pa.appointment,
- pa.patient,
- IF(UPPER(rst.Name) ='ART','art','non_art') as service,
- IF(UPPER(g.name) ='MALE','male','female') as gender,
- IF(FLOOR(DATEDIFF(CURDATE(),p.dob)/365)<15,'<15', IF(FLOOR(DATEDIFF(CURDATE(),p.dob)/365) >= 15 AND FLOOR(DATEDIFF(CURDATE(),p.dob)/365) <= 24,'15_24','>24')) as age
- FROM patient_appointment pa
- LEFT JOIN patient p ON p.patient_number_ccc = pa.patient
- LEFT JOIN regimen_service_type rst ON rst.id = p.service
- LEFT JOIN gender g ON g.id = p.gender
- WHERE pa.appointment
- BETWEEN '$start_date'
- AND '$end_date'
- GROUP BY pa.patient,pa.appointment
- ORDER BY pa.appointment";
- $query = $this ->db ->query($sql);
- $results = $query -> result_array();
- if($results)
- {
- foreach($results as $result){
- $patient = $result['patient'];
- $appointment = $result['appointment'];
- $service = $result['service'];
- $gender = $result['gender'];
- $age = $result['age'];
-
- $sql = "SELECT
- DATEDIFF('$appointment',pv.dispensing_date) as no_of_days
- FROM v_patient_visits pv
- WHERE pv.patient_id='$patient'
- AND pv.dispensing_date >= '$appointment'
- GROUP BY pv.patient_id,pv.dispensing_date
- ORDER BY pv.dispensing_date ASC
- LIMIT 1";
- $query = $this ->db ->query($sql);
- $results = $query -> result_array();
-
- $period = 90;
-
- if($results)
- {
- $period = $results[0]['no_of_days'];
- }
-
- if($type == "overview")
- {
- //Add period to array
- if($period <= 3){
- $ontime++;
- $adherence['on_time'] = $ontime;
- }
- else if($period > 3 && $period <= 14){
- $missed++;
- $adherence['missed'] = $missed++;
- }
- else if($period >= 15 && $period <= 89){
- $defaulter++;
- $adherence['defaulter'] = $defaulter;
- }
- else{
- $lost_to_followup++;
- $adherence['lost_to_followup'] = $lost_to_followup;
- }
- $overview_total++;
- }
- else if($type == "service")
- {
- //Add period to array
- if($period <= 3){
- $ontime++;
- $art_adherence[$service]['on_time'] = $ontime;
- }
- else if($period > 3 && $period <= 14){
- $missed++;
- $art_adherence[$service]['missed'] = $missed++;
- }
- else if($period >= 15 && $period <= 89){
- $defaulter++;
- $art_adherence[$service]['defaulter'] = $defaulter;
- }
- else{
- $lost_to_followup++;
- $art_adherence[$service]['lost_to_followup'] = $lost_to_followup;
}
-
- }
- else if($type == "gender")
- {
- //Add period to array
- if($period <= 3){
- $ontime++;
- $gender_adherence[$gender]['on_time'] = $ontime;
- }
- else if($period > 3 && $period <= 14){
- $missed++;
- $gender_adherence[$gender]['missed'] = $missed++;
- }
- else if($period >= 15 && $period <= 89){
- $defaulter++;
- $gender_adherence[$gender]['defaulter'] = $defaulter;
- }
- else{
- $lost_to_followup++;
- $gender_adherence[$gender]['lost_to_followup'] = $lost_to_followup;
+ else if($type == "gender")
+ {
+ //Add period to array
+ if($period < 3){
+ $ontime++;
+ $gender_adherence[$gender]['on_time'] += 1;
+ }
+ else if($period >= 3 && $period <= 14){
+ $missed++;
+ $gender_adherence[$gender]['missed'] += 1;
+ }
+ else if($period >= 15 && $period <= 89){
+ $defaulter++;
+ $gender_adherence[$gender]['defaulter'] += 1;
+ }
+ else{
+ $lost_to_followup++;
+ $gender_adherence[$gender]['lost_to_followup'] += 1;
+ }
}
- }
- else if($type == "age")
- {
- //Add period to array
- if($period <= 3){
- $ontime++;
- $age_adherence[$age]['on_time'] = $ontime;
- }
- else if($period > 3 && $period <= 14){
- $missed++;
- $age_adherence[$age]['missed'] = $missed++;
- }
- else if($period >= 15 && $period <= 89){
- $defaulter++;
- $age_adherence[$age]['defaulter'] = $defaulter;
- }
- else{
- $lost_to_followup++;
- $age_adherence[$age]['lost_to_followup'] = $lost_to_followup;
- }
- }
- }
-
- if($type == "overview")
- {
- $adherence['total'] = $overview_total;
- $data_array = $adherence;
- }
- else if($type == "service")
- {
- foreach ($art_adherence as $column=>$values) {
- foreach ($values as $value) {
- if($column == "art")
- {
- $art_total+=$value;
+ else if($type == "age")
+ {
+ //Add period to array
+ if($period < 3){
+ $ontime++;
+ $age_adherence[$age]['on_time'] += 1;
}
- else
- {
- $non_art_total+=$value;
+ else if($period >= 3 && $period <= 14){
+ $missed++;
+ $age_adherence[$age]['missed'] += 1;
}
- }
- }
-
- $art_adherence['art']['total'] = $art_total;
- $art_adherence['non_art']['total'] = $non_art_total;
- $data_array = $art_adherence;
- }
- else if($type == "gender")
- {
- foreach ($gender_adherence as $column=>$values) {
- foreach ($values as $value) {
- if($column == "male")
- {
- $male_total+=$value;
+ else if($period >= 15 && $period <= 89){
+ $defaulter++;
+ $age_adherence[$age]['defaulter'] += 1;
}
- else
- {
- $female_total+=$value;
+ else{
+ $lost_to_followup++;
+ $age_adherence[$age]['lost_to_followup'] += 1;
}
+ }
+ }
+
+ if($type == "overview")
+ {
+ $adherence['total'] = $overview_total;
+ $data_array = $adherence;
+ }
+ else if($type == "service")
+ {
+ foreach ($art_adherence as $column=>$values) {
+ foreach ($values as $value) {
+ if($column == "art")
+ {
+ $art_total+=$value;
+ }
+ else
+ {
+ $non_art_total+=$value;
+ }
+ }
}
- }
- $gender_adherence['male']['total'] = $male_total;
- $gender_adherence['female']['total'] = $female_total;
- $data_array = $gender_adherence;
- }
+ $art_adherence['art']['total'] = $art_total;
+ $art_adherence['non_art']['total'] = $non_art_total;
+ $data_array = $art_adherence;
+ }
+ else if($type == "gender")
+ {
+ foreach ($gender_adherence as $column=>$values) {
+ foreach ($values as $value) {
+ if($column == "male")
+ {
+ $male_total+=$value;
+ }
+ else
+ {
+ $female_total+=$value;
+ }
+ }
+ }
- else if($type == "age")
- {
- foreach ($age_adherence as $column=>$values) {
- foreach ($values as $value) {
- if($column == "<15")
- {
- $fifteen_total+=$value;
- }
- else if($column == "15_24")
- {
- $over_fifteen_total+=$value;
- }
- else
- {
- $twenty_four_total+=$value;
- }
+ $gender_adherence['male']['total'] = $male_total;
+ $gender_adherence['female']['total'] = $female_total;
+ $data_array = $gender_adherence;
+ }
+
+ else if($type == "age")
+ {
+ foreach ($age_adherence as $column=>$values) {
+ foreach ($values as $value) {
+ if($column == "<15")
+ {
+ $fifteen_total+=$value;
+ }
+ else if($column == "15_24")
+ {
+ $over_fifteen_total+=$value;
+ }
+ else
+ {
+ $twenty_four_total+=$value;
+ }
+ }
}
- }
- $age_adherence['<15']['total'] = $fifteen_total;
- $age_adherence['15_24']['total'] = $over_fifteen_total;
- $age_adherence['>24']['total'] = $twenty_four_total;
- $data_array = $age_adherence;
- }
+ $age_adherence['<15']['total'] = $fifteen_total;
+ $age_adherence['15_24']['total'] = $over_fifteen_total;
+ $age_adherence['>24']['total'] = $twenty_four_total;
+ $data_array = $age_adherence;
+ }
- foreach($data_array as $index => $mydata)
- {
- if($type == 'overview')
- {
- $main_array = array();
- $temp_array['name'] = "Status";
- $temp_array['data'] = array_values($data_array);
- $main_array[]=$temp_array;
- }
- else{
- $temp_array['name'] = $index;
- $temp_array['data'] = array_values($mydata);
- $main_array[]=$temp_array;
- }
- }
- }
- //chart data
- $resultArray = json_encode($main_array);
- $categories = json_encode(array('Total','On Time','Missed','Defaulter','Lost to Followup'));
+ foreach($data_array as $index => $mydata)
+ {
+ if($type == 'overview')
+ {
+ $main_array = array();
+ $temp_array['name'] = "Status";
+ $temp_array['data'] = array_values($data_array);
+ $main_array[]=$temp_array;
+ }
+ else{
+ $temp_array['name'] = $index;
+ $temp_array['data'] = array_values($mydata);
+ $main_array[]=$temp_array;
+ }
+ }
+ }
+
+ $categories = json_encode(array('Total','On Time','Missed','Defaulter','Lost to Followup'));
+ $data['xAxix'] = 'Status';
+ $data['yAxix'] = 'Visits';
+
+ }else{
+ $categories = json_encode(array('Total','>=95','90-95','80-90','<80'));
+ $main_array = $this->get_pill_adherence($start_date, $end_date, $name, $type);
+ $data['xAxix'] = 'Adherence Rate (%)';
+ $data['yAxix'] = 'Visits';
+ }
//chart settings
+ $resultArray = json_encode($main_array);
$data['resultArraySize'] = 6;
$data['container'] = 'chart_sales_'.$type;
$data['chartType'] = 'column';
$data['title'] = 'Chart';
$data['chartTitle'] = 'Adherence By '.ucwords($type).' Between '.date('d/M/Y', strtotime($start_date)).' And '.date('d/M/Y', strtotime($end_date));
$data['categories'] = $categories;
- $data['xAxix'] = 'Status';
$data['suffix']= '';
- $data['yAxix'] = 'Totals';
$data['resultArray'] = $resultArray;
$this -> load -> view('graph_v', $data);
}
+ public function get_pill_adherence($start_date, $end_date, $report_name, $report_filter){
+ //Parameters
+ $params = array(
+ 'pill_count' => array(
+ 'overview' => array(
+ 'select_filter' => '',
+ 'group_filter' => '',
+ 'data_array' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ ),
+ 'service' => array(
+ 'select_filter' => 'service,',
+ 'group_filter' => ',service',
+ 'data_array' => array(
+ 'art' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ 'non_art' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ ),
+ 'gender' => array(
+ 'select_filter' => 'gender,',
+ 'group_filter' => ',gender',
+ 'data_array' => array(
+ 'male' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ 'female' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ ),
+ 'age' => array(
+ 'select_filter' => 'age,',
+ 'group_filter' => ',age',
+ 'data_array' => array(
+ '>24' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ '15_25' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ '<15' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ )
+ ),
+ 'missed_pill' => array(
+ 'overview' => array(
+ 'select_filter' => '',
+ 'group_filter' => '',
+ 'data_array' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ ),
+ 'service' => array(
+ 'select_filter' => 'service,',
+ 'group_filter' => ',service',
+ 'data_array' => array(
+ 'art' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ 'non_art' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ ),
+ 'gender' => array(
+ 'select_filter' => 'gender,',
+ 'group_filter' => ',gender',
+ 'data_array' => array(
+ 'male' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ 'female' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ ),
+ 'age' => array(
+ 'select_filter' => 'age,',
+ 'group_filter' => ',age',
+ 'data_array' => array(
+ '>24' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ '15_25' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0),
+ '<15' => array('Total' => 0, '>=95' => 0, '90-95' => 0, '80-90' => 0, '<80' => 0)
+ )
+ )
+ )
+ );
+
+ //Default data
+ $main_data = $params[$report_name][$report_filter]['data_array'];
+ //Filters
+ $column_filter = $report_filter+'_adherence';
+ $select_filter = $params[$report_name][$report_filter]['select_filter'];
+ $group_filter = $params[$report_name][$report_filter]['group_filter'];
+
+ //Get data from adherence view
+ $sql = "SELECT
+ CASE WHEN $column_filter >= 95 THEN '>=95'
+ WHEN $column_filter >= 90 AND $column_filter < 96 THEN '90-95'
+ WHEN $column_filter >= 80 AND $column_filter < 91 THEN '80-90'
+ ELSE '<80' END AS adherence,
+ $select_filter
+ COUNT(*) AS total
+ FROM vw_patient_pill_adherence
+ WHERE visit_date
+ BETWEEN '$start_date' AND '$end_date'
+ GROUP BY CASE WHEN $column_filter >= 95 THEN '>=95'
+ WHEN $column_filter >= 90 AND $column_filter < 96 THEN '90-95'
+ WHEN $column_filter >= 80 AND $column_filter < 91 THEN '80-90'
+ ELSE '<80' END
+ $group_filter";
+
+ $results = $this ->db ->query($sql) -> result_array();
+ if($results)
+ {
+ foreach($results as $result){
+ if($report_filter == 'overview'){
+ $main_data[$result['adherence']] = floatval($result['total']);
+ $main_data['Total'] += floatval($main_data[$result['adherence']]);
+ }else{
+ $main_data[$result[$report_filter]][$result['adherence']] = floatval($result['total']);
+ $main_data[$result[$report_filter]]['Total'] += floatval($main_data[$result[$report_filter]][$result['adherence']]);
+ }
+ }
+ }
+
+ //Format chart data
+ $main_array = array();
+ if($report_filter == 'overview')
+ {
+ $main_array[] = array('name'=>'Overall', 'data' => array_values($main_data));
+ }else
+ {
+ foreach($main_data as $index => $mydata)
+ {
+ $main_array[] = array('name'=> $index, 'data' => array_values($mydata));;
+ }
+ }
+
+ return $main_array;
+ }
+
public function patients_nonadherence($start_date = "", $end_date = "") {
$data['from'] = $start_date;
$data['to'] = $end_date;
@@ -5412,7 +5909,7 @@ public function getDrugsIssued($stock_type, $start_date = "", $end_date = "")
$end_date = date('Y-m-d',strtotime($end_date));
//Get Drugs Received in Period
- $this->db->select("UPPER(d.drug) as drug_name,IF(ds.name IS NOT NULL,UPPER(ds.name),UPPER(dsm.source_destination)) as drug_source,SUM(dsm.quantity) as total")
+ $this->db->select("UPPER(d.drug) as drug_name,IF(ds.name IS NOT NULL,UPPER(ds.name),UPPER(dsm.source_destination)) as drug_source,SUM(dsm.quantity_out) as total")
->from("drug_stock_movement dsm")
->join("transaction_type t","t.id = dsm.transaction_type","LEFT")
->join("drugcode d","d.id = dsm.drug","LEFT")
@@ -5507,120 +6004,6 @@ public function getDrugsIssued($stock_type, $start_date = "", $end_date = "")
$this -> load -> view('template', $data);
}
- public function getDrugsIssued_old($stock_type, $start_date = "", $end_date = "") {
- $data['from'] = $start_date;
- $data['to'] = $end_date;
- $start_date = date('Y-m-d', strtotime($start_date));
- $end_date = date('Y-m-d', strtotime($end_date));
- $facility_code = $this -> session -> userdata('facility');
- $facilty_value = "";
- $param = "";
- $facilty_value = "dsm.ccc_store_sp=$stock_type";
- $ccc = CCC_store_service_point::getCCC($stock_type);
- $data['transaction_type'] = $ccc['Name'];
-
- $sql = "select d.id,d.drug,du.Name as unit,d.pack_size,SUM(dsm.quantity_out) as total from drug_stock_movement dsm
- LEFT JOIN transaction_type t ON t.id=dsm.transaction_type
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN drug_unit du ON du.id=d.unit
- where dsm.transaction_date between '$start_date' and '$end_date' and $facilty_value and dsm.facility='$facility_code'
- AND t.name LIKE '%Issued To%' AND d.id IS NOT NULL GROUP BY d.drug";
- //echo $sql;die();
- $query = $this -> db -> query($sql);
- $dest_array =Drug_destination::getAllHydrate();
- $all_other_ccc_stores = CCC_store_service_point::getAllBut($stock_type);
-
- $dyn_table = " ";
- $dyn_table .= "
- Drug Name
- ";
- $dest_array =array_merge($all_other_ccc_stores,$dest_array);
- //echo json_encode($dest_array);die();
- foreach ($dest_array as $value) {
- $dyn_table .= "" . $value['Name'] . " ";
- }
- $dyn_table .= "
-
- ";
-
- $results = $query -> result_array();
- if ($results) {
- foreach ($results as $result) {
- $dyn_table .= "" . $result['drug'] . " ";
- //Get all destinations for that drug
- $get_drugs = "
- SELECT table1.name,table1.total FROM
- (
- (
- SELECT csp.name as name,temp.total
- FROM ccc_store_service_point csp
- LEFT JOIN
- (SELECT source_destination,SUM(dsm.quantity_out) as total
- FROM drug_stock_movement dsm
- LEFT JOIN transaction_type t ON t.id=dsm.transaction_type
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN drug_unit du ON du.id=d.unit
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND $facilty_value
- AND t.name LIKE '%Issued To%'
- AND dsm.drug='" . $result['id'] . "'
- GROUP BY source_destination) as temp ON temp.source_destination = csp.name
-
- WHERE csp.id !=$stock_type AND csp.active = 1
- )
- UNION ALL
- (
- SELECT des.name as name,temp.total
- FROM drug_destination des
- LEFT JOIN (SELECT source_destination,SUM(dsm.quantity_out) as total
- FROM drug_stock_movement dsm
- LEFT JOIN transaction_type t ON t.id=dsm.transaction_type
- LEFT JOIN drugcode d ON d.id=dsm.drug
- LEFT JOIN drug_unit du ON du.id=d.unit
- WHERE dsm.transaction_date
- BETWEEN '$start_date'
- AND '$end_date'
- AND $facilty_value
- AND t.name LIKE '%Issued To%'
- AND dsm.drug='" . $result['id'] . "'
- GROUP BY source_destination) as temp ON temp.source_destination=des.id
- WHERE des.active=1
- ORDER BY des.id ASC
- )
- ) as table1
- ";
- $get_dest = $this -> db -> query($get_drugs);
- $get_des_array = $get_dest -> result_array();
- if($get_des_array){
- foreach ($get_des_array as $value) {
- $total = $value['total'];
- if ($value['total'] == null) {
- $total = 0;
- }
- $dyn_table .= "" . $total . " ";
- }
- }
- $dyn_table .= " ";
- }
- } else {
- //$dyn_table .= "No Data Available ";
- }
- $dyn_table .= "
";
- $data['dyn_table'] = $dyn_table;
- $data['title'] = "webADT | Reports";
- $data['hide_side_menu'] = 1;
- $data['banner_text'] = "Facility Reports";
- $data['selected_report_type_link'] = "drug_inventory_report_row";
- $data['selected_report_type'] = "Drug Inventory";
- $data['report_title'] = "Stock Consumption";
- $data['facility_name'] = $this -> session -> userdata('facility_name');
- $data['content_view'] = 'reports/drugissued_v';
- $this -> load -> view('template', $data);
- }
-
-
public function get_lost_followup($from = "",$to ="")
{
$facility_code = $this->session->userdata("facility");
@@ -6939,6 +7322,142 @@ public function load_guidelines_view() {
$data['facility_name'] = $this -> session -> userdata('facility_name');
$data['content_view']='guidelines_listing_v';
$this -> base_params($data);
+ }
+
+ //Differentiated Care
+ public function differenciated_package_of_care($start_date, $end_date){
+ $start_date = date('Y-m-d', strtotime($start_date));
+ $end_date = date('Y-m-d', strtotime($end_date));
+ $viralcount = 1000;
+ $longterm_duration = 180;
+ $row_string .= "
+
+
+
+ Male
+ Female
+
+ ";
+ $count_all_male = 0;$count_all_female = 0;
+ $count_less_male = 0;$count_more_male = 0;
+ $count_less_female = 0;$count_more_female = 0;
+
+ $row_string .= " > $viralcount cp/ml ";
+
+ $sql_more = "SELECT
+ t.name,
+ COUNT(t.gender) AS count,
+ t.result
+ FROM(
+ SELECT
+ patient_id,dispensing_date,patient,appointment,p.gender,g.name,vl.result
+ FROM patient_visit pv
+ INNER JOIN patient p ON p.patient_number_ccc = pv.patient_id
+ INNER JOIN gender g ON p.gender = g.id
+ INNER JOIN (
+ SELECT
+ patient_ccc_number,MAX(test_date) test_date,result
+ FROM patient_viral_load
+ WHERE test_date < '$end_date'
+ AND result > '$viralcount'
+ GROUP BY patient_ccc_number,test_date
+ ) vl ON vl.patient_ccc_number = p.patient_number_ccc
+ INNER JOIN (
+ SELECT
+ patient,min(appointment) appointment
+ FROM patient_appointment ipa
+ INNER JOIN patient_visit ipv ON ipv.patient_id = ipa.patient AND ipa.appointment > ipv.dispensing_date
+ WHERE ipv.dispensing_date BETWEEN '$start_date' AND '$end_date'
+ GROUP BY patient
+ ) pa ON pa.patient = pv.patient_id
+ WHERE pv.dispensing_date BETWEEN '$start_date' AND '$end_date' AND DATEDIFF(pa.appointment,pv.dispensing_date) >= $longterm_duration
+ GROUP BY patient_id,dispensing_date
+ )t
+ GROUP BY t.gender";
+ $query = $this ->db ->query($sql_more);
+ $result_more = $query->result_array();
+
+ if (count($result_more)>0) {
+ foreach ($result_more as $result) {
+ $gender_all = $result['name'];
+ if($gender_all=='Male'){
+ $count = ($result['count']=='') ? 0 : $result['count'];
+ $count_more_male +=$count;
+ }
+ if($gender_all=='Female'){
+ $count = ($result['count']=='') ? 0 : $result['count'];
+ $count_more_female +=$count;
+ }
+ }
+ }
+ $row_string .= "$count_more_male $count_more_female ";
+ $row_string .= "< 1000 cp/ml ";
+ $sql_less = "SELECT
+ t.name,
+ COUNT(t.gender) AS count,
+ t.result
+ FROM(
+ SELECT
+ patient_id,dispensing_date,patient,appointment,p.gender,g.name,vl.result
+ FROM patient_visit pv
+ INNER JOIN patient p ON p.patient_number_ccc = pv.patient_id
+ INNER JOIN gender g ON p.gender = g.id
+ INNER JOIN (
+ SELECT
+ patient_ccc_number,MAX(test_date) test_date,result
+ FROM patient_viral_load
+ WHERE test_date < '$end_date'
+ AND result <= '$viralcount'
+ GROUP BY patient_ccc_number,test_date
+ ) vl ON vl.patient_ccc_number = p.patient_number_ccc
+ INNER JOIN (
+ SELECT
+ patient,min(appointment) appointment
+ FROM patient_appointment ipa
+ INNER JOIN patient_visit ipv ON ipv.patient_id = ipa.patient AND ipa.appointment > ipv.dispensing_date
+ WHERE ipv.dispensing_date BETWEEN '$start_date' AND '$end_date'
+ GROUP BY patient
+ ) pa ON pa.patient = pv.patient_id
+ WHERE pv.dispensing_date BETWEEN '$start_date' AND '$end_date' AND DATEDIFF(pa.appointment,pv.dispensing_date) >= $longterm_duration
+ GROUP BY patient_id,dispensing_date
+ )t
+ GROUP BY t.gender";
+ $query = $this ->db ->query($sql_less);
+ $result_less = $query->result_array();
+
+ if (count($result_less)>0) {
+ foreach ($result_less as $result) {
+ $gender_all = $result['name'];
+ if($gender_all=='Male'){
+ $count = ($result['count']=='') ? 0 : $result['count'];
+ $count_less_male +=$count;
+ }
+ if($gender_all=='Female'){
+ $count = ($result['count']=='') ? 0 : $result['count'];
+ $count_less_female +=$count;
+ }
+ }
+ }
+ $row_string .= "$count_less_male $count_less_female ";
+ $row_string .= "On Long appointment ≥ 180 Days ";
+ $count_all_male = $count_less_male + $count_more_male;
+ $count_all_female = $count_less_female + $count_more_female;
+ $row_string .= "$count_all_male $count_all_female ";
+ $row_string .= "
";
+ $data['overall_total'] = $count_all_male+$count_all_female;
+ $data['from'] = $start_date;
+ $data['to'] = $end_date;
+ $data['dyn_table'] = $row_string;
+ $data['title'] = "webADT | Reports";
+ $data['hide_side_menu'] = 1;
+ $data['banner_text'] = "Facility Reports";
+ $data['selected_report_type_link'] = "differenciated_package_of_care";
+ $data['selected_report_type'] = "Patients on differenciated Package of care";
+ $data['report_title'] = "Differenciated Package of care";
+ $data['facility_name'] = $this -> session -> userdata('facility_name');
+ $data['content_view'] = 'reports/differenciated_package_of_care_v';
+ $this -> load -> view('template', $data);
+
}
public function base_params($data) {
$data['reports'] = true;
diff --git a/application/controllers/settings.php b/application/controllers/settings.php
index f23001c..2948d97 100644
--- a/application/controllers/settings.php
+++ b/application/controllers/settings.php
@@ -28,10 +28,16 @@ public function enable($table = "", $id) {
$query = $this -> db -> query($sql);
- $results = $query -> result();
+ $result = $query -> row();
- $this -> session -> set_userdata('msg_success', $results[0] -> name . ' was enabled!');
- $this -> session -> set_flashdata('filter_datatable', $results[0] -> name);
+ if(in_array($table, array('patient_status', 'regimen_category', 'drug_unit'))){
+ $name = $result->Name;
+ }else{
+ $name = $result->name;
+ }
+
+ $this -> session -> set_userdata('msg_success', $name . ' was enabled!');
+ $this -> session -> set_flashdata('filter_datatable', $name);
$this -> session -> set_userdata("link_id", "listing/" . $table);
$this -> session -> set_userdata("linkSub", "settings/listing/" . $table);
//Filter datatable
@@ -42,8 +48,6 @@ public function disable($table = "", $id) {
//If table is CCC_Store, disable CCC Store in drug_source and drug_destination
if($table=="ccc_store_service_point"){
-
-
$this -> db -> where('id', $id);
$this -> db -> update('ccc_store_service_point', array("active" => 0));
@@ -60,10 +64,16 @@ public function disable($table = "", $id) {
$query = $this -> db -> query($sql);
- $results = $query -> result();
+ $result = $query -> row();
+
+ if(in_array($table, array('patient_status', 'regimen_category', 'drug_unit'))){
+ $name = $result->Name;
+ }else{
+ $name = $result->name;
+ }
- $this -> session -> set_userdata('msg_error', $results[0] -> name . ' was disabled!');
- $this -> session -> set_flashdata('filter_datatable', $results[0] -> name);
+ $this -> session -> set_userdata('msg_error', $name . ' was disabled!');
+ $this -> session -> set_flashdata('filter_datatable', $name);
$this -> session -> set_userdata("link_id", "listing/" . $table);
$this -> session -> set_userdata("linkSub", "settings/listing/" . $table);
//Filter datatable
@@ -71,6 +81,7 @@ public function disable($table = "", $id) {
}
public function listing($table = "") {
+ $similar_tables = array('patient_status', 'regimen_category', 'drug_unit');
$columns = array("#", "Name", "Options");
if($table=="transaction_type"){
$columns = array("#", "Name", "Description","Effect","Options");
@@ -102,7 +113,7 @@ public function listing($table = "") {
$name .= ' '.$source -> last_name;
//$name =str_replace(" ","",$name);
$name =strtoupper($name);
- }else if($table=="patient_status"){
+ }else if(in_array($table, $similar_tables)){
$name = $source -> Name;
}else{
$name = $source -> name;
@@ -124,7 +135,7 @@ public function listing($table = "") {
}
$this -> table -> add_row("",$checkbox . " " .$source -> patient_number_ccc, $name, $links);
}else{
- if($table=="patient_status"){
+ if(in_array($table, $similar_tables)){
$active = $source -> Active;
}else{
$active = $source -> active;
diff --git a/application/controllers/settings_management.php b/application/controllers/settings_management.php
index b226b48..8174f29 100644
--- a/application/controllers/settings_management.php
+++ b/application/controllers/settings_management.php
@@ -1,4 +1,7 @@
\ No newline at end of file
diff --git a/application/controllers/system_management.php b/application/controllers/system_management.php
index 40a4feb..a6c9c01 100644
--- a/application/controllers/system_management.php
+++ b/application/controllers/system_management.php
@@ -19,11 +19,22 @@ public function index() {
}
public function load_assets() {
+
+ // Clear cache Details
+ /*
+ $files = glob('assets/cache/*'); // get all file names in Cache
+ foreach($files as $file){ // iterate files
+ if(is_file($file))
+ unlink($file); // delete file
+ }*/
+
+ // Clear cache Details
+
$this -> load -> library('carabiner');
$date_past = date('o-m-d H:i:s', time() - 1 * 60);
- $jsArray = array( array('jquery-1.11.1.min.js'), array('jquery-1.7.2.min.js'), array('jquery-migrate-1.2.1.js'), array('jquery.form.js'), array('jquery.gritter.js'), array('jquery-ui.js'), array('sorttable.js'), array('datatable/jquery.dataTables.min.js'), array('datatable/columnFilter.js'), array('bootstrap/bootstrap.min.js'), array('bootstrap/paging.js'), array('jquery.multiselect.js'), array('jquery.multiselect.filter.js'), array('validator.js'), array('validationEngine-en.js'), array('menus.js'), array('jquery.blockUI.js'), array('amcharts/amcharts.js'), array('highcharts/highcharts.js'), array('highcharts/highcharts-more.js'), array('highcharts/modules/exporting.js'),array('toastr.js'),array('select2-3.4.8/select2.min.js'),array('bootbox.min.js'), array('Merged_JS.js'));
+ $jsArray = array( array('jquery-1.11.1.min.js'), array('jquery-1.7.2.min.js'), array('jquery-migrate-1.2.1-min.js'), array('jquery.form.js'), array('jquery.gritter.js'), array('jquery-ui.js'), array('sorttable.js'), array('datatable/jquery.dataTables.min.js'), array('datatable/columnFilter.js'), array('bootstrap/bootstrap.min.js'), array('bootstrap/paging.js'), array('jquery.multiselect.js'), array('jquery.multiselect.filter.js'), array('validator.js'), array('validationEngine-en.js'), array('menus.js'), array('jquery.blockUI.js'), array('amcharts/amcharts.js'), array('highcharts/highcharts.js'), array('highcharts/highcharts-more.js'), array('highcharts/modules/exporting.js'),array('toastr.js'),array('select2-3.4.8/select2.min.js'),array('bootbox.min.js'), array('Merged_JS.js'));
$cssArray = array( array('amcharts/style.css'), array('bootstrap.css'), array('bootstrap.min.css'), array('bootstrap-responsive.min.css'), array('datatable/jquery.dataTables.css'), array('datatable/jquery.dataTables_themeroller.css'), array('datatable/demo_table.css'), array('jquery-ui.css'), array('style.css'), array('assets/jquery.multiselect.css'), array('assets/jquery.multiselect.filter.css'), array('assets/prettify.css'), array('style_report.css'), array('validator.css'), array('jquery.gritter.css'),array('toastr.min.css'),array('select2-3.4.8/select2.css'));
$this -> carabiner -> css($cssArray);
diff --git a/application/controllers/user_management.php b/application/controllers/user_management.php
index 3045294..25f352a 100644
--- a/application/controllers/user_management.php
+++ b/application/controllers/user_management.php
@@ -27,7 +27,7 @@ public function login() {
$this -> session -> set_flashdata('message', 0);
$data = array();
$data['title'] = "webADT | System Login";
- $this -> load -> view("login_v", $data);
+ $this->load->view("login_v", $data);
} else {
/*
* if user_id is present
@@ -112,6 +112,7 @@ public function listing() {
;
$data['user_types'] = $user_types;
$data['facilities'] = $facilities;
+ $data['order_sites'] = Sync_Facility::get_active();
$data['title'] = "System Users";
//$data['content_view'] = "users_v";
$data['banner_text'] = "System Users";
@@ -368,11 +369,18 @@ public function authenticate() {
'Email_Address' => $logged_in -> Email_Address,
'Phone_Number' => $phone,
'facility' => $logged_in -> Facility_Code,
- 'facility_id' => $facility_details[0]['id'],
+ 'facility_id' => $facility_details[0]['id'],
'county' => $facility_details[0]['county'],
'facility_phone' => $facility_details[0]['phone'],
'facility_sms_consent'=>$facility_details[0]['map']
);
+ //Check if value exists
+ if(@$facility_details[0]['lost_to_follow_up'] !== NULL){
+ $session_data['lost_to_follow_up'] = $facility_details[0]['lost_to_follow_up'];
+ }else{
+ $session_data['lost_to_follow_up'] = 180;
+ }
+
$this -> session -> set_userdata($session_data);
$user = $this -> session -> userdata('user_id');
$sql = "update access_log set access_type='Logout' where user_id='$user'";
@@ -436,6 +444,9 @@ public function save() {
$this->db->insert("users",$user_data);
+ //Save user facilities
+ $this->save_user_facilities($this->db->insert_id(), $this -> input -> post('user_facilities_holder',TRUE));
+
$this -> session -> set_userdata('msg_success', $this -> input -> post('fullname') . ' \' s details were successfully saved! The default password is '.$default_password.' ');
redirect('settings_management');
}
@@ -744,6 +755,11 @@ public function profile_update() {
$this -> session -> set_userdata("message_user_update_success", $message_success);
}
+
+ //Add/update user ordering sites
+ $this->save_user_facilities($this->session->userdata('user_id'), $this -> input -> post('profile_user_facilities_holder',TRUE));
+
+
$previous_url = $this -> input -> cookie('actual_page', true);
redirect($previous_url);
@@ -779,4 +795,29 @@ public function resend_password()
redirect("user_management/resetPassword");
}
+ public function save_user_facilities($user_id = '', $user_facilites = ''){
+ $save_data = array('user_id' => $user_id, 'facility' => json_encode(explode(',', $user_facilites)));
+ $table = 'user_facilities';
+ if($user_facilites){
+ $user = $this->db->get_where($table, array('user_id' => $user_id))->row_array();
+ if($user){
+ $this -> db -> where('id', $user['id']);
+ $this -> db -> update($table, $save_data);
+ }else{
+ $this->db->insert($table, $save_data);
+ }
+ }
+ return $save_data;
+ }
+
+ public function get_sites($user_id = ''){
+ $data = json_encode(array());
+ $this->db->select('facility');
+ $row = $this->db->get_where('user_facilities', array('user_id' => $user_id))->row_array();
+ if($row){
+ $data = $row['facility'];
+ }
+ echo $data;
+ }
+
}
diff --git a/application/controllers/viral_load_manual.php b/application/controllers/viral_load_manual.php
new file mode 100644
index 0000000..dd872b4
--- /dev/null
+++ b/application/controllers/viral_load_manual.php
@@ -0,0 +1,76 @@
+ session -> set_userdata("link_id", "index");
+ $this -> session -> set_userdata("linkSub", "viral_load_manual");
+ $this -> session -> set_userdata("linkTitle", "Viral Load Results");
+ }
+
+ public function index() {
+ $this -> listing();
+ }
+
+ public function listing()
+ {
+ $access_level = $this -> session -> userdata('user_indicator');
+ $data = array();
+ //get viral load from the database
+ $sql="select * from patient_viral_load";
+ $query = $this -> db -> query($sql);
+ $viral_results = $query -> result_array();
+ $tmpl = array('table_open' => '');
+ $this -> table -> set_template($tmpl);
+ $this -> table -> set_heading('id','Patient CCC Number', 'Test Date', 'Result','Justification','Options');
+ foreach ($viral_results as $viral_result) {
+ $links = "";
+ $array_param = array(
+ 'id' => $viral_result['id'],
+ 'role' => 'button',
+ 'class' => 'edit_user',
+ 'data-toggle' => 'modal',
+ 'name' => $viral_result['patient_ccc_number']
+ );
+ $links .= anchor('#edit_form', 'Edit', $array_param);
+ $this -> table -> add_row(
+ $viral_result['id'],$viral_result['patient_ccc_number'],$viral_result['test_date'],$viral_result['result'],$viral_result['justification'], $links);
+ }
+ $data['viral_result'] = $this -> table -> generate();
+ $this -> base_params($data);
+ }
+ public function get_patient_ccc_number()
+ {
+ $sql="select patient_number_ccc as patient_ccc_number from patient";
+ $query = $this -> db -> query($sql);
+ $ccc_result = $query -> result_array();
+ echo json_encode($ccc_result);
+
+ }
+
+ public function update() {
+ $id = $this -> input -> post('id');
+ $patient_ccc_number = $this -> input -> post('patient_ccc_number');
+ $query = $this -> db -> query("UPDATE patient_viral_load SET patient_ccc_number='$patient_ccc_number' WHERE id='$id'");
+ $this -> session -> set_userdata('msg_success', $this -> input -> post('patient_ccc_number') . ' was Updated');
+ $this -> session -> set_flashdata('filter_datatable', $this -> input -> post('patient_ccc_number'));
+ //Filter datatable
+ redirect("settings_management");
+ }
+
+ private function _submit_validate() {
+ // validation rules
+ $this -> form_validation -> set_rules('patient_ccc_number', 'Patient CCC Number', 'trim|required|min_length[2]|max_length[100]');
+
+ return $this -> form_validation -> run();
+ }
+
+ public function base_params($data) {
+ $data['quick_link'] = "indications";
+ $this -> load -> view('viral_load_manual_v', $data);
+ }
+
+}
+?>
\ No newline at end of file
diff --git a/application/models/cdrr_log.php b/application/models/cdrr_log.php
index bc75663..2ad5969 100644
--- a/application/models/cdrr_log.php
+++ b/application/models/cdrr_log.php
@@ -11,7 +11,7 @@ public function setTableDefinition() {
public function setUp() {
$this -> setTableName('cdrr_log');
$this -> hasOne('Cdrr as Cdrr', array('local' => 'cdrr_id', 'foreign' => 'id'));
- $this -> hasOne('Users as user', array('local' => 'user_id', 'foreign' => 'map'));
+ $this -> hasOne('Users as user', array('local' => 'user_id', 'foreign' => 'id'));
$this -> hasOne('Sync_User as s_user', array('local' => 'user_id', 'foreign' => 'id'));
}
diff --git a/application/models/facilities.php b/application/models/facilities.php
index 20e91bd..279a7d6 100644
--- a/application/models/facilities.php
+++ b/application/models/facilities.php
@@ -19,6 +19,7 @@ public function setTableDefinition() {
$this -> hasColumn('service_pep', 'int', 2);
$this -> hasColumn('supplied_by', 'int', 2);
$this -> hasColumn('map', 'int', 11);
+ //$this -> hasColumn('lost_to_follow_up', 'int', 11);
}
public function setUp() {
@@ -83,8 +84,12 @@ public static function getFacility($id) {
}
public function getCurrentFacility($id) {
- $query = Doctrine_Query::create() -> select("*") -> from("Facilities") -> where("facilitycode = '$id'");
+ $query = Doctrine_Query::create() -> select("*") -> from("facilities") -> where("facilitycode = '$id'");
$facility = $query -> execute(array(), Doctrine::HYDRATE_ARRAY);
+ /*$sql="SELECT * FROM Facilities where facilitycode='$id'";
+ $query = $this -> db -> query($sql);
+
+ $facility = $query -> result_array();*/
return $facility;
}
@@ -181,4 +186,5 @@ public function getItems() {
return $facility;
}
+
}
diff --git a/application/models/maps_log.php b/application/models/maps_log.php
index 6277979..6c5c3f2 100644
--- a/application/models/maps_log.php
+++ b/application/models/maps_log.php
@@ -11,7 +11,7 @@ public function setTableDefinition() {
public function setUp() {
$this -> setTableName('maps_log');
$this -> hasOne('Maps as Maps', array('local' => 'maps_id', 'foreign' => 'id'));
- $this -> hasOne('Users as user', array('local' => 'user_id', 'foreign' => 'map'));
+ $this -> hasOne('Users as user', array('local' => 'user_id', 'foreign' => 'id'));
$this -> hasOne('Sync_User as s_user', array('local' => 'user_id', 'foreign' => 'id'));
}
diff --git a/application/models/sync_facility.php b/application/models/sync_facility.php
index 3f476c0..d9fd55d 100644
--- a/application/models/sync_facility.php
+++ b/application/models/sync_facility.php
@@ -32,28 +32,27 @@ public function getAll() {
return $sync_facility;
}
- public function getId($facility_code, $status_code = 0) {
- if ($status_code == 0) {
- $conditions = "code='$facility_code' and ordering='1'";
- } else if ($status_code == 3) {
- $conditions = "code='$facility_code' and category like '%standalone%'";
- } else {
- $conditions = "code='$facility_code' and service_point='1'";
+ public function getId($facility_code, $parent_sites = 0) {
+ if($parent_sites == 0){
+ $conditions = "code='$facility_code' and category like '%satellite%' and ordering = '0' and service_point = '1'";
+ }else if($parent_sites == 1){
+ $conditions = "code='$facility_code' and category like '%standalone%' and ordering = '1' and service_point = '1'";
+ }else{
+ $conditions = "code='$facility_code' and category like '%central%' and ordering = '1' and service_point = '0'";
}
$query = Doctrine_Query::create() -> select("id") -> from("sync_facility") -> where("$conditions");
$sync_facility = $query -> execute(array(), Doctrine::HYDRATE_ARRAY);
return @$sync_facility[0];
}
- public function getCode($facility_id, $status_code = 0) {
- if ($status_code == 0) {
- $conditions = "id='$facility_id' and ordering='1'";
- } else if ($status_code == 3) {
- $conditions = "id='$facility_id' and category like '%standalone%'";
- } else {
- $conditions = "id='$facility_id' and service_point='1'";
+ public function getCode($facility_id, $parent_sites = 0) {
+ if($parent_sites == 0){
+ $conditions = "id='$facility_id' and category like '%satellite%' and ordering = '0' and service_point = '1'";
+ }else if($parent_sites == 1){
+ $conditions = "id='$facility_id' and category like '%standalone%' and ordering = '1' and service_point = '1'";
+ }else{
+ $conditions = "id='$facility_id' and category like '%central%' and ordering = '1' and service_point = '0'";
}
-
$query = Doctrine_Query::create() -> select("code") -> from("sync_facility") -> where("$conditions");
$sync_facility = $query -> execute(array(), Doctrine::HYDRATE_ARRAY);
return @$sync_facility[0];
@@ -84,6 +83,12 @@ public function get_facility_category($code = NULL)
return $sync_facility[0]['category'];
}
+ public function get_active() {
+ $query = Doctrine_Query::create() -> select("*") -> from("sync_facility") -> where("Active='1'");
+ $sync_facility = $query -> execute(array(), Doctrine::HYDRATE_ARRAY);
+ return $sync_facility;
+ }
+
}
?>
diff --git a/application/models/user_facilities.php b/application/models/user_facilities.php
index 34f6ac5..069111e 100644
--- a/application/models/user_facilities.php
+++ b/application/models/user_facilities.php
@@ -17,9 +17,13 @@ public function getFacilityList($user_id) {
}
public function getHydratedFacilityList($user_id) {
+ $data = array();
$query = Doctrine_Query::create() -> select("*") -> from("user_facilities") -> where("user_id = '" . $user_id . "'");
$rights = $query -> execute(array(), Doctrine::HYDRATE_ARRAY);
- return $rights[0];
+ if(!empty($rights)){
+ $data = $rights[0];
+ }
+ return $data;
}
}
diff --git a/application/views/add_patient_v.php b/application/views/add_patient_v.php
index a9a7d95..eb6334e 100644
--- a/application/views/add_patient_v.php
+++ b/application/views/add_patient_v.php
@@ -122,13 +122,13 @@
$("#age_in_months").attr("value", age_in_months);
});
-
- //Function to check if female is pregnant
- $("#gender").change(function() {
+
+ //Function to check if female is pregnant --not working---(vicky)
+ /* $("#gender").change(function() {
var selected_value = $(this).attr("value");
//if female, display the prengancy selector
- if(selected_value == 2 && $('age_in_years').val()>=8) {
+ if(selected_value == 2 && $('age_in_years').val()>=14) {
//If female show pregnant container
$('#pregnant_view').slideDown('slow', function() {
@@ -139,7 +139,7 @@
});
}
- });
+ });*/
//if female is pregnant put them on pmtct service
$("#pregnant").change(function(){
var selected_value=$(this).attr("value");
@@ -491,11 +491,30 @@ function processData(form){
return true;
}
}
+
+ //function to check if pregnant if female and above 14(vicky)
+ function showDiv(elem){
+ var gender = $("#gender option:selected").text().toLowerCase();
+ var dob = new Date(document.getElementById('dob').value);
+ var today = new Date();
+ var age_in_years = Math.floor((today - dob) / (365.25 * 24 * 60 * 60 * 1000));
+ var pregnantDiv = document.getElementById('pregnant_view');
+ var pregnant = $("#pregnant");
+
+ //Ensure is 'female' and age >= 14
+ if(age_in_years >= 14 && gender == 'female'){
+ pregnantDiv.style.display = "inline-block";
+ }else{
+ pregnantDiv.style.display = "none";
+ pregnant.val(0);
+ }
+ }
+
Patient Listing Add Patients
@@ -571,10 +590,10 @@ function processData(form){
- * Gender
-
- --Select--
- * Gender
+
+ --Select--
+ ".$gender['name']."";
}
@@ -927,6 +946,7 @@ function processData(form){
+
diff --git a/application/views/brandname_listing_v.php b/application/views/brandname_listing_v.php
index e1700ac..eaa2f81 100644
--- a/application/views/brandname_listing_v.php
+++ b/application/views/brandname_listing_v.php
@@ -3,6 +3,10 @@
-
-
-
-
-
-
-
-
-