-- https://www.phpmyadmin.net/
--

START TRANSACTION;



--
-- Database: `pscprim1_hms`
--

DELIMITER $$
--
-- Procedures
--
CREATE DEFINER=`root`@`localhost` PROCEDURE `add_new_drug` (IN `drug` VARCHAR(50), IN `unit_of_issue` VARCHAR(30), IN `quantity` INT(11), IN `price` INT(11), IN `expiry_date` VARCHAR(20), IN `generic` VARCHAR(50), IN `reorderlevel` VARCHAR(10), IN `expiryalert` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    INSERT INTO drugs (drug,genericName,expiry_date,quantity,price,unit_of_issue,reorder_level,expiryAlert,facilityId) VALUES (drug,generic,expiry_date,quantity,price,unit_of_issue,reorderlevel,expiryalert,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `add_new_lab_head` (IN `labhead` VARCHAR(50), IN `labsubhead` VARCHAR(50), IN `spec` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
    INSERT INTO lab_setup(`head`, `subhead`, `facilityId`,specimen) VALUES (labhead, labsubhead , facId,spec );
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `add_new_lab_service` (IN `labhead` VARCHAR(50), IN `labsubhead` VARCHAR(50), IN `unit` VARCHAR(50), IN `test` VARCHAR(50), IN `facId` VARCHAR(50), IN `test_range` VARCHAR(50), IN `test_to` VARCHAR(50), IN `spec` VARCHAR(50), IN `test_price` INT)  BEGIN
    INSERT INTO lab_setup(`head`, `sub_head`, `unit`, `test`, `facilityId`,range_from,range_to,specimen,price) VALUES (labhead, labsubhead , unit, test, facId,test_from,test_to,spec,test_price );
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `add_new_supplier` (IN `name` VARCHAR(50), IN `address` VARCHAR(255), IN `phone` VARCHAR(20), IN `code` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
       INSERT INTO suppliersinfo(supplier_name, address, phone, code,facilityId) VALUES (name,address,phone,code,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `assign` (IN `doctor` VARCHAR(20), IN `patientId` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    update patientrecords set assigned_to = doctor, date_assigned = CURDATE() where id = patientId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `create_new_lab_client` (IN `p_id` VARCHAR(50), IN `acc_no` VARCHAR(50), IN `ben_no` VARCHAR(50), IN `first_name` VARCHAR(50), IN `last_name` VARCHAR(50), IN `other_name` VARCHAR(50), IN `p_gender` VARCHAR(50), IN `birth` DATE, IN `mail` VARCHAR(50), IN `facId` VARCHAR(50), IN `labno` VARCHAR(50), IN `phone` VARCHAR(13))  NO SQL
BEGIN 

INSERT INTO patientrecords (patient_id,accountNo,beneficiaryNo,firstname,surname,other,Gender, DOB,email,facilityId,phoneNo) VALUES (p_id,acc_no,ben_no,first_name, last_name,other_name, p_gender,birth,mail,facId,phone); 

INSERT INTO lab_numbers (facilityId,patient_id,lab_no) VALUES (facId,p_id,labno); 

END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_drug` (IN `drugId` VARCHAR(11), IN `facId` VARCHAR(50))  BEGIN
    DELETE FROM drugs WHERE drug_id = drugId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_service` (IN `serviceId` VARCHAR(11), IN `facId` VARCHAR(50))  BEGIN
    DELETE FROM services WHERE service_id = serviceId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `delete_supplier` (IN `supplierId` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
	DELETE FROM suppliersinfo WHERE id=supplierId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `deposit` (IN `amt` INT, IN `patientId` VARCHAR(50), IN `descr` VARCHAR(100), IN `source_head` VARCHAR(100), IN `userId` VARCHAR(50), IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(50), IN `dest_head` VARCHAR(100), IN `facId` VARCHAR(100))  NO SQL
BEGIN 
  DECLARE acc_balance int;
  SELECT balance INTO acc_balance FROM patientfileno WHERE accountNo = patientId AND facilityId=facId;
  UPDATE patientfileno SET balance = acc_balance + amt WHERE accountNo = patientId AND facilityId=facId;
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,client_acct,facilityId) 
    VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,patientId,facId);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,client_acct,facilityId) 
    VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,patientId,facId);
  
  COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `drug_expiry_alert` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM drugpurchaserecords WHERE DATE_FORMAT(expiry_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(NOW(), '%Y-%m-%d') AND DATE_FORMAT(DATE_ADD(NOW(),INTERVAL 6 MONTH), '%Y-%m-%d') AND (facilityId=facId) ORDER by expiry_date ASC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `drug_qtty_alert` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM drugpurchaserecords WHERE drugpurchaserecords.balance < drugpurchaserecords.reorder_level AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `fetch_by_doctor` (IN `doctor` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    select * from patientrecords where assigned_to = doctor AND facilityId=facId limit 20;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `getUnitOfIssue` (IN `drugName` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
	SELECT DISTINCT unit_of_issue FROM drugs WHERE  drug = drugName AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_account` (IN `facId` VARCHAR(50))  BEGIN
    select max(accountNo) + 1 from patientrecords WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_acc_chart` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head,subhead title FROM account WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all` (IN `facId` VARCHAR(50))  BEGIN
    select * from patientrecords WHERE facilityId=facId limit 50;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_acc_heads` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head FROM account WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_lab_services` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head as labhead FROM lab_setup WHERE facilityId=facId ORDER BY createdAt DESC;
    END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_op_notes` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM operationnotes WHERE facilityId=facId ORDER BY id DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_prescriptions` (IN `facId` VARCHAR(50))  BEGIN
    SELECT *  FROM prescriptionrequests WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_services` (IN `facId` VARCHAR(50))  BEGIN
   SELECT * FROM `services` WHERE facilityId=facId ORDER BY createdAt DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_suppliers` (IN `facId` VARCHAR(50))  BEGIN
SELECT * FROM suppliersinfo WHERE facilityId=facId ORDER BY date DESC;

END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_all_transactions` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * from `transactions` WHERE facilityId=facId ORDER BY createdAt DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_amount_handed_over` (IN `userId` VARCHAR(50), IN `date` DATE, IN `facId` VARCHAR(50))  BEGIN
    SELECT sum(ifnull(amountHandedOver,0)) as amountHandedover FROM transfers WHERE transfer_from = userId and date(date) = date AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_amount_received` (IN `userId` VARCHAR(10), IN `date` DATE, IN `facId` VARCHAR(50))  BEGIN
    SELECT sum(amountReceived) as amountReceived FROM transfers WHERE transfer_to = userId AND date(date) = date AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_avail_receipt_no` (IN `facId` VARCHAR(50))  BEGIN
    SELECT max(receiptNo) + 1 FROM `transactions` WHERE DATE_FORMAT(createdAt, "%d%m%y") = DATE_FORMAT(NOW(), "%d%m%y") AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_balance` (IN `accNo` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    SELECT balance, firstname, surname FROM `patientfileno` WHERE accountNo = accNo AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_beneficiary_no` (IN `accNo` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    SELECT MAX(beneficiaryNo) + 1 from patientrecords where accountNo = accNo AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_deposit_acc_head` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head FROM account WHERE head = 'Deposit' AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_diagnoses_by_id` (IN `patientId` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    SELECT *  FROM diagnosis where patient_id = patientId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_dispensary_records` (IN `facId` VARCHAR(50))  NO SQL
BEGIN
    SELECT a.drug,a.cost_price,a.balance as quantity, dispensary_balance as dispensary_quantity ,a.expiry_date,a.created_at,b.supplier_name as supplier 
    FROM drugpurchaserecords a JOIN suppliersinfo b ON a.supplier=b.id WHERE a.facilityId=facId AND dispensary_balance!=0 ORDER BY created_at DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_doctors` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM users WHERE role = 'doctor' AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_drugs_list` (IN `facId` VARCHAR(50))  BEGIN
    SELECT SUM(quantity) as quantity, drug from drugpurchaserecords WHERE facilityId=facId GROUP BY drug;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_drugs_sold` (IN `facId` VARCHAR(50), IN `dateFrom` DATE, IN `dateTo` DATE)  NO SQL
SELECT SUM(qty_out) AS quantity, drug FROM drugs WHERE date(created_at) BETWEEN date(dateFrom) AND date(dateTo) AND source='dispensary' AND facilityId=facId GROUP BY drug$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_drug_price_by_id` (IN `id` INT(4), IN `facId` VARCHAR(50))  BEGIN
    SELECT price FROM `drugs` WHERE drug_id=id AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_expenses_acc_heads` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head from account where subhead in ('Expenditure', 'Other Expenses', 'Direct Expenses') AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_expired_drugs` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM `drugs` WHERE DATE_FORMAT(expiry_date, '%Y-%m-%d') < DATE_FORMAT(NOW(), '%Y-%m-%d') AND (facilityId=facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_facility_info` (IN `fac_id` VARCHAR(50))  NO SQL
SELECT id as facility_id, name as facility_name, code, logo, type, admin FROM hospitals WHERE id = fac_id$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_id` (IN `facId` VARCHAR(50))  BEGIN
    select max(accountNo) + 1 from patientrecords WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_ids` (IN `facId` VARCHAR(50))  BEGIN
    select distinct accountNo from patientrecords WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_individual_report` (IN `account` VARCHAR(10), IN `fromDate` VARCHAR(30), IN `toDate` VARCHAR(30), IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM `transactions` WHERE (transaction_source=account OR destination = account) AND (createdAt BETWEEN fromDate AND toDate) AND (facilitatorId = facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_lab_requisitions` (IN `facId` VARCHAR(50))  NO SQL
SELECT concat(firstname, ' ', surname) as name, id, dateCreated FROM `patientrecords` WHERE status = 'lab_requisition' AND facilityId=facId ORDER BY dateCreated DESC$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_lab_services_tree` (IN `facId` VARCHAR(50))  NO SQL
BEGIN
SELECT id, head,subhead title  FROM lab_setup WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_list_of_drugs` ()  BEGIN
    SELECT DISTINCT name as drug, generic_name FROM druglist ORDER BY created_at DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_next_lab_id` (IN `facId` VARCHAR(50))  NO SQL
BEGIN
	SELECT IFNULL(max(id),0) + 1 AS labId from lab_requisition WHERE facilityId=facId; 

	COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_next_transaction_id` (IN `facId` VARCHAR(50))  BEGIN
    select max(transaction_id) + 1 from transactions WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_patients_by_doctor` (IN `doc` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
    select * from patientrecords where assigned_to = doc AND facilityId=facId ORDER BY date_assigned DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_patient_acc_stmt` (IN `patientId` VARCHAR(20), IN `dateFrom` DATE, IN `dateTo` DATE, IN `facId` VARCHAR(50))  BEGIN
	SELECT t.transaction_id, t.transaction_source,t.day,t.description, t.credit, t.debit,
       @running_total:=@running_total + t.balance AS bal, @running_total:=@running_total opening
        FROM
        ( SELECT transaction_id, transaction_source,
          date(createdAt) as day,description,credited credit, debited debit,
          sum(credited-debited) as balance
          FROM transactions WHERE transaction_source = patientId AND date(createdAt) BETWEEN dateFrom AND dateTo AND facilityId=facId
          GROUP BY transaction_id,day,description,credit,debit,transaction_source ) t
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.transaction_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_patient_records` (IN `facId` VARCHAR(50))  BEGIN
    select * from patientrecords WHERE facilityId=facId order by accountNo desc;
   END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_patient_reg_breakdown_per_year` (IN `year` INT(4))  NO SQL
SELECT COUNT(*) no_of_patients, MONTH(dateCreated) month FROM `patientrecords`  
WHERE YEAR(dateCreated) = year
GROUP BY MONTH(dateCreated)$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pending_lab_request` (IN `facId` VARCHAR(50))  BEGIN 
SELECT id,concat(surname, ' ', firstname, ' ', other) fullname,DOB,gender,phoneNo,assigned_to, count(lab.patient_id) no_of_test
  FROM patientrecords JOIN lab
    ON patientrecords.id = lab.patient_id WHERE lab.status = 'request' and lab.facilityId = facId GROUP BY lab.patient_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pending_prescription_requests` (IN `facId` VARCHAR(50))  BEGIN
    #SELECT * FROM `prescriptionrequests` WHERE facilityId=facilityId ORDER BY date DESC;
SELECT id,firstname,surname,DOB,gender,phoneNo,assigned_to FROM `patientrecords` WHERE id in (SELECT patient_id from dispensary where status = "request") and facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pending_purchases` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM drugpurchaserecords WHERE payment_status='pending' AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pending_transactions` (IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM `transactions` WHERE status = "pending" AND facilityId=facId ORDER BY createdAt DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pharm_sales_summary` (IN `fac_id` VARCHAR(50), IN `dateFrom` DATE, IN `dateTo` DATE)  NO SQL
SELECT  ifnull(SUM(debit), 0) totalAmount, count(debit) totalSales FROM transactions WHERE DATE(createdAt) BETWEEN date(dateFrom) AND date(dateTo) AND facilityId=fac_id AND acct='Drug Sales'$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_pharm_total_stock` (IN `fac_id` VARCHAR(50))  NO SQL
SELECT sum(balance) AS totalStock, sum(balance*cost_price) AS totalStockAmount, sum(dispensary_balance) as totalDisp, sum(dispensary_balance*(cost_price+markUp)) as totalDispAmount FROM drugpurchaserecords WHERE facilityId = fac_id$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_purchase_records` (IN `facId` VARCHAR(50))  BEGIN
    SELECT a.drug,a.cost_price,a.balance as quantity, quantity as quantity_bought ,a.expiry_date,a.created_at,b.supplier_name as supplier 
    FROM drugpurchaserecords a JOIN suppliersinfo b ON a.supplier=b.id WHERE a.facilityId=facId ORDER BY created_at DESC;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_receipt_date_sn` (IN `dateAppend` VARCHAR(30), IN `facId` VARCHAR(50))  BEGIN
    select receiptDateSN like dateAppend from transaction WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_reports` (IN `fromDate` VARCHAR(30), IN `toDate` VARCHAR(30), IN `facId` VARCHAR(50))  BEGIN
    SELECT * FROM `transactions` WHERE createdAt BETWEEN fromDate AND toDate AND facilityId = facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_rev_acc_heads` (IN `facId` VARCHAR(50))  BEGIN
    SELECT head FROM account WHERE subhead = 'Revenue' AND head != 'Deposit' and facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_roles` (IN `facId` VARCHAR(50))  BEGIN
    select distinct role from users WHERE facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_test_by_patient` (IN `patientId` VARCHAR(20), IN `facId` VARCHAR(50))  NO SQL
SELECT * from lab WHERE patient_id = patientId AND facilityId=facId AND status in ('request')$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_top_5_popular_drugs` (IN `fac_id` VARCHAR(50), IN `today` DATE)  NO SQL
SELECT drug, COUNT(*) count FROM dispensary WHERE facilityId=fac_id AND DATE(created_at) = today GROUP BY drug ORDER BY count DESC LIMIT 5$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_total_sales` (IN `user` VARCHAR(50), IN `date` DATE, IN `facId` VARCHAR(50))  BEGIN
    SELECT SUM(credited-debited) as totalSales, date(createdAt) as date from transactions WHERE enteredBy = user and date(createdAt) = date AND facilityId=facId GROUP by date(createdAt);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_unassigned` (IN `facId` VARCHAR(50))  BEGIN
    select title,surname,firstname,other, concat(firstname,' ',surname,' ',other) fullname,Gender,age,maritalstatus,DOB,dateCreated,phoneNo,email,state,lga,occupation,address,kinName,kinRelationship,kinPhone,kinEmail,kinAddress,accountNo,beneficiaryNo,balance,id,enteredBy,patientStatus,assigned_to,createdAt from patientrecords WHERE facilityId=facId order by accountNo desc;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_users` (IN `facId` VARCHAR(50))  BEGIN
    SELECT *  FROM users where facilityId = facId AND role != 'developer';
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `get_user_by_id` (IN `id` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    select * from patientrecords where id=id AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `move_items_to_dispensary` (IN `drug_name` VARCHAR(100), IN `cost` INT, IN `expiry` VARCHAR(20), IN `d_code` VARCHAR(50), IN `d_price` INT, IN `unit` INT, IN `in_qty` INT, IN `userId` VARCHAR(50), IN `generic` VARCHAR(100), IN `facId` VARCHAR(50), IN `supplierId` VARCHAR(50), IN `itemSource` VARCHAR(10), IN `mark_up` INT)  BEGIN
  DECLARE store_qty int;
  DECLARE dispensary_qty int;
  DECLARE drug_id INT;
  
  SELECT id INTO drug_id FROM druglist WHERE name=drug_name AND generic_name=generic;
  IF drug_id IS null THEN
  INSERT INTO druglist (name,generic_name) VALUES (drug_name,generic);
  end IF;
  
  IF itemSource = 'store' THEN
  select balance, dispensary_balance into store_qty, dispensary_qty FROM drugpurchaserecords WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry AND supplier=supplierId;
  
  UPDATE drugpurchaserecords SET balance = store_qty - in_qty, dispensary_balance = dispensary_qty + in_qty WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry AND supplier=supplierId;

  INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup)
        values (d_code,drug_name,expiry,cost,unit,0,in_qty,'purchases',userId,generic,facId,mark_up);
        
   INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup)
        values (d_code,drug_name,expiry,cost,unit,in_qty,0,'dispensary',userId,generic,facId,mark_up);
        
        ELSE
        select dispensary_balance into dispensary_qty FROM drugpurchaserecords WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry AND supplier=supplierId;
        
        IF dispensary_qty IS NOT null THEN
  
  UPDATE drugpurchaserecords SET dispensary_balance = dispensary_qty + in_qty WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry AND supplier=supplierId;
  
   INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup,supplier)
        values (d_code,drug_name,expiry,cost,unit,0,in_qty,'purchases',userId,generic,facId,mark_up,supplierId);
        
   INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup,supplier)
        values (d_code,drug_name,expiry,cost,unit,in_qty,0,'dispensary',userId,generic,facId,mark_up,supplierId);
  
  else 
  
        INSERT into drugpurchaserecords (drug_code,drug,generic_name,unit_of_issue,cost_price,markUp,quantity, by_whom,supplier,receipt_no,payment_status,expiry_date,dispensary_balance,facilityId) VALUES (d_code,drug_name,generic,unit,cost,mark_up,in_qty,userId,supplierId,'0','paid',expiry,in_qty,facId);
        
        INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup,supplier)
        values (d_code,drug_name,expiry,cost,unit,0,in_qty,'purchases',userId,generic,facId,mark_up,supplierId);
        
   INSERT INTO drugs(drug_code,drug,expiry_date,price,
        unit_of_issue,
        qty_in,
        qty_out,
        source,
        created_by,
        genericName,
        facilityId,markup,supplier)
        values (d_code,drug_name,expiry,cost,unit,in_qty,0,'dispensary',userId,generic,facId,mark_up,supplierId);
        
        END IF;
        end if;

END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_acc_head` (IN `head` VARCHAR(100), IN `subhead` VARCHAR(100), IN `description` VARCHAR(200), IN `balance` INT(11), IN `facId` VARCHAR(50))  BEGIN
    INSERT INTO account(head, subhead, description, balance, facilityId) VALUES (head,subhead,description,balance,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_drug_purchase` (IN `drug_name` VARCHAR(100), IN `cost` INT, IN `expiry` VARCHAR(20), IN `genericName` VARCHAR(100), IN `unit` VARCHAR(50), IN `reorder` INT, IN `mark_up` INT, IN `quantity_in` INT, IN `userId` VARCHAR(50), IN `supplierId` VARCHAR(50), IN `paymentStatus` VARCHAR(10), IN `p_date` VARCHAR(10), IN `receiptPic` VARCHAR(100), IN `expiryAlert` INT, IN `descr` VARCHAR(100), IN `source_head` VARCHAR(100), IN `amt` INT, IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(50), IN `dest_head` VARCHAR(100), IN `facId` VARCHAR(50), IN `d_code` VARCHAR(50), IN `selling_price` INT)  NO SQL
BEGIN 
  DECLARE store_balance int;
  DECLARE drug_id INT;
  
  SELECT id INTO drug_id FROM druglist WHERE name=drug_name AND generic_name=genericName;
  IF drug_id IS null THEN
  INSERT INTO druglist (name,generic_name) VALUES (drug_name,genericName);
  end IF;
  
  SELECT balance INTO store_balance FROM drugpurchaserecords WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry AND supplier=supplierId;

  IF store_balance IS NULL THEN 

  INSERT INTO drugpurchaserecords (drug_code,drug,generic_name,unit_of_issue,reorder_level,cost_price,markUp,quantity,
                                    by_whom,supplier,receipt_no,payment_status,created_at,receipt_picture,expiry_date,
                                    expiry_alert,balance,facilityId)
    VALUES (d_code,drug_name,genericName,unit,reorder,cost,mark_up,quantity_in,userId,supplierId,receiptsn,paymentStatus,
            p_date,receiptPic,expiry,expiryAlert,quantity_in,facId);
            
  INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,quantity_in,0,'purchases',supplierId,receiptsn,userId,genericName,facId);

  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo,
                            modeOfPayment,facilityId) 
        VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,facId);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, 
                            modeOfPayment,facilityId) 
      VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,facId);

  ELSE 
  UPDATE drugpurchaserecords set balance = store_balance + quantity_in, status='' 
    WHERE drug=drug_name AND cost_price=cost AND supplier=supplierId AND expiry_date=expiry;
    
    INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,quantity_in,0,'purchases',supplierId,receiptsn,userId,genericName,facId);

  
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo,
                            modeOfPayment,facilityId) 
        VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,facId);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, 
                            modeOfPayment,facilityId) 
      VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,facId);
      
 END IF;

  COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_drug_sale` (IN `drug_name` VARCHAR(100), IN `cost` INT, IN `expiry` VARCHAR(20), IN `genericName` VARCHAR(100), IN `unit` VARCHAR(50), IN `quantity_in` INT, IN `userId` VARCHAR(50), IN `supplierId` VARCHAR(50), IN `descr` VARCHAR(100), IN `source_head` VARCHAR(100), IN `amt` INT, IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(50), IN `dest_head` VARCHAR(100), IN `facId` VARCHAR(50), IN `d_code` VARCHAR(50), IN `selling_price` INT, IN `accNo` VARCHAR(50), IN `transactionType` VARCHAR(20))  BEGIN 
  DECLARE balance_dispensary int;
  DECLARE acc_balance int;
  
  IF transactionType='insta' THEN
  
  SELECT dispensary_balance INTO balance_dispensary FROM drugpurchaserecords WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry ;
  
  UPDATE drugpurchaserecords set dispensary_balance = balance_dispensary - quantity_in WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry;
  
  INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,quantity_in,0,'sold_items',supplierId,receiptsn,userId,genericName,facId);
  
  INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,0,quantity_in,'dispensary',supplierId,receiptsn,userId,genericName,facId);


  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo,
                            modeOfPayment,facilityId,client_acct) 
        VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,facId,accNo);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, 
                            modeOfPayment,facilityId,client_acct) 
      VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,facId,accNo);
      
      ELSEIF transactionType='deposit' THEN
      
      SELECT dispensary_balance INTO balance_dispensary FROM drugpurchaserecords WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry;
  
  UPDATE drugpurchaserecords set dispensary_balance = balance_dispensary - quantity_in WHERE drug=drug_name AND cost_price=cost AND expiry_date=expiry;
  
 INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,quantity_in,0,'sold_items',supplierId,receiptsn,userId,genericName,facId);
  
  INSERT INTO drugs (drug_code,drug,expiry_date,price,unit_of_issue,qty_in,qty_out,source,supplier,receipt_no,created_by,genericName,facilityId) VALUES (d_code,drug_name,expiry,selling_price,unit,0,quantity_in,'dispensary',supplierId,receiptsn,userId,genericName,facId);


  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo,
                            modeOfPayment,facilityId,client_acct) 
        VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,facId,accNo);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, 
                            modeOfPayment,facilityId,client_acct) 
      VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,facId,accNo);
      
	  SELECT balance into acc_balance from patientfileno WHERE accountNo=accNo AND facilityId=facId;
	  UPDATE patientfileno SET balance = acc_balance - amt WHERE accountNo = accNo AND facilityId=facId;
   END IF;
COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_expense` (IN `facId` VARCHAR(50), IN `descr` VARCHAR(100), IN `source_head` VARCHAR(100), IN `dest_head` VARCHAR(100), IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(50), IN `userId` VARCHAR(50), IN `amt` INT, IN `collected` VARCHAR(100))  BEGIN 
    INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,facilityId,client_acct) 
        VALUES (descr,source_head,amt,0,userId,receiptsn,receiptno,payment_mode,facId,collected);
    INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,facilityId,client_acct) 
      VALUES (descr,dest_head,0,amt,userId,receiptsn,receiptno,payment_mode,facId,collected);
    
    COMMIT;
  END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_service` (IN `title` VARCHAR(225), IN `description` VARCHAR(225), IN `cost` INT(15), IN `accHead` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
   INSERT INTO services(title, description, cost, accHead,facilityId) VALUES (title,description,cost,accHead,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_service_from_deposit` (IN `facId` VARCHAR(100), IN `patientId` VARCHAR(50), IN `amt` INT, IN `source_head` VARCHAR(100), IN `dest_head` VARCHAR(100), IN `userId` VARCHAR(50), IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(20), IN `descr` VARCHAR(100))  NO SQL
BEGIN 
  DECLARE acc_balance int;
  SELECT balance INTO acc_balance FROM patientfileno WHERE accountNo = patientId AND facilityId=facId;
  UPDATE patientfileno SET balance = acc_balance - amt WHERE accountNo = patientId AND facilityId=facId;
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,patient_id,facilityId) 
    VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,patientId,facId);
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,patient_id,facilityId) 
    VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,patientId,facId);
  
  COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `new_service_instant_payment` (IN `facId` VARCHAR(50), IN `patientId` VARCHAR(50), IN `descr` VARCHAR(100), IN `source_head` VARCHAR(100), IN `dest_head` VARCHAR(100), IN `receiptsn` VARCHAR(50), IN `receiptno` VARCHAR(50), IN `payment_mode` VARCHAR(50), IN `userId` VARCHAR(50), IN `amt` INT, IN `accNo` VARCHAR(50))  NO SQL
BEGIN 
  INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,patient_id,client_acct,facilityId) 
      VALUES (descr,source_head,0,amt,userId,receiptsn,receiptno,payment_mode,patientId,accNo,facId);
    INSERT INTO transactions (description, acct, debit, credit, enteredBy, receiptDateSN, receiptNo, modeOfPayment,patient_id,client_acct,facilityId) 
      VALUES (descr,dest_head,amt,0,userId,receiptsn,receiptno,payment_mode,patientId,accNo,facId);
  
  COMMIT;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `patients_assigned_today` (IN `date` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    SELECT assigned_to Doctors, COUNT(id) Patients FROM `patientrecords` where assigned_to !="" and date_assigned = date AND facilityId=facId GROUP by assigned_to ORDER BY assigned_to;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `patient_deposit` (IN `accountNo` VARCHAR(20), IN `amount` INT(11), IN `user` VARCHAR(20), IN `receiptNo` VARCHAR(30), IN `receiptId` VARCHAR(11), IN `description` VARCHAR(200), IN `mode` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    UPDATE patientfileno set balance = patientfileno.balance + amount WHERE patientfileno.accountNo = accountNo AND facilityId=facilityId;
    INSERT into transactions (transaction_source,debit,destination,credit,amount,debited,credited,enteredBy,receiptDateSN,receiptNo,description,modeOfPayment,facilityId) VALUES (accountNo,accountNo,"Deposit","Deposit",amount,0,amount,user,receiptNo,receiptId,description,mode,facId);
   # INSERT into transactions (transaction_source,debit,destination,credit,debited,credited,enteredBy,receiptDateSN,receiptNo,description,modeOfPayment) VALUES ("Deposit",accountNo,amount,0,user,receiptNo,receiptId,description,mode);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `patient_file_no` (IN `id` INT(10), IN `facId` VARCHAR(50))  BEGIN
   Select * from patientfileno where accountNo = id AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `records_breakdown_by_month` (IN `fac_id` VARCHAR(50))  NO SQL
SELECT COUNT(*) no_of_patients, MONTH(dateCreated) month, YEAR(dateCreated) year FROM `patientrecords` WHERE facilityId=facId
GROUP BY MONTH(dateCreated),YEAR(dateCreated)
ORDER BY year, month$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report` (IN `fromDate` VARCHAR(10), IN `toDate` VARCHAR(10), IN `reportType` VARCHAR(100), IN `facId` VARCHAR(50))  BEGIN
    SELECT 
day as date, mode, description,credit,debit,Account_Head,head FROM `general_report` WHERE (date(day) BETWEEN fromDate AND toDate) AND head = reportType AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_expenditure` (IN `fromDate` VARCHAR(10), IN `toDate` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    SELECT t.date, t.services, t.amount, @running_total:=@running_total + t.balance AS bal
        FROM
        (SELECT createdAt as date, transaction_source as services, debited as amount, SUM(debited) as balance
         FROM `expenditure_view` WHERE (createdAt BETWEEN fromDate AND toDate) AND (facilityId=facId)
         GROUP BY date, transaction_source, debited) t 
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.date;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_expenditure_by_accHead` (IN `fromDate` VARCHAR(10), IN `toDate` VARCHAR(10), IN `accHead` VARCHAR(20))  BEGIN
    SELECT t.date, t.services, t.amount, @running_total:=@running_total + t.balance AS bal
        FROM
        (SELECT date, transaction_source as services, debited as amount, SUM(debited) as balance
         FROM `expenditure_view` WHERE (transaction_source = accHead) AND (date BETWEEN fromDate AND toDate)
         GROUP BY date, transaction_source, debited) t 
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.date;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_general` (IN `facId` VARCHAR(50))  BEGIN
    SELECT t.transaction_id, t.transaction_source,t.day,t.description, t.credit, t.debit,t.mode,
       @running_total:=@running_total + t.balance AS bal
        FROM
        ( SELECT transaction_id, transaction_source,
          date(createdAt) as day,description,credited credit, debited 			debit, modeOfPayment mode,
          sum(credited-debited) as balance
          FROM transactions WHERE facilityId=facId
          GROUP BY transaction_id,day,description,credit,debit,transaction_source,mode ) t
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.transaction_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_general_by_accHead` (IN `fromDate` VARCHAR(20), IN `toDate` VARCHAR(20), IN `accHead` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
    SELECT t.transaction_id, t.transaction_source,t.day,t.description, t.credit, t.debit,
       @running_total:=@running_total + t.balance AS bal
        FROM
        ( SELECT transaction_id, transaction_source,
          date(createdAt) as day,description,credited debit, debited credit,
          sum(debited-credited) as balance
          FROM transactions WHERE (transaction_source=accHead OR destination=accHead) and (createdAt BETWEEN fromDate AND toDate) AND facilityId=facId
          GROUP BY transaction_id,day,description,credit,debit,transaction_source ) t
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.transaction_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_general_by_date` (IN `fromDate` VARCHAR(20), IN `toDate` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    select description,facilityId, Account_Head, credit,debit,transaction_id,mode,day

from 

(select description,facilityId,transaction_source Account_head, amount credit,0 debit,transaction_id,modeOfPayment mode, date(createdAt) day from transactions where transaction_source in (select DISTINCT transaction_source from transactions) UNION SELECT description,facilityId,destination Account_head, 0 credit, amount debit,transaction_id,modeOfPayment mode, date(createdAt) day from transactions where destination in (select DISTINCT destination from transactions) ) stmt WHERE day BETWEEN fromDate AND toDate AND facilityId=facId order by transaction_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_general_by_date2` (IN `fromDate` VARCHAR(20), IN `toDate` VARCHAR(20))  BEGIN
    SELECT t.transaction_id, t.mode, t.transaction_source,t.day,t.description, t.credit, t.debit,
       @running_total:=@running_total + t.balance AS bal
        FROM
        ( SELECT transaction_id, transaction_source,
          date(createdAt) as day,description,credited credit, debited debit, modeOfPayment mode,
          sum(credited-debited) as balance
          FROM transactions WHERE createdAt BETWEEN fromDate AND toDate
          GROUP BY transaction_id,day,description,credit,debit,transaction_source,modeOfPayment ) t
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.transaction_id;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_revenue_by_accHead` (IN `fromDate` VARCHAR(20), IN `toDate` VARCHAR(20), IN `accHead` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    SELECT t.date, t.services, t.amount, @running_total:=@running_total + t.balance AS total
        FROM
        (SELECT date, destination as services, debited as amount, SUM(debited) as balance
         FROM `revenue_view` 
         WHERE (destination=accHead) AND (date BETWEEN fromDate AND toDate) and facilityId=facId
         GROUP BY date, destination, debited) t 
        JOIN (SELECT @running_total:=0) r
        ORDER BY t.date;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `report_suppliers` (IN `fromDate` DATE, IN `toDate` DATE, IN `fac_id` VARCHAR(50))  NO SQL
SELECT SUM(quantity), SUM(cost), supplier, date(date) date FROM drugpurchaserecords WHERE facilityId=fac_id AND date BETWEEN fromDate AND toDate GROUP by supplier, date$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_new_diesel_refuel` (IN `dateCreated` VARCHAR(10), IN `gen` VARCHAR(10), IN `quantity` VARCHAR(10), IN `facId` VARCHAR(50))  BEGIN
    INSERT into dieselrefuel(createdAt,gen,quantity,facilityId) values(dateCreated,gen,quantity,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_new_diesel_usage` (IN `dateCreated` VARCHAR(20), IN `gen` VARCHAR(10), IN `time_started` VARCHAR(10), IN `time_stopped` VARCHAR(10))  BEGIN
    INSERT into dieselusage(createdAt,gen,time_started,time_stopped) VALUES (dateCreated,gen,time_started,time_stopped);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_new_drug` (IN `drug` VARCHAR(30), IN `unitOfIssue` VARCHAR(3), IN `quantity` VARCHAR(6), IN `price` INT(7), IN `expiryDate` VARCHAR(20), IN `dateBrought` DATE, IN `facId` VARCHAR(50))  BEGIN
    INSERT INTO drugs(date_brought,drug,unit_of_issue,quantity,price,expiry_date,facilityId) VALUES (dateBrought,drug,unitOfIssue,quantity,price,expiryDate,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_new_error_repair_log` (IN `dateCreated` VARCHAR(11), IN `time` VARCHAR(11), IN `repairedBy` VARCHAR(50), IN `nature` VARCHAR(200))  BEGIN
    INSERT INTO repairlogs(date,time,repaired_by,nature) VALUES(dateCreated,time,repairedBy,nature);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_new_service_log` (IN `dateCreated` VARCHAR(11), IN `next_service_date` VARCHAR(11))  BEGIN
    INSERT INTO servicelogs(date,createdAt,next_service_due_date) values(dateCreated,dateCreated,next_service_date);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `save_operation_note` (IN `op_date` VARCHAR(30), IN `patient_id` VARCHAR(10), IN `diagnosis` VARCHAR(150), IN `surgery` VARCHAR(150), IN `surgeons` VARCHAR(150), IN `anesthetist` VARCHAR(80), IN `anesthetic` VARCHAR(20), IN `scrubNurse` VARCHAR(30), IN `remarks` VARCHAR(50), IN `name` VARCHAR(100), IN `pintsGiven` VARCHAR(10), IN `bloodLoss` VARCHAR(15), IN `intraOpAntibiotics` VARCHAR(20), IN `intraOpFindings` VARCHAR(2000), IN `procedureNotes` VARCHAR(2000), IN `pathologyRequest` VARCHAR(200), IN `postOpOrder` VARCHAR(1000), IN `facId` VARCHAR(50))  BEGIN
   INSERT INTO operationnotes(date, patientId, diagnosis, surgery, surgeons, anesthetist, anesthetic, scrubNurse, remarks, name, pintsGiven, bloodLoss, intraOpAntibiotics, intraOpFindings, procedureNotes, pathologyRequest, postOpOrder,facilityId) VALUES (op_date,patient_id,diagnosis, surgery, surgeons, anesthetist, anesthetic, scrubNurse, remarks, name, pintsGiven, bloodLoss, intraOpAntibiotics, intraOpFindings, procedureNotes,pathologyRequest, postOpOrder,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `search_drug` (IN `p_drug` VARCHAR(50), IN `facId` VARCHAR(50), IN `t_source` VARCHAR(20))  NO SQL
IF t_source = 'dispensary' THEN

SELECT drug,drug_code,generic_name,cost_price,cost_price+markUp as price,balance,dispensary_balance as d_balance,
        supplier,unit_of_issue,supplier, expiry_date,markUp as markup
        FROM drugpurchaserecords
        WHERE facilityId=facId AND date(created_at) = (
          SELECT MIN(date(created_at)) FROM drugpurchaserecords WHERE drug = p_drug OR drug_code = p_drug
        ) AND (drug = p_drug OR drug_code = p_drug);
        
  ELSE
  
  SELECT drug,drug_code,genericName,price as cost_price,price+markup as price, unit_of_issue,supplier, expiry_date,markup as markup
        FROM drugs
        WHERE facilityId=facId AND date(created_at) = (
          SELECT MIN(date(created_at)) FROM drugs WHERE drug = p_drug OR drug_code = p_drug
        ) AND (drug = p_drug OR drug_code = p_drug);
        
  END IF$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `transfer` (IN `transfer_from` VARCHAR(50), IN `transfer_to` VARCHAR(50), IN `amount` INT(11), IN `comment` VARCHAR(500), IN `facId` VARCHAR(50))  BEGIN
    INSERT INTO `transfers`(`amountReceived`,`amountHandedOver`, `transfer_from`, `transfer_to`, `comment`, `facilityId`) VALUES(0,amount,transfer_from,transfer_to,comment,facId);
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `update_client_account` (IN `acc_no` VARCHAR(50), IN `amount` INT, IN `facId` VARCHAR(50))  NO SQL
BEGIN
DECLARE acc_balance int;
SELECT balance into acc_balance from patientfileno WHERE accountNo=acc_no AND facilityId=facId;
UPDATE patientfileno SET balance = acc_balance - amount WHERE accountNo = acc_no AND facilityId=facId;


END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `update_drug` (IN `drugId` VARCHAR(11), IN `drug` VARCHAR(100), IN `generic` VARCHAR(100), IN `expiryDate` VARCHAR(12), IN `qtty` INT(11), IN `price` INT(11), IN `unit_of_issue` VARCHAR(20), IN `reorder_level` VARCHAR(11), IN `expiryAlert` VARCHAR(20), IN `facId` VARCHAR(50))  BEGIN
    UPDATE drugs SET drug=drug,expiry_date=expiryDate,quantity=qtty,price=price,unit_of_issue=unit_of_issue,reorder_level=reorder_level,expiryAlert=expiryAlert,genericName=generic,facilityId=facId WHERE drug_id = drugId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `update_drug_qtty` (IN `drugId` VARCHAR(10), IN `qtty` VARCHAR(6), IN `facId` VARCHAR(50))  BEGIN
    UPDATE drugs SET quantity=drugs.quantity - qtty WHERE drug_id=drugId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `update_services` (IN `title` VARCHAR(225), IN `description` VARCHAR(225), IN `cost` INT(15), IN `serviceId` INT(11), IN `facId` VARCHAR(50))  BEGIN
   UPDATE services SET title=title,description=description,cost=cost WHERE service_id=serviceId AND facilityId=facId;
END$$

CREATE DEFINER=`root`@`localhost` PROCEDURE `update_supplier` (IN `supplierId` VARCHAR(50), IN `supp_name` VARCHAR(100), IN `addr` VARCHAR(100), IN `ph` VARCHAR(20), IN `cd` VARCHAR(50), IN `facId` VARCHAR(50))  BEGIN
	UPDATE suppliersinfo SET supplier_name=supp_name, address=addr, phone=ph, code=cd WHERE id=supplierId AND facilityId=facId;
END$$

DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `account`
--

CREATE TABLE `account` (
  `id` int(11) NOT NULL,
  `head` varchar(100) DEFAULT NULL,
  `balance` int(11) DEFAULT NULL,
  `subhead` varchar(50) DEFAULT NULL,
  `description` varchar(500) DEFAULT NULL,
  `facilityId` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `account`
--

INSERT INTO `account` (`id`, `head`, `balance`, `subhead`, `description`, `facilityId`) VALUES
(1, 'Remedix Pharmacy', 0, '', '', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(2, 'Revenue', 0, 'Remedix Pharmacy', '20000', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(3, 'Expenditure', 0, 'Remedix Pharmacy', '30000', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(4, 'Liability', 0, 'Remedix Pharmacy', '40000', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(5, 'Deposit', 0, 'Liability', '40001', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(6, 'Drug Sales', 0, 'Revenue', '20001', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(7, 'Fueling', 0, 'Expenditure', '30001', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(8, 'Transportation', 0, 'Expenditure', '30002', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(9, 'Optimum Diagnostics', 0, '', '10000', '966a89f6-05d8-4564-b319-2f8863821e75'),
(10, 'Revenue', 0, 'Optimum Diagnostics', '20000', '966a89f6-05d8-4564-b319-2f8863821e75'),
(11, 'Expenditure', 0, 'Optimum Diagnostics', '30000', '966a89f6-05d8-4564-b319-2f8863821e75'),
(12, 'Liability', 0, 'Optimum Diagnostics', '40000', '966a89f6-05d8-4564-b319-2f8863821e75'),
(13, 'Deposit', 0, 'Liability', '40001', '966a89f6-05d8-4564-b319-2f8863821e75'),
(16, 'Registration & Testing fees', 0, 'Revenue', '20001', '966a89f6-05d8-4564-b319-2f8863821e75'),
(17, 'Other Income', 0, 'Revenue', '20002', '966a89f6-05d8-4564-b319-2f8863821e75'),
(18, 'Covid 19 Expenses', 0, 'Expenditure', '30001', '966a89f6-05d8-4564-b319-2f8863821e75'),
(19, 'Reagents & other test consumables', 0, 'Expenditure', '30002', '966a89f6-05d8-4564-b319-2f8863821e75'),
(20, 'CT Scan Expense', 0, 'Expenditure', '30003', '966a89f6-05d8-4564-b319-2f8863821e75'),
(21, 'Electricity Expenses', 0, 'Expenditure', '30004', '966a89f6-05d8-4564-b319-2f8863821e75'),
(22, 'Office Toiletries  & Others', 0, 'Expenditure', '30005', '966a89f6-05d8-4564-b319-2f8863821e75'),
(23, 'Repairs & Maint. Equipment', 0, 'Expenditure', '30006', '966a89f6-05d8-4564-b319-2f8863821e75'),
(24, 'Repairs and Mantainance Building', 0, 'Expenditure', '30007', '966a89f6-05d8-4564-b319-2f8863821e75'),
(25, 'Printing & Stationaries', 0, 'Expenditure', '30008', '966a89f6-05d8-4564-b319-2f8863821e75'),
(26, ' Generator Repairs and Maintenance', 0, 'Expenditure', '30009', '966a89f6-05d8-4564-b319-2f8863821e75'),
(27, 'Motor vehicle running expenses', 0, 'Expenditure', '30010', '966a89f6-05d8-4564-b319-2f8863821e75'),
(28, 'Refund', 0, 'Expenditure', '30011', '966a89f6-05d8-4564-b319-2f8863821e75'),
(29, 'Overtime', 0, 'Expenditure', '30012', '966a89f6-05d8-4564-b319-2f8863821e75'),
(30, 'Outsourced tests', 0, 'Expenditure', '30013', '966a89f6-05d8-4564-b319-2f8863821e75'),
(31, 'Entertainment Expenses', 0, 'Expenditure', '30014', '966a89f6-05d8-4564-b319-2f8863821e75'),
(32, 'Salaries and Wages', 0, 'Expenditure', '30015', '966a89f6-05d8-4564-b319-2f8863821e75'),
(33, 'Taxation Expense', 0, 'Expenditure', '30016', '966a89f6-05d8-4564-b319-2f8863821e75'),
(34, 'Doctors reporting fees', 0, 'Expenditure', '30017', '966a89f6-05d8-4564-b319-2f8863821e75'),
(35, 'Cleaning Expenses', 0, 'Expenditure', '30018', '966a89f6-05d8-4564-b319-2f8863821e75'),
(36, 'IOU', 0, 'Expenditure', '30019', '966a89f6-05d8-4564-b319-2f8863821e75'),
(37, 'Transfer to CT Account', 0, 'Expenditure', '30020', '966a89f6-05d8-4564-b319-2f8863821e75'),
(38, 'Telephone & Internet expense', 0, 'Expenditure', '30021', '966a89f6-05d8-4564-b319-2f8863821e75'),
(39, 'Bank charges', 0, 'Expenditure', '30022', '966a89f6-05d8-4564-b319-2f8863821e75'),
(40, 'Assets', 0, 'Optimum Diagnostics', '50000', '966a89f6-05d8-4564-b319-2f8863821e75'),
(41, 'Cash', 0, 'Revenue', '20001', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(42, 'Bank', 0, 'Revenue', '20002', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
(43, 'Remedix Pharmacy LTD', 0, '', '', '1d401e9f-0cb3-494d-98a5-901e0886a5c8');

-- --------------------------------------------------------

--
-- Table structure for table `account_type`
--

CREATE TABLE `account_type` (
  `code` int(11) NOT NULL,
  `Category` varchar(40) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `account_type`
--

INSERT INTO `account_type` (`code`, `Category`) VALUES
(1, 'Expenditure'),
(2, 'Revenue'),
(3, 'Assets'),
(4, 'Liability');

-- --------------------------------------------------------

--
-- Table structure for table `appconfig`
--

CREATE TABLE `appconfig` (
  `appName` varchar(30) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `assignpatient`
--

CREATE TABLE `assignpatient` (
  `diagDate` date NOT NULL,
  `patientNo` varchar(50) NOT NULL,
  `seenBy` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `audit_trail`
--

CREATE TABLE `audit_trail` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(11) NOT NULL DEFAULT '0',
  `supplier_name` varchar(100) DEFAULT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `address` varchar(250) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `code` varchar(10) NOT NULL,
  `new_supplier_name` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `audit_trail`
--

INSERT INTO `audit_trail` (`facilityId`, `id`, `supplier_name`, `date`, `address`, `phone`, `code`, `new_supplier_name`) VALUES
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 27, 'Worldwide Comm Venture Ltd (Galvus Met)1', '2020-08-21 06:54:14', 'Whatsapp', '08034653480', '', '');

-- --------------------------------------------------------

--
-- Table structure for table `chartofaccount`
--

CREATE TABLE `chartofaccount` (
  `code` varchar(3) NOT NULL,
  `head` varchar(100) DEFAULT NULL,
  `subHead` varchar(100) DEFAULT NULL,
  `description` varchar(20) NOT NULL,
  `balance` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `chartofaccount`
--

INSERT INTO `chartofaccount` (`code`, `head`, `subHead`, `description`, `balance`) VALUES
('CLN', NULL, NULL, 'clinic', 62900),
('LAB', NULL, NULL, 'lab', 0);

-- --------------------------------------------------------

--
-- Table structure for table `comment`
--

CREATE TABLE `comment` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(100) NOT NULL,
  `booking_no` int(100) NOT NULL,
  `user_id` int(100) NOT NULL,
  `comment` varchar(100) NOT NULL,
  `lab_name` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `contacts`
--

CREATE TABLE `contacts` (
  `id` char(36) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
  `firstname` varchar(255) DEFAULT NULL,
  `lastname` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `diagnosis`
--

CREATE TABLE `diagnosis` (
  `facilityId` varchar(50) NOT NULL,
  `vital_weight` varchar(10) DEFAULT NULL,
  `vital_height` varchar(10) DEFAULT NULL,
  `headcircumference` varchar(50) DEFAULT NULL,
  `muac` varchar(50) DEFAULT NULL,
  `tempreture` varchar(10) DEFAULT NULL,
  `pulse` varchar(10) DEFAULT NULL,
  `bloodpressure` varchar(15) DEFAULT NULL,
  `respiratory` varchar(15) DEFAULT NULL,
  `nutrition` varchar(50) DEFAULT NULL,
  `immunization` varchar(200) DEFAULT NULL,
  `development` varchar(200) DEFAULT NULL,
  `pbnh` varchar(200) DEFAULT NULL,
  `generalexamination` varchar(500) DEFAULT NULL,
  `cvs` varchar(50) DEFAULT NULL,
  `cns` varchar(50) DEFAULT NULL,
  `mss` varchar(50) DEFAULT NULL,
  `abdomen` varchar(50) DEFAULT NULL,
  `problem1` varchar(2000) DEFAULT NULL,
  `problem2` varchar(2000) DEFAULT NULL,
  `problem3` varchar(2000) DEFAULT NULL,
  `problem4` varchar(2000) DEFAULT NULL,
  `problem5` varchar(2000) DEFAULT NULL,
  `provisionalDiagnosis1` varchar(2000) DEFAULT NULL,
  `provisionalDiagnosis2` varchar(2000) DEFAULT NULL,
  `provisionalDiagnosis3` varchar(2000) DEFAULT NULL,
  `provisionalDiagnosis4` varchar(2000) DEFAULT NULL,
  `provisionalDiagnosis5` varchar(2000) DEFAULT NULL,
  `addedcare` varchar(2000) DEFAULT NULL,
  `partToDress` varchar(500) DEFAULT NULL,
  `dresswith` varchar(500) DEFAULT NULL,
  `seen_by` varchar(50) DEFAULT NULL,
  `patient_id` varchar(50) NOT NULL,
  `date` datetime DEFAULT CURRENT_TIMESTAMP,
  `status` varchar(50) DEFAULT NULL,
  `appointment_date` datetime DEFAULT NULL,
  `comment` varchar(150) DEFAULT NULL,
  `pastSurgicalHistory` varchar(500) DEFAULT NULL,
  `social` varchar(400) DEFAULT NULL,
  `otherSocialHistory` varchar(2000) DEFAULT NULL,
  `obtsGyneaHistory` varchar(2000) DEFAULT NULL,
  `pasttMedicalHistory` varchar(2000) DEFAULT NULL,
  `allergy` varchar(60) DEFAULT NULL,
  `otherAllergies` varchar(2000) DEFAULT NULL,
  `drugHistory` varchar(2000) DEFAULT NULL,
  `otherSysExamination` varchar(2000) DEFAULT NULL,
  `respiratoryRate` varchar(20) DEFAULT NULL,
  `athropometry_height` varchar(10) DEFAULT NULL,
  `presenting_complaints` varchar(4000) DEFAULT NULL,
  `athropometry_weight` varchar(10) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `BMR` varchar(5) DEFAULT NULL,
  `BVR` varchar(5) DEFAULT NULL,
  `LLL` varchar(5) DEFAULT NULL,
  `RLL` varchar(5) DEFAULT NULL,
  `LUL` varchar(5) DEFAULT NULL,
  `RUL` varchar(5) NOT NULL,
  `management_plan` varchar(2000) DEFAULT NULL,
  `asthmatic` varchar(5) DEFAULT NULL,
  `dehydration` varchar(20) DEFAULT NULL,
  `diabetic` varchar(5) DEFAULT NULL,
  `diabeticRegularOnMedication` varchar(50) DEFAULT NULL,
  `hypertensive` varchar(5) DEFAULT NULL,
  `hypertensiveDuration` varchar(50) DEFAULT NULL,
  `eye_opening` varchar(5) DEFAULT NULL,
  `others` varchar(50) DEFAULT NULL,
  `palor` varchar(5) DEFAULT NULL,
  `pastMedicalHistory` varchar(200) DEFAULT NULL,
  `observation_request` varchar(2000) DEFAULT NULL,
  `hypertensiveRegularOnMedication` varchar(50) DEFAULT NULL,
  `optimalSugarControl` varchar(50) DEFAULT NULL,
  `drugAllergy` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `diagnosis`
--

INSERT INTO `diagnosis` (`facilityId`, `vital_weight`, `vital_height`, `headcircumference`, `muac`, `tempreture`, `pulse`, `bloodpressure`, `respiratory`, `nutrition`, `immunization`, `development`, `pbnh`, `generalexamination`, `cvs`, `cns`, `mss`, `abdomen`, `problem1`, `problem2`, `problem3`, `problem4`, `problem5`, `provisionalDiagnosis1`, `provisionalDiagnosis2`, `provisionalDiagnosis3`, `provisionalDiagnosis4`, `provisionalDiagnosis5`, `addedcare`, `partToDress`, `dresswith`, `seen_by`, `patient_id`, `date`, `status`, `appointment_date`, `comment`, `pastSurgicalHistory`, `social`, `otherSocialHistory`, `obtsGyneaHistory`, `pasttMedicalHistory`, `allergy`, `otherAllergies`, `drugHistory`, `otherSysExamination`, `respiratoryRate`, `athropometry_height`, `presenting_complaints`, `athropometry_weight`, `id`, `BMR`, `BVR`, `LLL`, `RLL`, `LUL`, `RUL`, `management_plan`, `asthmatic`, `dehydration`, `diabetic`, `diabeticRegularOnMedication`, `hypertensive`, `hypertensiveDuration`, `eye_opening`, `others`, `palor`, `pastMedicalHistory`, `observation_request`, `hypertensiveRegularOnMedication`, `optimalSugarControl`, `drugAllergy`) VALUES
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '70', '1.64', '1.23', '33', '34', '23', '33', '41', 'cleared', 'cleared', 'properly developed', '', '', '12', '22', '', '11', 'headache', 'stomachache', '', '', '', 'medicine for fever', 'diagnosed with catarrh and cough', '', '', '', '', 'undefined', 'undefined', 'aminu', '', '2018-11-18 00:00:00', '', '2019-12-12 00:00:00', '', 'nothing much', 'married', 'celebrity', '', '', 'foodstuff', 'no problem', 'no past record', '', '11', '1.78', NULL, '70', 28, '3', '', '4/5', '3/5', '', '1/5', 'null', 'no', '+2', 'no', NULL, 'no', NULL, '2', 'no others', '+1', 'cleared', 'null', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '68', '1.76', '2.3', '2.132', '31', '12', '22', '23', 'well taken care of', 'immunized', 'well developed', '', '', '22', '42', '', '3.22', 'toothache', '', '', '', '', 'diagnosed with Newcastle disease', '', '', '', '', '', 'undefined', 'undefined', 'aminu', '5196', '2018-11-18 00:00:00', '', '2019-12-12 00:00:00', '', '', 'smoking', '', '', '', 'foodstuff', 'no other', 'not an addict', '', '23', '1.7', NULL, '68', 29, '4', '', '5/5', '4/5', '', '4/5', 'null', 'no', '+2', 'no', NULL, 'no', NULL, '2', '', '+3', 'cleared', 'to be observed for 2 weeks', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '80', '123', '12.5', '44', '45', '44', '34', '', '', 'proper', '', '', '', '', '', '', '', 'running stomach', '', '', '', '', '', '', '', '', '', '', 'undefined', 'undefined', 'aminu', '392-3', '2018-11-25 00:00:00', '', '2019-12-12 00:00:00', '', '', 'married', 'none', '', '', 'flower', '', 'non addict', '', '122', '123', NULL, '90', 37, '3', '', '4/5', '1/5', '', '5/5', 'null', 'no', '+1', 'no', NULL, 'yes', NULL, '3', '', '+2', 'none', 'nothing ', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '22', '44', 'dsfa', 'fsda', '22', '23', '44', '', 'dsf', 'fdsa', 'fsad', 'safdc', '', 'asf', '', 'fsa', 'aefsd', 'asdf', '', 'fasd', '', 'asfd', 'asfd', 'sadf', 'sfad', 'sdfa', 'fasd', NULL, 'fsadx', 'sdfdfgdfs', 'doctor', '392-2', '2019-12-29 01:33:27', NULL, NULL, NULL, 'fsda', ',alcohol', '', '', NULL, ',foodstuff', '', '', '', '32', 'fsad', NULL, 'sfadf', 55, '0', NULL, '0', '0', NULL, '0', 'undefined', '', 'sdaf', '', 'null', '', 'null', '0', 'asfd', 'asdf', 'asdfzXC', 'undefined', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '44', '35', 'head circumference', 'muca', '33', '32', '12', '12', 'nutrition', 'immunization', 'developmental  history', 'pregnancy', '', '12', 'cns', '112', '21', 'Problems 1', 'Problems to', 'Problems 3', 'Problems for', 'Problem 5', 'diagnosis 1 ', '2', '3', '4', '5', NULL, 'part to dress', 'drss', 'doctor', '329-2', '2019-12-31 12:35:23', NULL, NULL, NULL, 'asdf', ',married,smoking,alcohol', 'other social history', '', NULL, ',foodstuff,flower,dust,drugs', 'alergies', 'drug history', 'others', '232', 'high;len', NULL, 'wegith', 57, '2', NULL, '04', '04', NULL, '4', 'undefined', 'no', '22', 'yes', 'yes', 'yes', '2 months', '4', 'thesr', '12', 'test', 'undefined', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '332', '212', 'head circumference', 'muac', '22', '33', '23', '12', 'nutritions', 'dfgsf', 'developemental', 'pregnancy birth', '', '34', '32', '23', '22', '1', '2', '3', '4', '5', '1', '2', '3', '4', '5', NULL, 'part to dress', 'dress with', 'doctor', '329-2', '2019-12-31 18:38:36', NULL, NULL, NULL, 'dfgs', ',alcohol', 'dfsd', 'fds', NULL, ',flower', 'fdgsf', 'dfssdg', '65', '12', 'height', NULL, 'weight', 58, '01', NULL, '01', '01', NULL, '01', 'undefined', 'yes', '22', 'yes', 'yes', 'yes', '2months', '01', 'dfgas', '345', 'dfsdfas', 'undefined', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', 'rest', 'sdzfsd', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '329-2', '2019-12-31 19:55:16', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', 'aserd', NULL, 'test', 59, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', 'undefined', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '24', '34', 'qwsa', '', '2', '123', '12', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '329-2', '2020-01-06 17:24:08', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '23', '', NULL, 'wert', 60, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3608-1', '2020-01-06 19:16:11', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', NULL, '', 61, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, 'more', 'dressing', 'doctor', '3608-1', '2020-01-06 19:24:56', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', NULL, '', 62, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3574-1', '2020-01-07 07:11:01', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', NULL, '', 63, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '329-2', '2020-01-07 07:17:33', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', NULL, '', 64, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', 'yep', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3575-1', '2020-01-07 07:36:45', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', NULL, '', 65, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3580-1', '2020-01-07 07:52:08', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', 'undefined', '', 66, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3581-1', '2020-01-07 07:56:35', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', 'ao sososos (asdfasfd)', '', 67, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', 'null', '', 'null', '0', '', '', '', '', NULL, NULL, NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', '', NULL, '', '', 'doctor', '3587-1', '2020-02-21 16:42:17', 'seen', NULL, NULL, '', '', '', '', NULL, '', '', '', '', '', '', '', '', 68, '0', NULL, '0', '0', NULL, '0', 'undefined', '', '', '', NULL, '', 'null', '0', '', '', '', '', 'null', 'null', ''),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '78', '186', '', '', '37.3', '70', '120/80', 'resp', '', '', '', '', '', 'cvs', 'cns', '', 'abd', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', 'undefined', NULL, '', '', 'abdurrahman', '3742-1', '2020-03-14 14:31:31', 'seen', NULL, NULL, 'Past surgical', ',smoking,alcohol', '', '', NULL, ',foodstuff,drugs', 'none', '', '', '20', '', 'ghgj, (history 1),presenting (History2)', '', 69, '5', NULL, '2', '3', NULL, '4', 'undefined', 'yes', 'dehydr', 'yes', NULL, 'yes', '3 years', '3', '', 'palor', 'past medical', '', 'no', 'no', '');

-- --------------------------------------------------------

--
-- Table structure for table `dieselrefuel`
--

CREATE TABLE `dieselrefuel` (
  `id` int(11) NOT NULL,
  `createdAt` datetime DEFAULT CURRENT_TIMESTAMP,
  `gen` varchar(11) DEFAULT NULL,
  `quantity` varchar(11) DEFAULT NULL,
  `facilityId` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dieselrefuel`
--

INSERT INTO `dieselrefuel` (`id`, `createdAt`, `gen`, `quantity`, `facilityId`) VALUES
(1, '2019-12-24 00:00:00', 'Gen2', '25', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(2, '2019-12-24 00:00:00', 'Gen1', '34', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(3, '2019-12-25 00:00:00', 'Gen2', '34', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(4, '2019-12-25 00:00:00', 'Gen1', '80', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a');

-- --------------------------------------------------------

--
-- Table structure for table `dieselusage`
--

CREATE TABLE `dieselusage` (
  `id` int(11) NOT NULL,
  `createdAt` datetime DEFAULT CURRENT_TIMESTAMP,
  `gen` varchar(10) DEFAULT NULL,
  `time_started` time DEFAULT NULL,
  `time_stopped` time DEFAULT NULL,
  `facilityId` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dieselusage`
--

INSERT INTO `dieselusage` (`id`, `createdAt`, `gen`, `time_started`, `time_stopped`, `facilityId`) VALUES
(1, '2019-12-22 00:00:00', 'gen1', '12:12:12', '17:45:23', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(2, '2019-12-24 00:00:00', 'Gen2', '22:12:00', '23:45:00', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(3, '2019-12-24 00:00:00', 'Gen1', '22:12:00', '22:12:00', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(4, '2019-12-24 00:00:00', 'Gen1', '22:12:00', '22:12:00', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(5, '2019-12-25 00:00:00', 'Gen2', '10:12:00', '10:12:00', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a'),
(6, '2019-12-25 00:00:00', 'Gen1', '17:12:00', '17:12:00', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a');

-- --------------------------------------------------------

--
-- Table structure for table `dispensary`
--

CREATE TABLE `dispensary` (
  `drug` varchar(40) DEFAULT NULL,
  `dosage` varchar(40) DEFAULT NULL,
  `quantity_dispensed` int(11) DEFAULT NULL,
  `unit_of_issue` varchar(20) DEFAULT NULL,
  `price` int(11) NOT NULL,
  `amount` varchar(11) DEFAULT NULL,
  `discount` varchar(50) NOT NULL,
  `total` int(50) NOT NULL,
  `patient_id` varchar(11) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `receiptNo` varchar(11) DEFAULT NULL,
  `facilityId` varchar(50) NOT NULL,
  `created_at` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `dispensed_by` varchar(50) DEFAULT NULL,
  `prescribed_by` varchar(50) DEFAULT NULL,
  `duration` varchar(20) DEFAULT NULL,
  `period` varchar(20) DEFAULT NULL,
  `frequency` varchar(20) DEFAULT NULL,
  `receipt_no` varchar(50) DEFAULT NULL,
  `expiry_date` date DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `dispensary`
--

INSERT INTO `dispensary` (`drug`, `dosage`, `quantity_dispensed`, `unit_of_issue`, `price`, `amount`, `discount`, `total`, `patient_id`, `id`, `receiptNo`, `facilityId`, `created_at`, `dispensed_by`, `prescribed_by`, `duration`, `period`, `frequency`, `receipt_no`, `expiry_date`, `status`) VALUES
('Calcium Sandox', '3mg', NULL, NULL, 0, NULL, '0', 0, '329-2', 1, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-06 17:24:08', NULL, 'doctor', '2', 'hour', '4', NULL, NULL, 'request'),
('Ceftriaxone', '500mg', NULL, NULL, 0, NULL, '0', 0, '329-2', 2, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-06 17:24:08', NULL, 'doctor', '2', 'hour', '4', NULL, NULL, 'request'),
('Calcium Sandox', '3mg', NULL, NULL, 0, NULL, '0', 0, '3608-1', 3, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-06 19:16:11', NULL, 'doctor', '1', 'day', '4', NULL, NULL, 'request'),
('Susp Lactulose', '3mg', NULL, NULL, 0, NULL, '0', 0, '3608-1', 4, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-06 19:24:56', NULL, 'doctor', '2', 'day', '4', NULL, NULL, 'request'),
('Inj Ondasetron', '3mg', NULL, NULL, 0, NULL, '0', 0, '3574-1', 5, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-07 07:11:01', NULL, 'doctor', '8', 'day', '4', NULL, NULL, 'request'),
('Inj Rocephin 1000gm', '500mg', NULL, NULL, 0, NULL, '0', 0, '3575-1', 6, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-07 07:36:45', NULL, 'doctor', '3', 'day', '4', NULL, NULL, 'request'),
('Acipep susp', '300 mg', NULL, NULL, 0, NULL, '0', 0, '3588-1', 7, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-13 15:17:15', NULL, 'abdurrahman', '2', 'day', 'daily', NULL, NULL, 'request'),
('Ceftriaxone', '1g', NULL, NULL, 0, NULL, '0', 0, '3588-1', 8, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-13 15:17:15', NULL, 'abdurrahman', '3', 'day', 'bd', NULL, NULL, 'request'),
('Acipep susp', '300 mg', NULL, NULL, 0, NULL, '0', 0, '3742-1', 9, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-03-14 14:31:31', NULL, 'abdurrahman', '5', 'day', 'bd', NULL, NULL, 'request'),
('Albendazole syr', '400mg', NULL, NULL, 0, NULL, '0', 0, '3742-1', 10, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-03-14 14:31:31', NULL, 'abdurrahman', '8', 'week', 'daily', NULL, NULL, 'request'),
('Cencold Syr', '', 667, '1', 0, '400200', '0', 0, '', 11, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 07:51:01', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 1, '1', 0, '500', '0', 0, '', 12, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 09:25:38', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Cencold Syr', '', 1, '1', 0, '600', '0', 0, '', 13, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 09:32:21', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 767, '1', 0, '383500', '0', 0, '', 14, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 16:20:09', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Erythromycin Syr', '', 1, '1', 0, '1500', 'Percentage', 1500, '', 15, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 19:55:14', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Erythromycin Syr', '', 1, '1', 0, '1500', 'Percentage', 1500, '', 16, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 19:55:14', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 7, '1', 0, '3500', 'Fixed', -166, '', 17, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 19:58:39', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Erythromycin Syr', '', 5, '1', 0, '7500', 'Percentage', 7497, '', 18, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-21 22:08:03', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 1, '1', 0, '500', 'Fixed', 449, '', 19, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:08:57', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Erythromycin Syr', '', 2, '1', 0, '3000', 'Percentage', 3000, '', 20, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:43:38', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Cencold Syr', '', 1, '1', 0, '600', 'Percentage', 600, '', 21, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:52:58', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 12, '1', 0, '6000', 'Percentage', 6000, '', 22, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:53:53', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Promethazine Syr', '', 2, '1', 0, '1200', 'Percentage', 1199, '', 23, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:53:53', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 12, '1', 0, '6000', 'Percentage', 6000, '', 24, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:54:27', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Promethazine Syr', '', 2, '1', 0, '1200', 'Percentage', 1199, '', 25, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:54:27', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 12, '1', 0, '6000', 'Percentage', 6000, '', 26, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:54:27', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Promethazine Syr', '', 2, '1', 0, '1200', 'Percentage', 1199, '', 27, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:54:27', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 1, '1', 0, '500', 'Percentage', 500, '', 28, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 07:55:18', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Vitamine C', '', 1, '1', 0, '500', 'Percentage', 440, '', 29, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 08:52:12', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Erythromycin Syr', '', 1, '1', 0, '1500', 'Percentage', 1485, '', 30, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 09:13:57', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Brustan N syr', '', 20, '1', 0, '14000', 'Percentage', 9800, '', 31, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 13:17:57', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Promethazine Syr', '', 30, '1', 0, '18000', 'Percentage', 16200, '', 32, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 13:24:09', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Promethazine Syr', '', 60, '1', 0, '36000', 'Percentage', 31680, '', 33, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-07-22 13:29:53', 'Adewale Muritala', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '120', 7080, '', 34, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:11:02', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 2, '12', 3000, '6000', '120', 7080, '', 35, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:11:02', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, '12', 200, '200', '120', 7080, '', 36, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:11:02', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '25', 1775, '', 37, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:12:37', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 4, '12', 200, '800', '25', 1775, '', 38, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:12:37', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 20, '20', 500, '10000', '20', 9980, '', 39, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:20:36', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 40, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:21:40', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 2, '12', 3000, '6000', '0', 6000, '', 41, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:22:21', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 42, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:23:13', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 3, '20', 500, '1500', '0', 1500, '', 43, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:24:05', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 3, '20', 500, '1500', '0', 1500, '', 44, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:25:24', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 12, '20', 500, '6000', '50', 5950, '', 45, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:26:56', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '100', 900, '', 46, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:27:23', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 47, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:30:16', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '1', 999, '', 48, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:34:37', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 49, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:35:22', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '10', 990, '', 50, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 05:36:28', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '10', 990, '', 51, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:41:02', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '66.66666666666667', 4533, '', 52, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:44:45', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 3, '12', 200, '600', '66.66666666666667', 4533, '', 53, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:44:45', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 1, '12', 3000, '3000', '66.66666666666667', 4533, '', 54, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:44:45', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 55, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:45:59', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 1, '20', 500, '500', '20', 480, '', 56, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:46:50', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 57, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:48:01', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 58, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:52:35', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 3, '20', 500, '1500', '20', 1480, '', 59, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:55:28', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 60, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 08:57:08', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 61, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:02:03', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 3, '12', 3000, '9000', '0', 9000, '', 62, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:02:15', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 2, '12', 200, '400', '0', 400, '', 63, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:03:47', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 6, '12', 200, '1200', '0', 1200, '', 64, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:05:24', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 9, '12', 200, '1800', '100', 1700, '', 65, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:07:29', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 5, '12', 200, '1000', '2116.6666666666665', 124883, '', 66, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:09:38', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 40, '12', 3000, '120000', '2116.6666666666665', 124883, '', 67, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:09:38', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 12, '20', 500, '6000', '2116.6666666666665', 124883, '', 68, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:09:38', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 4, '12', 200, '800', '50', 750, '', 69, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:18:05', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 3, '20', 500, '1500', '0', 1500, '', 70, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:33:18', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 3, '20', 500, '1500', '0', 1500, '', 71, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:35:43', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 10, '12', 200, '2000', '20', 1980, '', 72, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:36:23', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 12, '20', 500, '6000', '0', 6000, '', 73, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:43:41', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 12, '20', 500, '6000', '0', 6000, '', 74, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:43:51', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 12, '12', 200, '2400', '0', 2400, '', 75, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:44:40', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 12, '12', 200, '2400', '0', 2400, '', 76, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:46:06', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 3, '12', 3000, '9000', '100', 8900, '', 77, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 09:46:56', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 78, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:10:51', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 4, '1', 5000, '20000', '20', 19980, '', 79, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:13:36', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 5, '12', 500, '2500', '255', 33745, '', 80, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:53:58', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 1, '12', 500, '500', '255', 33745, '', 81, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:53:58', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 2, '12', 500, '1000', '255', 33745, '', 82, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:53:58', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 60, '12', 500, '30000', '255', 33745, '', 83, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 13:53:58', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '848', 3392, '', 84, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:19:48', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('somethingnew', '', 2, '23', 300, '600', '0', 600, '', 85, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:30:00', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 86, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:32:34', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('somethingnew', '', 1, '23', 300, '300', '0', 300, '', 87, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:34:16', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 88, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:37:01', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 89, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:37:24', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 90, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:47:13', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 91, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:47:48', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('somethingnew', '', 2, '23', 300, '600', '0', 600, '', 92, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:48:50', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('somethingnew', '', 2, '23', 300, '600', '0', 600, '', 93, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:50:23', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 2, '2', 2120, '4240', '0', 4240, '', 94, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 14:50:42', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Mine', '', 7, '12', 200, '1400', '2685', 104715, '', 95, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 20:27:29', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('samson antidote', '', 50, '2', 2120, '106000', '2685', 104715, '', 96, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-07-24 20:27:29', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 1, '12', 500, '500', '0', 500, '', 97, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-08 05:19:27', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 2, '12', 500, '1000', '0', 1000, 'Aminu', 98, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 10:26:19', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 2, '20', 500, '1000', '0', 1000, '', 99, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:04:28', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 2, '12', 3000, '6000', '0', 6000, '', 100, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:08:23', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, '12', 200, '200', '0', 200, '', 101, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:09:50', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 1, '1', 5000, '5000', '0', 5000, '', 102, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:10:17', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 1, '1', 5000, '5000', '0', 5000, '', 103, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:23:36', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Paracetamol', '', 1, '20', 500, '500', '0', 500, '', 104, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:25:26', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 2, '1', 5000, '10000', '0', 10000, '', 105, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:28:27', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 2, '1', 5000, '10000', '0', 10000, '', 106, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:29:39', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 2, '12', 3000, '6000', '0', 6000, '', 107, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:30:01', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('another new', '', 2, '1', 5000, '10000', '0', 10000, '', 108, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:31:45', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 2, '12', 200, '400', '0', 400, '', 109, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:33:10', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, '12', 200, '200', '0', 200, '', 110, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-10 16:59:34', 'My User', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 111, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:41:55', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Tramadol', '', 10, NULL, 3000, '30000', '0', 30000, NULL, 112, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:42:35', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 113, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:44:01', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 114, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:44:13', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 115, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:45:41', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 116, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:55:24', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 117, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-11 10:56:20', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '20', 180, NULL, 118, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-12 08:54:55', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('Codine', '', 1, NULL, 200, '200', '0', 200, NULL, 119, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-12 08:57:33', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL),
('PANADOL', '', 1, NULL, 500, '500', '0', 500, NULL, 120, NULL, '6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-17 10:15:45', 'pharm_m', NULL, NULL, NULL, NULL, NULL, NULL, NULL);

-- --------------------------------------------------------

--
-- Table structure for table `druglist`
--

CREATE TABLE `druglist` (
  `id` int(11) NOT NULL,
  `name` varchar(50) NOT NULL,
  `generic_name` varchar(50) DEFAULT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `druglist`
--

INSERT INTO `druglist` (`id`, `name`, `generic_name`, `created_at`) VALUES
(4, 'Ceftriaxone', NULL, '0000-00-00 00:00:00'),
(5, 'Ceftriaxone', NULL, '0000-00-00 00:00:00'),
(6, 'Tabs Pregabalin 75mg', NULL, '0000-00-00 00:00:00'),
(7, 'Tabs Eproxen', NULL, '0000-00-00 00:00:00'),
(8, 'Inj Ondasetron', NULL, '0000-00-00 00:00:00'),
(9, 'Inj Traxemic', NULL, '0000-00-00 00:00:00'),
(10, 'Calcium Sandox', NULL, '0000-00-00 00:00:00'),
(11, 'Tab Fleming 625mg', NULL, '0000-00-00 00:00:00'),
(12, 'Syr Antabon ', NULL, '0000-00-00 00:00:00'),
(13, 'Tab Lonart DS', NULL, '0000-00-00 00:00:00'),
(14, 'Susp Lactulose', NULL, '0000-00-00 00:00:00'),
(15, 'Inj Rocephin 1000gm', NULL, '0000-00-00 00:00:00'),
(16, 'Syr Cencold', NULL, '0000-00-00 00:00:00'),
(17, 'Tab Omeprazole 20mg', NULL, '0000-00-00 00:00:00'),
(18, 'Emal iv', 'Arthemeter', '0000-00-00 00:00:00'),
(19, 'Emal iv', 'Arthemeter', '0000-00-00 00:00:00'),
(20, 'Emal iv', 'Arthemeter', '0000-00-00 00:00:00'),
(21, 'Emal iv', 'Arthemeter', '0000-00-00 00:00:00'),
(22, 'Emal iv', 'Arthemeter', '0000-00-00 00:00:00'),
(23, 'Artesunate iv', 'Artesun', '0000-00-00 00:00:00'),
(24, 'Act', 'Arthemeter', '0000-00-00 00:00:00'),
(25, 'Cocodamol tabs', 'Analgesic', '0000-00-00 00:00:00'),
(26, 'Anorol tabs', 'Analgesic', '0000-00-00 00:00:00'),
(27, 'Ketrolac', 'Analgesic', '0000-00-00 00:00:00'),
(28, 'Tabs Baclofen', 'Analgesic', '0000-00-00 00:00:00'),
(29, 'Diclofenec tabs', 'Analgesic', '0000-00-00 00:00:00'),
(30, 'Pcm tabs', 'Analgesic ', '0000-00-00 00:00:00'),
(31, 'Inflanil tabs', 'Analgesic', '0000-00-00 00:00:00'),
(32, 'Penta iv', 'Analgesic', '0000-00-00 00:00:00'),
(33, 'Tramadol injection', 'Analgesic ', '0000-00-00 00:00:00'),
(34, 'Diclofenac iv', 'Analgesic', '0000-00-00 00:00:00'),
(35, 'Pcm iv ', 'Analgesic ', '0000-00-00 00:00:00'),
(36, 'Loratidine tabs', 'Anti Histamine', '0000-00-00 00:00:00'),
(37, 'Tabs prednisolone', 'Histamine', '0000-00-00 00:00:00'),
(38, 'Tabs piriton', 'Histamine', '0000-00-00 00:00:00'),
(39, 'Otrivine nasal', 'Histamine', '0000-00-00 00:00:00'),
(40, 'Ventolin inhaler', 'Histamine', '0000-00-00 00:00:00'),
(41, 'Xylo Acino', 'Histamine ', '0000-00-00 00:00:00'),
(42, 'Tabs Actified', 'Histamine', '0000-00-00 00:00:00'),
(43, 'Nystatin susp', 'Histamines ', '0000-00-00 00:00:00'),
(44, 'Dicynon iv', 'Histamines ', '0000-00-00 00:00:00'),
(45, 'Tabs Rebeprazole', 'GIT', '0000-00-00 00:00:00'),
(46, 'Tabs Rebeprazole', 'GIT', '0000-00-00 00:00:00'),
(47, 'Ranitidine tabs', 'GIT', '0000-00-00 00:00:00'),
(48, 'Floranum ', 'GIT', '0000-00-00 00:00:00'),
(49, 'Domperidone tabs', 'GIT ', '0000-00-00 00:00:00'),
(50, 'Injection Omeprazole', 'GIT', '0000-00-00 00:00:00'),
(51, 'Inj Rebeprazole ', 'GIT', '0000-00-00 00:00:00'),
(52, 'Tabs Albendazole', 'GIT', '0000-00-00 00:00:00'),
(53, 'Tabs Buscopan', 'GIT', '0000-00-00 00:00:00'),
(54, 'Tabs Dulcolax', 'GIT', '0000-00-00 00:00:00'),
(55, 'Tabs zinc sulphate', 'GIT', '0000-00-00 00:00:00'),
(56, 'Tabs navidoxime', 'GIT', '0000-00-00 00:00:00'),
(57, 'Tabs metoclopromide', 'GIT', '0000-00-00 00:00:00'),
(58, 'Tabs Ondasectron', 'GIT', '0000-00-00 00:00:00'),
(59, 'Inj metoclopromide', 'GIT', '0000-00-00 00:00:00'),
(60, 'Inj Ondasectron', 'GIT', '0000-00-00 00:00:00'),
(61, 'Inj promethazine', 'GIT', '0000-00-00 00:00:00'),
(62, 'Tabs Tegretol', 'Anti convulsant', '0000-00-00 00:00:00'),
(63, 'Calamine lotion', 'Anti conversant ', '0000-00-00 00:00:00'),
(64, 'Tabs phenytoin', 'Anti convulsant', '0000-00-00 00:00:00'),
(65, 'Tabs neurobion', 'Multivite', '0000-00-00 00:00:00'),
(66, 'Vit c tabs', 'Multivite', '0000-00-00 00:00:00'),
(67, 'Vit E tabs', 'Multivite', '0000-00-00 00:00:00'),
(68, 'Neurotex tabs', 'Multivite', '0000-00-00 00:00:00'),
(69, 'Tabs vit A', 'Multivite', '0000-00-00 00:00:00'),
(70, 'Maxiron capsule', 'Multivite', '0000-00-00 00:00:00'),
(71, 'Calcimax tabs', 'Multivite', '0000-00-00 00:00:00'),
(72, 'Tabs Metoprolol', 'Anti HTN', '0000-00-00 00:00:00'),
(73, 'Tabs lisinopril', 'Anti HTN', '0000-00-00 00:00:00'),
(74, 'Bendro tabs', 'Anti HTN', '0000-00-00 00:00:00'),
(75, 'Bendro 5mg', 'Anti HTN', '0000-00-00 00:00:00'),
(76, 'Losartan tabs', 'Anti HTN', '0000-00-00 00:00:00'),
(77, 'Tabs Torsmide', 'Anti HTN', '0000-00-00 00:00:00'),
(78, 'Tabs Amlozaar', 'Anti HTN', '0000-00-00 00:00:00'),
(79, 'Amlodipine tabs 5mg', 'Anti HTN', '0000-00-00 00:00:00'),
(80, 'Amlodipine tabs 10mg', 'Anti HTN', '0000-00-00 00:00:00'),
(81, 'Peridopril', 'Anti HTN', '0000-00-00 00:00:00'),
(82, 'Tabs Nifidipine', 'Anti HTN', '0000-00-00 00:00:00'),
(83, 'Tabs vasoprin', 'Anti HTN', '0000-00-00 00:00:00'),
(84, 'Pradaxa tabs ', 'Dabigatrin/ Anti Embolism', '0000-00-00 00:00:00'),
(85, 'Chymoral tabs', 'Chymotrypcin/Embolism', '0000-00-00 00:00:00'),
(86, 'Tabs Lexotan ', 'Embolism', '0000-00-00 00:00:00'),
(87, 'Tabs Diazepam', 'Anti Embolism', '0000-00-00 00:00:00'),
(88, 'Tabs Acetazolamide', 'Añxiolytic', '0000-00-00 00:00:00'),
(89, 'Inj Dexametheson', 'Anti Embolism', '0000-00-00 00:00:00'),
(90, 'Iv flagyl', 'Ant Biotic', '0000-00-00 00:00:00'),
(91, 'Iv Augmenting ', 'Anti Biotic', '0000-00-00 00:00:00'),
(92, 'Iv Tavanic', 'Anti Boitic', '0000-00-00 00:00:00'),
(93, 'Inj Meropenum', 'AntiBiotic', '0000-00-00 00:00:00'),
(94, 'Inj Gentamycin', 'Anti Boitic', '0000-00-00 00:00:00'),
(95, 'Iv ciprofloxacin', 'Anti Boitic', '0000-00-00 00:00:00'),
(96, 'Tabs ciprofloxacin', 'Anti Boitic', '0000-00-00 00:00:00'),
(97, 'Tabs flagyl', 'Anti Biotic', '0000-00-00 00:00:00'),
(98, 'Tabs Clarithromycin', 'Anti Biotic', '0000-00-00 00:00:00'),
(99, 'Tabs Clindamycin', 'Anti Biotic', '0000-00-00 00:00:00'),
(100, 'Tabs Cefixime', 'Anti Boitic', '0000-00-00 00:00:00'),
(101, 'Tabs Augmenting 625', 'Anti Biotic', '0000-00-00 00:00:00'),
(102, 'Tabs Levofloxacin ', 'Anti Biotic', '0000-00-00 00:00:00'),
(103, 'Tabs Amoxicillin', 'Anti Biotic', '0000-00-00 00:00:00'),
(104, 'Tabs Ampiclox', 'Anti Biotic', '0000-00-00 00:00:00'),
(105, 'Tabs Cefuroxime', 'Anti Biotic', '0000-00-00 00:00:00'),
(106, 'Tabs Azithromycin', 'Anti Biotic', '0000-00-00 00:00:00'),
(107, 'Tabs Ofloxacin', 'Anti Biotic', '0000-00-00 00:00:00'),
(108, 'Relcer gel susp', 'GIT', '0000-00-00 00:00:00'),
(109, 'Acipep susp', 'GIT', '0000-00-00 00:00:00'),
(110, 'Inj Aminophylline', 'Aminophy', '0000-00-00 00:00:00'),
(111, 'Inj piriton', 'Anti Histamine ', '0000-00-00 00:00:00'),
(112, 'Inj Hyoscin', 'Hyocin', '0000-00-00 00:00:00'),
(113, 'Inj Frusemide', 'Lasix', '0000-00-00 00:00:00'),
(114, 'Inj Andrenaline', 'Andr', '0000-00-00 00:00:00'),
(115, 'Inj B12', 'Multivit', '0000-00-00 00:00:00'),
(116, 'Inj B-Complex', 'Vitamines', '0000-00-00 00:00:00'),
(117, 'Inj Hydrocotisine', 'Hydrocot', '0000-00-00 00:00:00'),
(118, 'B-Complex syr', 'Vitamine', '0000-00-00 00:00:00'),
(119, 'Menthodex syr', 'Anti Histamine', '0000-00-00 00:00:00'),
(120, 'Broncholyte syr', 'Anti Histamine', '0000-00-00 00:00:00'),
(121, 'Loratidine syr', 'Anti Histamine', '0000-00-00 00:00:00'),
(122, 'Cefixime syr', 'Anti Biotic', '0000-00-00 00:00:00'),
(123, 'Cefuroxime syr', 'Anti Biotic', '0000-00-00 00:00:00'),
(124, 'Allergin syr', 'Piriton', '0000-00-00 00:00:00'),
(125, 'Albendazole syr', 'GIT', '0000-00-00 00:00:00'),
(126, 'Liquid parafin', 'GIT', '0000-00-00 00:00:00'),
(127, 'Pcm syr', 'Analgesic ', '0000-00-00 00:00:00'),
(128, 'Brustan N syr', 'Analgesic ', '0000-00-00 00:00:00'),
(129, 'Promethazine Syr', 'Prometh', '0000-00-00 00:00:00'),
(130, 'Erythromycin Syr', 'Anti Biotic', '0000-00-00 00:00:00'),
(131, 'Vitamine C', 'Multivite', '0000-00-00 00:00:00'),
(132, 'Cencold Syr', 'Analgesic ', '0000-00-00 00:00:00'),
(133, 'Albendazole syr', NULL, '0000-00-00 00:00:00'),
(134, 'BONABEBE', 'BONABEBE', '0000-00-00 00:00:00'),
(135, 'PANDA COLD DROP', 'PANDA COLD', '0000-00-00 00:00:00'),
(136, 'BRUSTAN N SYRUP ', 'BRUSTAN N SYRUP ', '0000-00-00 00:00:00'),
(137, 'PANDA DROP', 'PANDA DROP', '0000-00-00 00:00:00'),
(138, 'AVIPOL SYRUP', 'PARACETAMOL SYRUP', '0000-00-00 00:00:00'),
(139, 'TEGRETOL TAB  ', 'CARBAMAZEPINE', '0000-00-00 00:00:00'),
(140, 'BUSCOPAN TAB', 'HYOSCINE BUTYL BROMIDE', '0000-00-00 00:00:00'),
(141, 'N0SPAMIN DROP', 'N0SPAMIN DROP ', '0000-00-00 00:00:00'),
(142, 'MZOR PARACETAMOL TAB', 'PARACETANOL', '0000-00-00 00:00:00'),
(143, 'PANADOL EXTRA', 'GSK', '0000-00-00 00:00:00'),
(144, 'PANADOL REGULAR', 'GSK', '0000-00-00 00:00:00'),
(145, 'CELEBREX', 'CELEBBREX', '0000-00-00 00:00:00'),
(146, 'CLOFENAC ', 'DICLOFENAC', '0000-00-00 00:00:00'),
(147, 'CLOFENAC A', 'DICLOFENAC', '0000-00-00 00:00:00'),
(148, 'ARTHROTEC', 'ARTHROTEC', '0000-00-00 00:00:00'),
(149, 'VOLTAREN', 'DICLOFENAC', '0000-00-00 00:00:00'),
(150, 'CHYMOCIN', 'CHYMOTRYPCIN', '0000-00-00 00:00:00'),
(151, 'DICLOWIN INJ', 'DICLOFENAC', '0000-00-00 00:00:00'),
(152, 'PEMASON INJ', 'PARACETAMOL', '0000-00-00 00:00:00'),
(153, 'NOSPA', 'NOSPA', '0000-00-00 00:00:00'),
(154, 'MIXANAL', 'MIXANAL', '0000-00-00 00:00:00'),
(155, 'SUDREX', 'PARACETAMOL AND CAFFEN', '0000-00-00 00:00:00'),
(156, 'BOSKA', 'BOSKA', '0000-00-00 00:00:00'),
(157, 'IBEX', 'SANOPI', '0000-00-00 00:00:00'),
(158, 'ASHTON AND PERSON', 'ASHTON AND PERSON', '0000-00-00 00:00:00'),
(159, 'BRUSTAN - N TABLET', 'IBUPROFEN', '0000-00-00 00:00:00'),
(160, 'INFLANIL', 'DICLOFENAC AND PARACETAMOL', '0000-00-00 00:00:00'),
(161, 'ZYLORIC ', 'ALLOPURINOL', '0000-00-00 00:00:00'),
(162, 'FLOTEC ', 'NORVATIS', '0000-00-00 00:00:00'),
(163, '0RTHOPAIN - A', 'MELOXICAM', '0000-00-00 00:00:00'),
(164, 'FELXICAM', 'PIROXICAM', '0000-00-00 00:00:00'),
(165, 'PAUSE', 'TRANEXAMIC ACID', '0000-00-00 00:00:00'),
(166, 'MELOCAP 7.5MG', 'MELOXICAM', '0000-00-00 00:00:00'),
(167, 'GESTID SUSP', 'GESTID', '0000-00-00 00:00:00'),
(168, 'RELCER SUSP', 'RELCER', '0000-00-00 00:00:00'),
(169, 'RULOX', 'RULOX', '0000-00-00 00:00:00'),
(170, 'GESTID TABLET', 'GESTID', '0000-00-00 00:00:00'),
(171, 'DANACID', 'DANACID ', '0000-00-00 00:00:00'),
(172, 'AZMUCAINE', 'AZMU', '0000-00-00 00:00:00'),
(173, 'ASAD BIG BOTTLE', 'MAGNESIUM TRISILICATE', '0000-00-00 00:00:00'),
(174, 'HYCID TABLET', 'OMEPRAZOLE', '0000-00-00 00:00:00'),
(175, 'BAROLE', 'RABEPRAZOLE', '0000-00-00 00:00:00'),
(176, 'RANITAB 150MG', 'RANITADINE', '0000-00-00 00:00:00'),
(177, 'GETZOME POWDER 40MG', 'OMEPRAZOLE ', '0000-00-00 00:00:00'),
(178, 'KRISCET 200MG', 'CIMETADINE', '0000-00-00 00:00:00'),
(179, 'MEZOL - C INJ', 'OMEPRAZOLE', '0000-00-00 00:00:00'),
(180, 'GV PAINT', 'MOKO', '0000-00-00 00:00:00'),
(181, 'SPIRIT', 'AICON', '0000-00-00 00:00:00'),
(182, 'EUSOL', 'AICON', '0000-00-00 00:00:00'),
(183, 'HYDROGEN', 'AICON', '0000-00-00 00:00:00'),
(184, 'ANUSOL SUPPOSITORIES', 'ANUSOL', '0000-00-00 00:00:00'),
(185, 'BELAX', 'BISACODYI', '0000-00-00 00:00:00'),
(186, 'DAFFLON', 'DAFFLON', '0000-00-00 00:00:00'),
(187, 'LIQIUD PARAFIN', 'SKG', '0000-00-00 00:00:00'),
(188, 'COLON CLEANSER TEA', 'KEDI', '0000-00-00 00:00:00'),
(189, 'PANFOR 1G ', 'METFORMIN', '0000-00-00 00:00:00'),
(190, 'DIAMACRON 80MG', 'DIAMACRON', '0000-00-00 00:00:00'),
(191, 'GLUCOPHAGE', 'METFORMIN', '0000-00-00 00:00:00'),
(192, 'PERGLIM 2MG', 'GLIMEPRIDE', '0000-00-00 00:00:00'),
(193, 'PERGLIM 4MG', 'GLIMEPRIDE', '0000-00-00 00:00:00'),
(194, 'AMARYL 2MG', 'GLIMEPRIDE', '0000-00-00 00:00:00'),
(195, 'AMARYL 4MG', 'GLIMEPRIDE', '0000-00-00 00:00:00'),
(196, 'B COMPLEX COUNT', 'B COMPLEX', '0000-00-00 00:00:00'),
(197, 'VIT -C WHITE COUNT', 'VIT C', '0000-00-00 00:00:00'),
(198, 'FOLIC ACID COUNT', 'FOLIC ACID', '0000-00-00 00:00:00'),
(199, 'EMVITE COUNT', 'MULTIVITAMIN', '0000-00-00 00:00:00'),
(200, 'THIAZAMIDE 500MG', 'SULPHATHIAZOLE 500MG', '0000-00-00 00:00:00'),
(201, 'LIQUID QUININE', 'QUININE', '0000-00-00 00:00:00'),
(202, 'CAMOSUNATE  - P', 'ARTEMISININ ', '0000-00-00 00:00:00'),
(203, 'MALDOX SYR', 'MZOR', '0000-00-00 00:00:00'),
(204, 'LONART SUSP', 'ARTEMETHER AND LUMEFANTRINE', '0000-00-00 00:00:00'),
(205, 'P/ALAXIN SUSP', 'DIHYDROARTEMISININ AND PIPERAQUINE', '0000-00-00 00:00:00'),
(206, 'SWIDAR', 'SWIPHA', '0000-00-00 00:00:00'),
(207, 'ARENAX PLUS FORTE', 'SWIPHA', '0000-00-00 00:00:00'),
(208, 'COATEM 80/480', 'NORVATIS', '0000-00-00 00:00:00'),
(209, 'CARTEF DS', 'ARTEMETHER AND LUMEFANTRINE', '0000-00-00 00:00:00'),
(210, 'P/ALAXIN TABLET', 'DIHYDROARTEMISININ AND PIPERAQUINE', '0000-00-00 00:00:00'),
(211, 'ARTEQUICK', 'ARTEMISININ 62.5MG AND PIPERAQUINE 375MG', '0000-00-00 00:00:00'),
(212, 'ARTEQUINE ADULT', 'ARTESUNATE AND MEFLOQUINE', '0000-00-00 00:00:00'),
(213, 'ARTEQUINE CHILD ', 'ARTESUNATE AND MEFLOQUINE', '0000-00-00 00:00:00'),
(214, 'AMATEM SOFT GEL ', 'ARTEMETHER AND LUMEFANTRIN', '0000-00-00 00:00:00'),
(215, 'QUININE TABLET', 'QUININE', '0000-00-00 00:00:00'),
(216, 'ARTENITER INJ', 'ARTEMETHER', '0000-00-00 00:00:00'),
(217, 'AZMAN ', 'ARTEETHER', '0000-00-00 00:00:00'),
(218, 'EMAL 75MG', 'ARTEETHER', '0000-00-00 00:00:00'),
(219, 'EMAL 150MG', 'ARTEETHER', '0000-00-00 00:00:00'),
(220, 'VISKART INJ', 'ARTESUNATE', '0000-00-00 00:00:00'),
(221, 'QUININE INJ', 'QUININE', '0000-00-00 00:00:00'),
(222, 'ZINNAT SUSP', 'CEFUROXIME', '0000-00-00 00:00:00'),
(223, 'SUITROX SUSP', 'AZITHROMYCIN', '0000-00-00 00:00:00'),
(224, '0CEFIX 100ML', 'CEFIXIME', '0000-00-00 00:00:00'),
(225, 'TROZ 100ML', 'METRONIDAZOLE INFUSION', '0000-00-00 00:00:00'),
(226, 'NYSTATIN DROP', 'NYSTATIN', '0000-00-00 00:00:00'),
(227, 'NYSTATIN DROP', 'NYSTATIN', '0000-00-00 00:00:00'),
(228, 'FLUCAMED SYR', 'FLUCONAZOLE', '0000-00-00 00:00:00'),
(229, 'REFUCIL SYR', 'GRISEOFULVIN', '0000-00-00 00:00:00'),
(230, 'ORELOX SUSP ', 'CEFPODOXIME', '0000-00-00 00:00:00'),
(231, '0RACIP INFUSION', 'CIPR0FLOXACIN', '0000-00-00 00:00:00'),
(232, 'AMOKSIKLAV 625', 'AMOXIL AND CLAVUNATE', '0000-00-00 00:00:00'),
(233, 'AUGMENTIN 625', 'GSK', '0000-00-00 00:00:00'),
(234, 'AUGMENTIN 1G', 'GSK', '0000-00-00 00:00:00'),
(235, 'AMOKSIKLAV 1G', 'AMOXIL AND CLAVUNATE ACID', '0000-00-00 00:00:00'),
(236, 'ROSCILOX SUSP', 'AMPICLOX', '0000-00-00 00:00:00'),
(237, 'AMPICLOX DROP   ', 'GSK', '0000-00-00 00:00:00'),
(238, 'COMPI- CLOX SUSP', 'AMPICLOX', '0000-00-00 00:00:00'),
(239, 'DRAMOXILIN SUSP', 'DGF', '0000-00-00 00:00:00'),
(240, 'RANOXYL SUSP', 'AMOXIL', '0000-00-00 00:00:00'),
(241, 'JAWACLOX SUSP', 'JAWA', '0000-00-00 00:00:00'),
(242, 'AKKAFAXONE IV', 'CEFTRIAZONE', '0000-00-00 00:00:00'),
(243, 'ROCEPHIN', 'NORVATIS', '0000-00-00 00:00:00'),
(244, 'OCEXONE', 'SWIPHA', '0000-00-00 00:00:00'),
(245, 'LOXAGYL 400MG', 'METRONIDAZOLE', '0000-00-00 00:00:00'),
(246, 'AZITHROMYCIN TAB X10', 'AZITROMYCIN', '0000-00-00 00:00:00'),
(247, 'LEVOTIL 500MG', 'LEVOFLOXACINE M&B', '0000-00-00 00:00:00'),
(248, 'OFLOMED 200MG', 'OFL0XACIN', '0000-00-00 00:00:00'),
(249, 'ERYTHROMYCIN ', 'SIVO', '0000-00-00 00:00:00'),
(250, 'CIPROTAB', 'FIDSON', '0000-00-00 00:00:00'),
(251, 'ZINNAT 250MG', 'CEFUROXIME', '0000-00-00 00:00:00'),
(252, 'LOXAGYL SUSP', 'METRONIDAZOLE M&B', '0000-00-00 00:00:00'),
(253, 'TINIFLOX ', 'TINIDAZOLE & OFLOXACIN', '0000-00-00 00:00:00'),
(254, 'DOXYCAP', 'DOXYCYCLINE', '0000-00-00 00:00:00'),
(255, 'COMPI- CLOX CAPSULE', 'DGF', '0000-00-00 00:00:00'),
(256, 'TETRACYCLINE 250MG', 'FIDSON', '0000-00-00 00:00:00'),
(257, 'GENTALAK INJ', 'GENTAMYCIN', '0000-00-00 00:00:00'),
(258, 'AMPICLOX CAP  BICHEM', 'GSK', '0000-00-00 00:00:00'),
(259, 'DRAMOXILIN 500MG', 'DGF', '0000-00-00 00:00:00'),
(260, 'KRISMOX 500MG', 'AMOXIL', '0000-00-00 00:00:00'),
(261, 'OLICLOX 500MG', 'AMPICLOX', '0000-00-00 00:00:00'),
(262, 'CIKAMOX 250MG', 'AMOXIL', '0000-00-00 00:00:00'),
(263, 'SECWID 500MG', 'SECNIDAZOLE', '0000-00-00 00:00:00'),
(264, 'OCEFIX 400MG', 'CEFIXIME', '0000-00-00 00:00:00'),
(265, 'TRIMAC FORTE', 'SWIPHA', '0000-00-00 00:00:00'),
(266, 'PRIMPEX TABLET', 'SKG', '0000-00-00 00:00:00'),
(267, 'PRIMPEX SYR', 'SKG', '0000-00-00 00:00:00'),
(268, 'COPTRIN SYR', 'DGF', '0000-00-00 00:00:00'),
(269, 'REFUCIL TABLET', 'GRISEOFULVIN', '0000-00-00 00:00:00'),
(270, 'DRUTAZOLE', 'ALBENDAZOLE DGF', '0000-00-00 00:00:00'),
(271, 'ZENTEL TAB', 'ALBENDAZOLE', '0000-00-00 00:00:00'),
(272, 'RETRAX TABLET', 'LEVAMISOLE 40MG', '0000-00-00 00:00:00'),
(273, 'VERMOX', 'MEBENDAZOLE', '0000-00-00 00:00:00'),
(274, 'NOVACAN 150MG', 'FLUCONAZOLE', '0000-00-00 00:00:00'),
(275, 'ADAY KIT ', 'FLUCONAZOLE, AZITHROMYCIN& SECNIDAZOLR', '0000-00-00 00:00:00'),
(276, 'VIT - C DROP', 'SKG', '0000-00-00 00:00:00'),
(277, 'ASTYFER SYR 110ML', 'FIDSON', '0000-00-00 00:00:00'),
(278, 'EMVITE SYR ', 'MZOR', '0000-00-00 00:00:00'),
(279, 'CALCIMAX ', 'CALCIUM M&B', '0000-00-00 00:00:00'),
(280, 'GARLIC CAPSULE', 'GARLIC', '0000-00-00 00:00:00'),
(281, 'LIVOLIN FORTE', 'MEGA', '0000-00-00 00:00:00'),
(282, 'AFRAB VITE DROP', 'MULTIVITAMIN ', '0000-00-00 00:00:00'),
(283, 'KVIT PLUS', 'MULTIVITAMINE', '0000-00-00 00:00:00'),
(284, 'NEUROVITE FORTE', 'HOVID', '0000-00-00 00:00:00'),
(285, 'ZIMOTIL', 'LOPERAMIDE', '0000-00-00 00:00:00'),
(286, 'ASTYFER CAPSULE', 'FIDSON', '0000-00-00 00:00:00'),
(287, 'ASTYMIN CAPSULE', 'FIDSON', '0000-00-00 00:00:00'),
(288, 'VENTOLIN  INHALER', 'SALBUTAMOL', '0000-00-00 00:00:00'),
(289, 'VENTOLIN TABLET', 'SALBUTAMOL', '0000-00-00 00:00:00'),
(290, 'OTRIVIN CHILD ', 'GSK', '0000-00-00 00:00:00'),
(291, 'OTRIVIN ADULT', 'GSK', '0000-00-00 00:00:00'),
(292, 'SALBUTAMOL SYR ', 'JAWA', '0000-00-00 00:00:00'),
(293, 'VIT- A CAPSULE', 'VIT- A ', '0000-00-00 00:00:00'),
(294, 'VENTOLIN SYR', 'GSK', '0000-00-00 00:00:00'),
(295, 'BRONCHOLYTE SYR', 'NGC', '0000-00-00 00:00:00'),
(296, 'SIVOTHEOM0L', 'SIVO', '0000-00-00 00:00:00'),
(297, 'MOMENTO TABLET', 'DISLORATADINE', '0000-00-00 00:00:00'),
(298, 'ZYNCET TABLET', 'CITRIZINE', '0000-00-00 00:00:00'),
(299, 'PRITONE TABLET', 'PRITONE', '0000-00-00 00:00:00'),
(300, 'RETADINE', 'LORATYN', '0000-00-00 00:00:00'),
(301, 'NAVIDOXINE', 'NAVIDOXINE', '0000-00-00 00:00:00'),
(302, 'AVONUM ', 'PROMETHAZINE', '0000-00-00 00:00:00'),
(303, 'PREDNISOLONE', 'PREDNISOLONE', '0000-00-00 00:00:00'),
(304, 'HYDROCORTSONE INJ', 'HYDROCORTSONE ', '0000-00-00 00:00:00'),
(305, 'PROCOLD', 'PROCOLD', '0000-00-00 00:00:00'),
(306, 'MIXAGRIP', 'MIXAGRIP', '0000-00-00 00:00:00'),
(307, 'KOLD TIME', 'KOLD TIME', '0000-00-00 00:00:00'),
(308, 'NEW DIVINE', 'CONTEX', '0000-00-00 00:00:00'),
(309, 'ORT', 'ORT', '0000-00-00 00:00:00'),
(310, 'ZINC TABLET', 'MZ0R', '0000-00-00 00:00:00'),
(311, 'TUXIL D ADULT ', 'FIDSON', '0000-00-00 00:00:00'),
(312, 'NGC ADULT', 'NGC', '0000-00-00 00:00:00'),
(313, 'NGC SYR CHILD ', 'NGC ', '0000-00-00 00:00:00'),
(314, 'COFEX SYR', 'COFEX', '0000-00-00 00:00:00'),
(315, 'COFLAX ADULT', 'DGF', '0000-00-00 00:00:00'),
(316, 'COFLAX CHILD ', 'DGF', '0000-00-00 00:00:00'),
(317, 'EMZOLYN CHILD', 'MZOR', '0000-00-00 00:00:00'),
(318, 'EMZOLYN ADULT', 'MZOR', '0000-00-00 00:00:00'),
(319, 'D KOFF', 'JAWA', '0000-00-00 00:00:00'),
(320, 'ASCOREX', 'ASCOREX', '0000-00-00 00:00:00'),
(321, 'NISE PLUS 100ML', 'JAWA', '0000-00-00 00:00:00'),
(322, 'LORATADINE SYR', 'AFRAB', '0000-00-00 00:00:00'),
(323, 'LORATADINE SYR ', 'AZMU', '0000-00-00 00:00:00'),
(324, 'ZYNCET SYR', 'CITRIZINE', '0000-00-00 00:00:00'),
(325, 'MOMENTO SYR', 'DISLORATADINE', '0000-00-00 00:00:00'),
(326, 'ROPHEGAN SYR', 'PROMETHAZINE M&B', '0000-00-00 00:00:00'),
(327, 'CAC SANDOZ 1000MG', 'CALCIUM AND VIT - C', '0000-00-00 00:00:00'),
(328, 'STREPSIL ', 'STREPSIL', '0000-00-00 00:00:00'),
(329, 'SHALTOUTH', 'SHALINA', '0000-00-00 00:00:00'),
(330, 'VIT - E CAPSULE', 'VITAMIN E [MZOR]', '0000-00-00 00:00:00'),
(331, 'B COMPLEX INJ', 'DGF', '0000-00-00 00:00:00'),
(332, 'PETAZINE INJ', 'PROMETHAZINE', '0000-00-00 00:00:00'),
(333, 'NISE SYR', 'PRITON', '0000-00-00 00:00:00'),
(334, 'VIT - C GLUCOSE', 'NUTRICI', '0000-00-00 00:00:00'),
(335, 'EMVITE C TABLET', 'VIT C', '0000-00-00 00:00:00'),
(336, 'THEOPHYLINE INJ', 'THEOPHYLINE ', '0000-00-00 00:00:00'),
(337, 'PLASIL INJ', 'METOCLOPRAMIDE', '0000-00-00 00:00:00'),
(338, 'AMIL0DIPINE 5MG TEVA', 'AMILODIPINE', '0000-00-00 00:00:00'),
(339, 'LISNOPRIL 10MG ', 'TEVA', '0000-00-00 00:00:00'),
(340, 'ANGIZAAR 25MG', 'LOSARTAN', '0000-00-00 00:00:00'),
(341, 'ANGIZAAR 50MG', 'LOSARTAN', '0000-00-00 00:00:00'),
(342, 'T0RSINEX 100MG', 'MICRO LAB', '0000-00-00 00:00:00'),
(343, 'AMILODGE', 'AMILODIPINE', '0000-00-00 00:00:00'),
(344, 'SIMLO - 5 ', 'LEOTETRA', '0000-00-00 00:00:00'),
(345, 'SWIVASC 10MG', 'SWIPHA', '0000-00-00 00:00:00'),
(346, 'SWIVASC 5MG', 'SWIPHA', '0000-00-00 00:00:00'),
(347, 'BENDRO 5MG ', 'ZMC', '0000-00-00 00:00:00'),
(348, 'BENDRO 2.5MG ', 'ZMC', '0000-00-00 00:00:00'),
(349, 'ATENOLOL 50MG', 'IMPULSE', '0000-00-00 00:00:00'),
(350, 'FUROSEMIDE INJ ', 'CHUPET PHARM', '0000-00-00 00:00:00'),
(351, 'DOPATAB 250MG', 'HOVID', '0000-00-00 00:00:00'),
(352, 'NIFECARD 30MG', 'LEK', '0000-00-00 00:00:00'),
(353, 'HECARD 20MG', 'KLUSYL INT..', '0000-00-00 00:00:00'),
(354, 'SPINOTONE 25MG', 'LA-LID PHARM', '0000-00-00 00:00:00'),
(355, 'VASOPRIL', 'JUHEL', '0000-00-00 00:00:00'),
(356, 'NORMORETIC ', 'NEIMETH', '0000-00-00 00:00:00'),
(357, 'NORVASC 5MG', 'AMILODIPINE', '0000-00-00 00:00:00'),
(358, 'NORVASC 10MG', 'AMILODIPIN', '0000-00-00 00:00:00'),
(359, '5% DEXTRO ', 'FIDSON', '0000-00-00 00:00:00'),
(360, '5% DEXTRO SALINE ', 'FIDSON', '0000-00-00 00:00:00'),
(361, '5% NORMAL SALINE', 'FIDSON', '0000-00-00 00:00:00'),
(362, '4.3 DEXTRO & SALINE ', 'FIDSON', '0000-00-00 00:00:00'),
(363, '21G', 'AGARY', '0000-00-00 00:00:00'),
(364, '22G', 'AGARY', '0000-00-00 00:00:00'),
(365, '23G', 'AGARY', '0000-00-00 00:00:00'),
(366, 'DRIP GIVING SET', 'AGARY', '0000-00-00 00:00:00'),
(367, '5ML SYRINGE  ', 'AGARY', '0000-00-00 00:00:00'),
(368, '2ML SYRINGE', 'CENT JECT', '0000-00-00 00:00:00'),
(369, '10ML SYRINGE', 'AGARY', '0000-00-00 00:00:00'),
(370, 'SWIDON', 'SWIPHA', '0000-00-00 00:00:00'),
(371, 'PENTAZOCIN INJ', 'FIDSON', '0000-00-00 00:00:00'),
(372, 'TALENT 1.5MG', 'SWIPHA', '0000-00-00 00:00:00'),
(373, 'SWICLONE 7.5MG', 'SWIPHA', '0000-00-00 00:00:00'),
(374, 'UNIVAL 10MG', 'UNIVAL', '0000-00-00 00:00:00'),
(375, 'TOFRANIL ', 'AS0SS0', '0000-00-00 00:00:00'),
(376, 'TRIHALT INJ', 'TRIHALT', '0000-00-00 00:00:00'),
(377, 'MOLFIX SIGE 3 MIDI', 'MOLFIX', '0000-00-00 00:00:00'),
(378, 'COMFO', 'COMFO', '0000-00-00 00:00:00'),
(379, 'NYCIL ', 'NYCIL', '0000-00-00 00:00:00'),
(380, 'REVIVE BOTTLE', 'KEDI', '0000-00-00 00:00:00'),
(381, 'REVIVE X10', 'KEDI', '0000-00-00 00:00:00'),
(382, 'DAKTACORT 15G CREAM', 'JANSSEN', '0000-00-00 00:00:00'),
(383, 'MANIX', 'MANIX', '0000-00-00 00:00:00'),
(384, 'Vitamine C', 'Multivite', '0000-00-00 00:00:00'),
(385, 'Erythromycin Syr', 'Anti Biotic', '0000-00-00 00:00:00'),
(386, 'LABBAIK', 'LABBAIK', '0000-00-00 00:00:00'),
(387, 'STUD 100', 'STUD', '0000-00-00 00:00:00'),
(388, 'PT STRIP', 'LABACON', '0000-00-00 00:00:00'),
(389, 'FUNBACT A CREAM', 'BLISS', '0000-00-00 00:00:00'),
(390, 'PENICILLIN OINTMENT', 'DGF', '0000-00-00 00:00:00'),
(391, 'CLIN CAP CREAM', 'EMBASSAY', '0000-00-00 00:00:00'),
(392, 'POSTPILL', 'DKT', '0000-00-00 00:00:00'),
(393, 'ADHESIVE PLASTER', 'MOREC-C', '0000-00-00 00:00:00'),
(394, 'ROLL PLASTER', 'AGARRY', '0000-00-00 00:00:00'),
(395, 'BABY TRIBOTAN', 'FIDSON', '0000-00-00 00:00:00'),
(396, 'DRUJELA', 'DGF', '0000-00-00 00:00:00'),
(397, 'WOSAN  OINTMENT', 'JAWA', '0000-00-00 00:00:00'),
(398, 'BROMERGON', 'LEK', '0000-00-00 00:00:00'),
(399, 'ZEESKIN', 'SAMIN PHARM', '0000-00-00 00:00:00'),
(400, 'ABF CREAM', 'ABF', '0000-00-00 00:00:00'),
(401, 'NIZORAL CREAM', 'KETOCONAZOLE', '0000-00-00 00:00:00'),
(402, 'KY GEL', 'K-Y', '0000-00-00 00:00:00'),
(403, 'SURGICAL HAND GLOVES', 'CENTURY CARE LTD', '0000-00-00 00:00:00'),
(404, 'LATEX HAND GLOVES ', 'AGARRY', '0000-00-00 00:00:00'),
(405, 'CREPE BANDAGE', 'AGARRY', '0000-00-00 00:00:00'),
(406, 'CUTTON WOOOL', 'ALHERI', '0000-00-00 00:00:00'),
(407, 'FIESTA ', 'DKT', '0000-00-00 00:00:00'),
(408, 'DEPO PROVERA ', 'PFIZER', '0000-00-00 00:00:00'),
(409, 'BELLOSS FIBER', 'KITSUI', '0000-00-00 00:00:00'),
(410, 'COLLOMACK', 'OCTOBER PHARM', '0000-00-00 00:00:00'),
(411, 'MYCOTEN CREAM', 'DGF', '0000-00-00 00:00:00'),
(412, 'DUREX', 'DUREX', '0000-00-00 00:00:00'),
(413, 'KETOFUNG CREAM', 'DGF', '0000-00-00 00:00:00'),
(414, 'NIXODERM CREAM', 'NIXODERM ', '0000-00-00 00:00:00'),
(415, 'CHLORAMPHENICOL OINT', 'FREESBONE ', '0000-00-00 00:00:00'),
(416, 'PENICILLIN EYE OINT', 'DGF', '0000-00-00 00:00:00'),
(417, 'FLOBOID EYE DROP', 'MICRO LAB', '0000-00-00 00:00:00'),
(418, 'DEXATROL', 'DEXATROL', '0000-00-00 00:00:00'),
(419, 'CIPROMED EYE DROP', 'EUROLIFE', '0000-00-00 00:00:00'),
(420, 'OFLOXILAB EYE DROP', 'OFLXACIN', '0000-00-00 00:00:00'),
(421, 'CIFLAXIN EYE DROP', 'DGF', '0000-00-00 00:00:00'),
(422, 'CHLORAMPHENICOL    ', 'DGF', '0000-00-00 00:00:00'),
(423, 'EFEMOLIN EYE DROP', 'RUSAT SAHIBI PHARM', '0000-00-00 00:00:00'),
(424, 'OCULLERG', 'OCCULLERG', '0000-00-00 00:00:00'),
(425, 'DICLO EYE DROP', 'DGF', '0000-00-00 00:00:00'),
(426, 'EPICROM EYE DROP', 'SODIUM CROMOGLYCATE', '0000-00-00 00:00:00'),
(427, 'BETADRONE - N', 'DGF', '0000-00-00 00:00:00'),
(428, 'STADEXOLENE EYE DROP', 'DGF', '0000-00-00 00:00:00'),
(429, 'FLOBOID DX EYE DROP', 'MICRO LAB', '0000-00-00 00:00:00'),
(430, 'MONTRAL', 'MONTRAL', '0000-00-00 00:00:00'),
(431, 'BRETT MOUTH WASH', 'DEKO PHARM', '0000-00-00 00:00:00'),
(432, 'CLOMID', 'CLOMID', '0000-00-00 00:00:00'),
(433, 'NEUROGESIC  EXTRA', 'DGF', '0000-00-00 00:00:00'),
(434, 'NEUROGESIC CREAM ', 'DGF', '0000-00-00 00:00:00'),
(435, 'SENSODYNE  RAPID', 'GSK', '0000-00-00 00:00:00'),
(436, 'OLFEN INJ', 'ACINO', '0000-00-00 00:00:00'),
(437, 'GAVISCON ', 'GAVISCON', '0000-00-00 00:00:00'),
(438, 'GAVISCON D&A', 'GAVISCON', '0000-00-00 00:00:00'),
(439, 'AMOXIL BICHEM 250MG', 'GSK', '0000-00-00 00:00:00'),
(440, 'AMOXIL BICHEM 500MG', 'GSK', '0000-00-00 00:00:00'),
(441, 'ZOLERIC', 'ZOLERIC', '0000-00-00 00:00:00'),
(442, 'DRUGMOL SYR', 'DGF', '0000-00-00 00:00:00'),
(443, 'DRUGMOL TABLET', 'DGF', '0000-00-00 00:00:00'),
(444, 'LORATYN HOVID', 'HOVID', '0000-00-00 00:00:00'),
(445, 'AMILODIFINE 10MG', 'TEVA', '0000-00-00 00:00:00'),
(446, 'LISNOPRIL 5MG', 'SAM', '0000-00-00 00:00:00'),
(447, 'SINUFED SYR', 'SKG', '0000-00-00 00:00:00'),
(448, 'COMPI- CLOX COUNT', 'DGF', '0000-00-00 00:00:00'),
(449, 'NYSTATIN TABLET', 'NYSTATIN', '0000-00-00 00:00:00'),
(450, 'NEO-PRESOL ', 'DGF', '0000-00-00 00:00:00'),
(451, 'MICOZOL PLUS', 'DGF', '0000-00-00 00:00:00'),
(452, 'PRIM0LUT - N TABLET', 'BAYER', '0000-00-00 00:00:00'),
(453, 'GRESIO - CREAM', 'ALPHA LAB', '0000-00-00 00:00:00'),
(454, 'MOLFIX SIZE 4 MAXI', 'MOLFIX', '0000-00-00 00:00:00'),
(455, 'M0LPIX SIGE 2 MINI', 'MOLFIX', '0000-00-00 00:00:00'),
(456, 'MOLFIX SIGE 3 JUMBO', 'MOLFIX', '0000-00-00 00:00:00'),
(457, 'FRESH MORE', 'FRESH MORE', '0000-00-00 00:00:00'),
(458, 'EGO BODY SPRAY', 'EGO', '0000-00-00 00:00:00'),
(459, 'CHA-PET ', 'PRIME', '0000-00-00 00:00:00'),
(460, 'DUPHASTON', 'DUPHASTON', '0000-00-00 00:00:00'),
(461, 'DRULLOMACK', 'DGF', '0000-00-00 00:00:00'),
(462, 'LASIX 40MG', 'FUROSAMIDE', '0000-00-00 00:00:00'),
(463, 'ZITHROMAX SUSP', 'PFIZER', '0000-00-00 00:00:00'),
(464, 'AMITRIPPLINE TAB', 'TEVA', '0000-00-00 00:00:00'),
(465, 'CENOX TAB', 'CIPROFLOXACIN', '0000-00-00 00:00:00'),
(466, 'IMODIUM ', 'JANSSEN', '0000-00-00 00:00:00'),
(467, 'ARTE- JET INJ', 'ARTEMETHER', '0000-00-00 00:00:00'),
(468, 'SKINEAL', 'SKINEAL', '0000-00-00 00:00:00'),
(469, 'STERI-TIN ', 'FAISAL PHARM', '0000-00-00 00:00:00'),
(470, 'BIO-VEIN YELLOW', 'AGARRY', '0000-00-00 00:00:00'),
(471, 'BIO-VEIN PINK', 'AGARRY', '0000-00-00 00:00:00'),
(472, 'Vitamin', 'musa', '0000-00-00 00:00:00'),
(473, 'Acetaminophen', 'drug', '0000-00-00 00:00:00'),
(474, 'Alprazolam', 'drug', '0000-00-00 00:00:00'),
(475, 'Amitriptyline', 'drug', '0000-00-00 00:00:00'),
(476, 'Cencold Syr', 'Analgesic', '0000-00-00 00:00:00'),
(477, 'Vitamine C', 'Multivite', '0000-00-00 00:00:00'),
(478, 'Lizopril 10', 'Lisinopril', '0000-00-00 00:00:00'),
(479, 'another new', 'samson', '0000-00-00 00:00:00'),
(480, 'SUDREX', '', '2020-08-21 17:49:13'),
(481, 'DANACID', '', '2020-08-21 17:49:13'),
(482, 'ANGIZAAR 25MG', '', '2020-08-23 05:00:27'),
(483, 'SALBUTAMOL SYR ', '', '2020-08-23 05:00:27'),
(484, 'HYDROCORTSONE INJ', '', '2020-08-23 05:22:55'),
(485, 'ANGIZAAR 50MG', '', '2020-08-23 06:04:45');

-- --------------------------------------------------------

--
-- Table structure for table `drugpurchaserecords`
--

CREATE TABLE `drugpurchaserecords` (
  `drug_code` varchar(50) NOT NULL,
  `drug` varchar(30) NOT NULL,
  `generic_name` varchar(100) NOT NULL,
  `unit_of_issue` varchar(100) NOT NULL,
  `reorder_level` int(11) NOT NULL,
  `cost_price` varchar(50) NOT NULL,
  `markUp` varchar(50) NOT NULL,
  `quantity` int(11) DEFAULT '0',
  `by_whom` varchar(100) DEFAULT NULL,
  `supplier` varchar(40) NOT NULL,
  `receipt_no` varchar(20) DEFAULT NULL,
  `payment_status` varchar(10) DEFAULT NULL,
  `created_at` datetime DEFAULT CURRENT_TIMESTAMP,
  `receipt_picture` blob,
  `expiry_date` date NOT NULL,
  `expiry_alert` int(5) NOT NULL,
  `balance` varchar(50) DEFAULT NULL,
  `dispensary_balance` int(11) NOT NULL,
  `status` varchar(10) NOT NULL,
  `facilityId` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `drugpurchaserecords`
--

INSERT INTO `drugpurchaserecords` (`drug_code`, `drug`, `generic_name`, `unit_of_issue`, `reorder_level`, `cost_price`, `markUp`, `quantity`, `by_whom`, `supplier`, `receipt_no`, `payment_status`, `created_at`, `receipt_picture`, `expiry_date`, `expiry_alert`, `balance`, `dispensary_balance`, `status`, `facilityId`) VALUES
('1111', 'ANGIZAAR 50MG', '', '1', 20, '200', '0', 100, '40', '27', '23082011', 'paid', '2020-08-23 00:00:00', '', '2022-06-23', 0, '50', 48, '', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('3333', 'THIAZAMIDE 500MG', 'SULPHATHIAZOLE 500MG', '1', 20, '100', '0', 200, '40', '27', '23082011', 'paid', '2020-08-23 00:00:00', '', '2023-11-23', 0, '100', 74, '', '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'DANACID', '', '1', 20, '300', '0', 60, '40', '27', '23082011', 'paid', '2020-08-23 00:00:00', '', '2022-10-13', 0, '30', 28, '', '6c6af0c0-35ea-40d8-a928-b13a9766113a');

-- --------------------------------------------------------

--
-- Table structure for table `drugs`
--

CREATE TABLE `drugs` (
  `drug_code` varchar(50) NOT NULL,
  `drug` varchar(20) DEFAULT NULL,
  `expiry_date` varchar(10) DEFAULT NULL,
  `price` int(10) NOT NULL DEFAULT '0',
  `unit_of_issue` varchar(20) DEFAULT '0',
  `qty_in` int(11) NOT NULL,
  `qty_out` int(11) NOT NULL,
  `source` varchar(100) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `supplier` varchar(100) DEFAULT NULL,
  `receipt_no` varchar(11) NOT NULL DEFAULT '0',
  `store_award_no` int(10) NOT NULL DEFAULT '0',
  `created_by` varchar(30) DEFAULT NULL,
  `receipt_image` blob,
  `genericName` varchar(50) DEFAULT NULL,
  `markup` int(11) NOT NULL,
  `facilityId` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `drugs`
--

INSERT INTO `drugs` (`drug_code`, `drug`, `expiry_date`, `price`, `unit_of_issue`, `qty_in`, `qty_out`, `source`, `created_at`, `supplier`, `receipt_no`, `store_award_no`, `created_by`, `receipt_image`, `genericName`, `markup`, `facilityId`) VALUES
('1111', 'ANGIZAAR 50MG', '2022-06-23', 0, '1', 100, 0, 'purchases', '2020-08-23 18:13:25', '27', '23082011', 0, '40', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('3333', 'THIAZAMIDE 500MG', '2023-11-23', 0, '1', 200, 0, 'purchases', '2020-08-23 18:13:25', '27', '23082011', 0, '40', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'DANACID', '2022-10-13', 0, '1', 60, 0, 'purchases', '2020-08-23 18:13:25', '27', '23082011', 0, '40', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 200, '0', 0, 50, 'purchases', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, '', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 100, '0', 0, 100, 'purchases', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, 'SULPHATHIAZOLE 500MG', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 200, '0', 50, 0, 'dispensary', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, '', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 100, '0', 100, 0, 'dispensary', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, 'SULPHATHIAZOLE 500MG', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 300, '0', 0, 30, 'purchases', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, '', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 300, '0', 30, 0, 'dispensary', '2020-08-23 18:14:16', NULL, '0', 0, '40', NULL, '', 20, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 3, 0, 'sold_items', '2020-08-23 18:25:57', NULL, '23082027', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 3, 'dispensary', '2020-08-23 18:25:57', NULL, '23082027', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 320, '0', 1, 0, 'sold_items', '2020-08-23 19:02:03', NULL, '23082039', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 1, 0, 'sold_items', '2020-08-23 19:02:03', NULL, '23082039', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 320, '0', 0, 1, 'dispensary', '2020-08-23 19:02:03', NULL, '23082039', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 0, 1, 'dispensary', '2020-08-23 19:02:03', NULL, '23082039', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:05:00', NULL, '230820413', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 1, 0, 'sold_items', '2020-08-23 19:05:00', NULL, '230820413', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:05:00', NULL, '230820413', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 0, 1, 'dispensary', '2020-08-23 19:05:00', NULL, '230820413', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:05:26', NULL, '230820517', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 12, 0, 'sold_items', '2020-08-23 19:05:26', NULL, '230820517', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:05:26', NULL, '230820517', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('', 'ANGIZAAR 50MG', '2022-06-23', 220, '0', 0, 12, 'dispensary', '2020-08-23 19:05:26', NULL, '230820517', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:23:02', NULL, '230820621', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 320, '0', 1, 0, 'sold_items', '2020-08-23 19:23:02', NULL, '230820621', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:23:02', NULL, '230820621', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('1111', 'DANACID', '2022-10-13', 320, '0', 0, 1, 'dispensary', '2020-08-23 19:23:02', NULL, '230820621', 0, '43', NULL, '', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:33:54', NULL, '230820725', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:33:54', NULL, '230820725', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 10, 0, 'sold_items', '2020-08-23 19:35:01', NULL, '230820827', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 10, 'dispensary', '2020-08-23 19:35:01', NULL, '230820827', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:36:10', NULL, '230820929', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:36:10', NULL, '230820929', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:36:44', NULL, '2308201031', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:36:44', NULL, '2308201031', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:37:05', NULL, '2308201133', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:37:05', NULL, '2308201133', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:37:45', NULL, '2308201235', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:37:45', NULL, '2308201235', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:38:18', NULL, '2308201337', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:38:18', NULL, '2308201337', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:39:18', NULL, '2308201439', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:39:18', NULL, '2308201439', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 1, 0, 'sold_items', '2020-08-23 19:42:07', NULL, '2308201541', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 1, 'dispensary', '2020-08-23 19:42:07', NULL, '2308201541', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 2, 0, 'sold_items', '2020-08-23 19:42:53', NULL, '2308201643', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a'),
('2222', 'THIAZAMIDE 500MG', '2023-11-23', 120, '0', 0, 2, 'dispensary', '2020-08-23 19:42:53', NULL, '2308201643', 0, '43', NULL, 'SULPHATHIAZOLE 500MG', 0, '6c6af0c0-35ea-40d8-a928-b13a9766113a');

-- --------------------------------------------------------

--
-- Table structure for table `feedbacks`
--

CREATE TABLE `feedbacks` (
  `id` char(36) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
  `userId` varchar(255) DEFAULT NULL,
  `message` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `hospitals`
--

CREATE TABLE `hospitals` (
  `id` varchar(50) NOT NULL,
  `name` varchar(255) DEFAULT NULL,
  `code` varchar(255) DEFAULT NULL,
  `address` varchar(255) DEFAULT NULL,
  `admin` varchar(225) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `logo` varchar(200) DEFAULT NULL,
  `type` varchar(20) DEFAULT NULL,
  `haveStore` int(11) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `hospitals`
--

INSERT INTO `hospitals` (`id`, `name`, `code`, `address`, `admin`, `createdAt`, `updatedAt`, `logo`, `type`, `haveStore`) VALUES
('18ed9422-5a43-4ff6-8e76-1f7af2b8e977', 'Demo Pharmacy', 'DPH', 'No. 3 Sabo Bakin Zuwo Road, Kano', 'demo_pharm', '2020-04-05 18:46:05', '2020-04-05 18:46:05', 'https://res.cloudinary.com/emaitee/image/upload/v1583943949/bits_his_logo.png', 'pharmacy', 0),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Prime Specialist Clinic, Kano', 'PSC', 'No. 4 Lamido Crescent, Nassarawa G.R.A. Kano', 'abdurrahman', '2020-01-06 05:23:50', '2020-01-06 05:23:50', 'https://res.cloudinary.com/emaitee/image/upload/v1583943941/pscprime_logo.png', 'hospital', 0),
('2228e653-9a90-4453-9566-785db75c15c9', 'Bits-HIS Specialist', 'BIT', 'No. 3 Sabo Bakin Zuwo Road Beside Ministry of special Dutie', 'emaitee', '2020-01-06 07:57:39', '2020-01-06 07:57:39', 'https://res.cloudinary.com/emaitee/image/upload/v1583943949/bits_his_logo.png', 'hospital', 0),
('b8823207-58e1-438c-bb62-f3c6c16d8d3d', 'LUDPHA BIO TECH', 'LUD', 'Sadauna Crescent, Kano', 'isahboy01', '2020-03-13 20:00:03', '2020-03-13 20:00:03', 'https://res.cloudinary.com/emaitee/image/upload/v1584268238/ludpha_logo.png', 'pharmacy', 0),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 'My Pharmacy', 'MPH', 'Kano', 'pharm_m', '2020-07-15 09:33:36', '2020-07-15 09:33:36', 'https://res.cloudinary.com/emaitee/image/upload/v1583943949/bits_his_logo.png', 'pharmacy', 0),
('966a89f6-05d8-4564-b319-2f8863821e75', 'Optimum Diagnostics Center', 'ODC', 'Zaria Road, Kano', 'admin', '2020-08-11 11:51:40', '2020-08-11 11:51:40', 'https://res.cloudinary.com/emaitee/image/upload/v1583943949/bits_his_logo.png', 'laboratory', 0),
('1d401e9f-0cb3-494d-98a5-901e0886a5c8', 'Remedix Pharmacy Ltd', '', 'Kano', 'remedix', '2020-08-23 04:56:17', '2020-08-23 04:56:17', 'https://res.cloudinary.com/emaitee/image/upload/v1583943949/bits_his_logo.png', 'pharmacy', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `lab`
--

CREATE TABLE `lab` (
  `test_id` int(10) NOT NULL,
  `date` datetime DEFAULT CURRENT_TIMESTAMP,
  `patient_id` varchar(20) DEFAULT NULL,
  `test` varchar(100) DEFAULT NULL,
  `status` varchar(20) DEFAULT NULL,
  `requested_by` varchar(20) DEFAULT NULL,
  `sample` varchar(100) DEFAULT NULL,
  `result` varchar(50) DEFAULT NULL,
  `appearance` varchar(50) DEFAULT NULL,
  `microscopy` varchar(50) DEFAULT NULL,
  `culture` varchar(50) DEFAULT NULL,
  `antibiotic` varchar(50) DEFAULT NULL,
  `comment` varchar(200) DEFAULT NULL,
  `facilityId` varchar(50) DEFAULT NULL,
  `updated_at` date DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lab`
--

INSERT INTO `lab` (`test_id`, `date`, `patient_id`, `test`, `status`, `requested_by`, `sample`, `result`, `appearance`, `microscopy`, `culture`, `antibiotic`, `comment`, `facilityId`, `updated_at`) VALUES
(1, '2020-01-02 00:00:00', '329-2', 'followUp', 'request', 'x-ray', 'fore-arm', 'positive', 'yeah', 'undefined', 'undefined', 'undefined', '12/12/2012', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(2, '2020-01-02 00:00:00', '329-1', 'x-ray', 'request', 'aminu', 'leg', 'hhhhjj', 'normal', 'nothing spectacular', '', 'safe', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(3, '2020-01-02 00:00:00', '329-2', 'x-ray', 'request', 'aminu', 'leg', 'jjjjjj', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(4, '2020-01-02 00:00:00', '329-2', 'x-ray', 'request', 'aminu', 'leg', 'jjjjjj', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(5, '2020-01-02 00:00:00', '329-1', 'x-ray', 'request', 'aminu', 'leg', 'hhhhjj', 'seem defect', '', 'yeah', 'nothing', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(6, '2020-01-02 00:00:00', '329-1', 'gamma', 'request', 'emaitee', 'leg', 'yyyyyy', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(7, '2020-01-02 00:00:00', '329-1', 'beta', 'request', 'teetee', 'hand', 'hhhhjj', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(8, '2020-01-02 00:00:00', '3333-1', 'red', 'request', 'uack', 'blood', 'hhhhjj', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(9, '2020-01-02 00:00:00', '3291-2', 'y-ray', 'request', 'tech', 'ggg', 'hhhhjj', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(10, '2020-01-02 00:00:00', '329-2', 'x-ray', 'request', 'aminu', 'leg', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(11, '2020-01-02 00:00:00', '3608-1', 'htf', 'request', 'aminu', 'rese', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(12, '2020-01-02 00:00:00', '329-2', 'urine test', 'request', 'aminu', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(13, '2020-01-02 00:00:00', '329-2', 'blood test', 'request', 'aminu', 'blood', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(14, '2020-01-02 00:00:00', '329-2', 'urine test', 'request', 'aminu', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(15, '2020-01-02 00:00:00', '3233-1', 'blood test', 'request', 'aminu', 'blood', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(16, '2020-01-02 00:00:00', '329-2', 'blood test', 'request', 'aminu', 'blood', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(17, '2020-01-02 00:00:00', '329-2', 'x-ray', 'request', 'aminu', 'leg', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(18, '2020-01-02 00:00:00', '329-1', 'urine test', 'request', 'aminu', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(19, '2020-01-02 00:00:00', '329-2', 'urea test', 'request', 'aminu', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(20, '2020-01-02 00:00:00', '3608-1', 'urea', 'request', 'Aisha', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(21, '2020-01-02 00:00:00', '329-2', 'x-ray', 'request', 'Aisha', 'arm', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(22, '2020-01-02 00:00:00', '3608-1', 'urea', 'request', 'Aisha', 'urine', '', '', '', '', '', '', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(23, '2020-01-06 17:24:08', '329-2', 'test', 'request', 'doctor', 'test sample', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(24, '2020-01-06 19:16:11', '3608-1', 'testing microphone', 'request', 'doctor', 'yea yeah', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(25, '2020-01-06 19:24:56', '3608-1', 'yaya yepa', 'request', 'doctor', 'another', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(26, '2020-01-07 07:36:45', '3575-1', 'afsd', 'request', 'doctor', 'asdf', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(27, '2020-01-13 15:17:15', '3588-1', 'pcv', 'request', 'abdurrahman', 'blood', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(28, '2020-01-13 15:17:15', '3588-1', 'u/e/cr', 'request', 'abdurrahman', 'blood', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(29, '2020-02-22 11:47:34', '3584-1', 'L;K\'L', 'request', 'doctor', ';L[\\', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(30, '2020-03-14 14:31:31', '3742-1', 'fbc', 'request', 'abdurrahman', 'blood', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(31, '2020-03-14 14:31:31', '3742-1', 'uecr', 'request', 'abdurrahman', 'blood', NULL, NULL, NULL, NULL, NULL, NULL, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `labservices`
--

CREATE TABLE `labservices` (
  `labhead` varchar(50) DEFAULT NULL,
  `labsubhead` varchar(50) DEFAULT NULL,
  `test` varchar(50) DEFAULT NULL,
  `unit` varchar(50) DEFAULT NULL,
  `value` varchar(50) DEFAULT NULL,
  `test_range` varchar(50) DEFAULT NULL,
  `id` int(20) NOT NULL,
  `facilityId` varchar(50) NOT NULL,
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `labservices`
--

INSERT INTO `labservices` (`labhead`, `labsubhead`, `test`, `unit`, `value`, `test_range`, `id`, `facilityId`, `createdAt`) VALUES
('max', 'add', NULL, 'blue', 'dnffj', '12333', 1, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 05:21:27'),
('maxss', 'add', 'dnffj', 'blue', NULL, '12333', 2, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 05:21:27'),
('max', 'add', 'dnffj', 'blue', NULL, '12333', 3, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 05:21:27'),
('max', 'add', 'dnffj', 'blue', NULL, '12333', 4, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 05:21:27'),
('max', 'add', 'dnffj', 'blue', NULL, '12333', 5, '22', '2020-01-23 12:39:37'),
('ssssddddd', 'weeew', 'uby', 'sd', NULL, '324567', 6, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 13:07:42'),
('prime', 'prime lab', 'emathology', 'mm/g', NULL, '12-20', 7, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 13:13:33'),
('ssssddddd', 'weeew', 'uby', 'eee', NULL, '324567', 8, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 14:15:06'),
('ssssddddd', 'weeew', 'uby', 'sd', NULL, '324567', 9, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-01-23 14:38:04'),
('ssssddddd', 'weeew', 'wertyu', 'eee', NULL, '324567', 10, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-17 10:49:14'),
('ssssddddd', 'weeew', 'uby', 'hjdskjsdjjkds', NULL, '12-20', 11, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-17 11:15:56'),
('prime', 'prime_lab', 'urine_test', '34', NULL, '324567', 12, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-17 17:22:49'),
('prime', 'prime_lab', 'urine_test', '34', NULL, '324567', 13, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-17 17:23:35'),
('ssssddddd', 'ghhjskjdjkd', '', 'sd', NULL, '', 14, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-19 15:43:16'),
('ssssddddd', 'ghhjskjdjkd', '', 'sd', NULL, '', 15, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-19 15:43:38'),
('ssssddddd', 'ghhjskjdjkd', '', 'sd', NULL, '', 16, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-19 15:44:53'),
('ssssddddd', 'ghhjskjdjkd', 'uby', 'sd', NULL, '324567', 17, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-19 15:45:04'),
('fahad', 'ado', 'urine', 'sd', NULL, '12-20', 18, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-26 15:45:07');

-- --------------------------------------------------------

--
-- Table structure for table `lab_numbers`
--

CREATE TABLE `lab_numbers` (
  `id` int(11) NOT NULL,
  `patient_id` varchar(50) NOT NULL,
  `lab_no` varchar(50) NOT NULL,
  `history` varchar(4000) NOT NULL,
  `status` varchar(200) NOT NULL,
  `facilityId` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lab_numbers`
--

INSERT INTO `lab_numbers` (`id`, `patient_id`, `lab_no`, `history`, `status`, `facilityId`) VALUES
(1, '1', '1-8-20-1', 'I want something just like this', '', '966a89f6-05d8-4564-b319-2f8863821e75');

-- --------------------------------------------------------

--
-- Stand-in structure for view `lab_requests`
-- (See below for the actual view)
--
CREATE TABLE `lab_requests` (
`department` varchar(50)
,`patient_id` int(100)
,`status` varchar(200)
);

-- --------------------------------------------------------

--
-- Table structure for table `lab_requisition`
--

CREATE TABLE `lab_requisition` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(100) NOT NULL,
  `booking_no` varchar(100) NOT NULL,
  `patient_id` int(100) NOT NULL,
  `test` varchar(100) NOT NULL,
  `price` int(11) NOT NULL,
  `result` varchar(100) NOT NULL,
  `department` varchar(50) NOT NULL,
  `status` varchar(20) NOT NULL,
  `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` varchar(100) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lab_requisition`
--

INSERT INTO `lab_requisition` (`facilityId`, `id`, `booking_no`, `patient_id`, `test`, `price`, `result`, `department`, `status`, `created_at`, `updated_at`) VALUES
('966a89f6-05d8-4564-b319-2f8863821e75', 1, '1-8-20-1', 1, 'MCH', 100, '', 'hematology', 'pending', '2020-08-24 16:33:48', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 2, '1-8-20-1', 1, 'RBC', 100, '', 'hematology', 'pending', '2020-08-24 16:33:48', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 3, '1-8-20-1', 1, 'ABDOMEN (Bilateral View) X-RAY	5800', 100, '', 'hematology', 'pending', '2020-08-24 16:33:48', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 4, '1-8-20-1', 1, 'MicroScopy (Special)', 400, '', 'microbiology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 5, '1-8-20-1', 1, 'Analysis', 400, '', 'microbiology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 6, '1-8-20-1', 1, 'T3', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 7, '1-8-20-1', 1, 'Testosterone', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 8, '1-8-20-1', 1, 'LH', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 9, '1-8-20-1', 1, 'Progesterone', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 10, '1-8-20-1', 1, 'FSH', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 11, '1-8-20-1', 1, 'Prolactin', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 12, '1-8-20-1', 1, 'Oestrogen', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 13, '1-8-20-1', 1, 'TSH', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', 14, '1-8-20-1', 1, 'T4', 200, '', 'pathology', 'Sample Collected', '2020-08-25 04:44:33', '');

-- --------------------------------------------------------

--
-- Table structure for table `lab_setup`
--

CREATE TABLE `lab_setup` (
  `id` int(100) NOT NULL,
  `subhead` varchar(100) DEFAULT NULL,
  `head` varchar(100) DEFAULT NULL,
  `unit` varchar(100) DEFAULT NULL,
  `range_from` varchar(100) DEFAULT NULL,
  `range_to` varchar(100) DEFAULT NULL,
  `specimen` varchar(100) DEFAULT NULL,
  `price` int(100) DEFAULT NULL,
  `created_at` timestamp NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  `updated_at` varchar(100) DEFAULT NULL,
  `facilityId` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `lab_setup`
--

INSERT INTO `lab_setup` (`id`, `subhead`, `head`, `unit`, `range_from`, `range_to`, `specimen`, `price`, `created_at`, `updated_at`, `facilityId`) VALUES
(2, '', 'Optimum Diagnostics', NULL, NULL, NULL, '', NULL, '2020-08-16 09:30:37', NULL, '966a89f6-05d8-4564-b319-2f8863821e75'),
(3, 'Optimum Diagnostics', 'Hematology', NULL, NULL, NULL, 'Swab', NULL, '2020-08-23 16:00:26', NULL, '966a89f6-05d8-4564-b319-2f8863821e75');

-- --------------------------------------------------------

--
-- Table structure for table `main_account`
--

CREATE TABLE `main_account` (
  `code` varchar(20) NOT NULL,
  `Description` varchar(50) NOT NULL,
  `type` int(11) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `main_account`
--

INSERT INTO `main_account` (`code`, `Description`, `type`) VALUES
('100010', 'Capital Account', 4),
('100020', 'Deposit Account', 4),
('100030', 'Suupliers Account', 4),
('600010', 'cash Account', 3),
('600020', 'Bank Account', 3),
('700010', 'Wages', 1),
('700020', 'Fuel', 1),
('800020', 'Drugs', 2),
('800010', 'Labs', 2);

-- --------------------------------------------------------

--
-- Table structure for table `members`
--

CREATE TABLE `members` (
  `name` varchar(50) NOT NULL,
  `email` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `members`
--

INSERT INTO `members` (`name`, `email`) VALUES
('adi', 'kamal'),
('abbba', 'sanio'),
('kamilu', 'danbata'),
('abba', 'collipad'),
('sarki', 'aliyu'),
('aminu', 'salim'),
('undefined', 'undefined'),
('undefined', 'undefined'),
('undefined', 'undefined'),
('undefined', 'undefined'),
('undefined', 'mubrak@gmail.ocm');

-- --------------------------------------------------------

--
-- Table structure for table `operationnotes`
--

CREATE TABLE `operationnotes` (
  `facilityId` varchar(50) DEFAULT NULL,
  `id` int(11) NOT NULL,
  `date` varchar(20) DEFAULT NULL,
  `patientId` varchar(10) NOT NULL,
  `diagnosis` varchar(150) DEFAULT NULL,
  `surgeons` varchar(300) DEFAULT NULL,
  `surgery` varchar(150) DEFAULT NULL,
  `anesthetist` varchar(80) DEFAULT NULL,
  `anesthetic` varchar(20) DEFAULT NULL,
  `scrubNurse` varchar(30) DEFAULT NULL,
  `remarks` varchar(50) DEFAULT NULL,
  `name` varchar(100) DEFAULT NULL,
  `pintsGiven` varchar(10) DEFAULT NULL,
  `bloodLoss` varchar(15) DEFAULT NULL,
  `intraOpAntibiotics` varchar(20) DEFAULT NULL,
  `intraOpFindings` varchar(2000) DEFAULT NULL,
  `procedureNotes` varchar(2000) DEFAULT NULL,
  `pathologyRequest` varchar(2000) DEFAULT NULL,
  `postOpOrder` varchar(1500) DEFAULT NULL,
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` varchar(50) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Triggers `operationnotes`
--
DELIMITER $$
CREATE TRIGGER `default_date` BEFORE INSERT ON `operationnotes` FOR EACH ROW if ( isnull(new.date) ) then
 set new.date=curdate();
end if
$$
DELIMITER ;
DELIMITER $$
CREATE TRIGGER `set_op_notes_updateAt` BEFORE UPDATE ON `operationnotes` FOR EACH ROW SET NEW.updatedAt = NOW()
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Stand-in structure for view `overview`
-- (See below for the actual view)
--
CREATE TABLE `overview` (
`drug` varchar(20)
,`quantity_bought` int(11)
,`amount_bought` double
,`quantity_in_store` varchar(50)
,`amount_in_store` double
,`quantity_sold` int(11)
,`amount_sold` bigint(22)
,`quantity_in_shelf` bigint(12)
,`amount_in_shelf` bigint(23)
,`sales_date` timestamp
,`purchase_date` datetime
,`facilityId` varchar(50)
);

-- --------------------------------------------------------

--
-- Stand-in structure for view `overview_wo_store`
-- (See below for the actual view)
--
CREATE TABLE `overview_wo_store` (
`drug` varchar(20)
,`quantity_in_shelf` decimal(33,0)
,`amount_in_shelf` decimal(44,0)
,`quantity_sold` decimal(32,0)
,`amount_sold` decimal(43,0)
,`created_at` timestamp
,`facilityId` varchar(50)
);

-- --------------------------------------------------------

--
-- Table structure for table `patientfileinfo`
--

CREATE TABLE `patientfileinfo` (
  `id` int(11) NOT NULL,
  `accountNo` varchar(7) NOT NULL,
  `firstname` varchar(50) NOT NULL,
  `surname` varchar(50) NOT NULL,
  `beneficiaries` int(5) NOT NULL,
  `balance` int(11) NOT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `patientfileno`
--

CREATE TABLE `patientfileno` (
  `facilityId` varchar(50) DEFAULT NULL,
  `accountNo` int(7) NOT NULL,
  `firstname` varchar(50) DEFAULT NULL,
  `surname` varchar(50) DEFAULT NULL,
  `beneficiaries` bigint(21) NOT NULL DEFAULT '0',
  `balance` int(11) NOT NULL DEFAULT '0',
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `patientrecords`
--

CREATE TABLE `patientrecords` (
  `facilityId` varchar(50) DEFAULT NULL,
  `title` varchar(10) DEFAULT NULL,
  `surname` varchar(50) DEFAULT NULL,
  `firstname` varchar(50) DEFAULT NULL,
  `other` varchar(50) DEFAULT NULL,
  `Gender` varchar(10) DEFAULT NULL,
  `age` int(3) DEFAULT '0',
  `maritalstatus` varchar(20) DEFAULT '0',
  `DOB` varchar(20) DEFAULT NULL,
  `dateCreated` datetime DEFAULT CURRENT_TIMESTAMP,
  `phoneNo` varchar(30) DEFAULT '',
  `email` varchar(50) DEFAULT '',
  `state` varchar(50) DEFAULT '',
  `lga` varchar(50) DEFAULT '',
  `occupation` varchar(50) DEFAULT '',
  `address` varchar(500) DEFAULT '',
  `kinName` varchar(100) DEFAULT '',
  `kinRelationship` varchar(20) DEFAULT '',
  `kinPhone` varchar(30) NOT NULL DEFAULT '0',
  `kinEmail` varchar(50) NOT NULL DEFAULT '0',
  `kinAddress` varchar(500) NOT NULL DEFAULT '0',
  `accountNo` int(7) NOT NULL,
  `beneficiaryNo` int(3) NOT NULL,
  `balance` int(11) NOT NULL DEFAULT '0',
  `id` varchar(10) NOT NULL,
  `patient_id` int(11) NOT NULL,
  `enteredBy` varchar(20) DEFAULT NULL,
  `patientStatus` varchar(10) DEFAULT NULL,
  `assigned_to` varchar(20) DEFAULT NULL,
  `createdAt` varchar(20) DEFAULT NULL,
  `date_assigned` datetime DEFAULT NULL,
  `status` varchar(50) NOT NULL DEFAULT 'registered',
  `hematology` varchar(20) NOT NULL,
  `microbiology` varchar(20) NOT NULL,
  `chem_path` varchar(20) NOT NULL,
  `radiology` varchar(20) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `patientrecords`
--

INSERT INTO `patientrecords` (`facilityId`, `title`, `surname`, `firstname`, `other`, `Gender`, `age`, `maritalstatus`, `DOB`, `dateCreated`, `phoneNo`, `email`, `state`, `lga`, `occupation`, `address`, `kinName`, `kinRelationship`, `kinPhone`, `kinEmail`, `kinAddress`, `accountNo`, `beneficiaryNo`, `balance`, `id`, `patient_id`, `enteredBy`, `patientStatus`, `assigned_to`, `createdAt`, `date_assigned`, `status`, `hematology`, `microbiology`, `chem_path`, `radiology`) VALUES
('966a89f6-05d8-4564-b319-2f8863821e75', NULL, 'Issa', 'Mustapha', '', 'Male', 0, '0', '1987-08-24', '2020-08-24 16:33:48', '+234906424096', 'issatoyin@gmail.com', '', '', '', '', '', '', '0', '0', '0', 1, 1, 0, '', 1, NULL, NULL, NULL, NULL, NULL, 'registered', '', '', '', '');

-- --------------------------------------------------------

--
-- Table structure for table `prescriptionrequests`
--

CREATE TABLE `prescriptionrequests` (
  `facilityId` varchar(50) NOT NULL,
  `date` date DEFAULT NULL,
  `patient_id` varchar(11) NOT NULL,
  `dosage` varchar(10) NOT NULL,
  `drug_status` varchar(10) NOT NULL,
  `seen_by` varchar(20) NOT NULL,
  `duration` varchar(10) NOT NULL,
  `period` varchar(5) NOT NULL,
  `drug` varchar(15) NOT NULL,
  `frequency` int(5) NOT NULL,
  `drug_request_id` int(30) NOT NULL,
  `price` int(10) NOT NULL,
  `quantity_dispensed` int(10) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `prescriptionrequests`
--

INSERT INTO `prescriptionrequests` (`facilityId`, `date`, `patient_id`, `dosage`, `drug_status`, `seen_by`, `duration`, `period`, `drug`, `frequency`, `drug_request_id`, `price`, `quantity_dispensed`) VALUES
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-18', '5197', '3', 'pending', 'aminu', '2', 'day', 'Boska', 11, 55, 120, 2),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-18', '5197', '3', 'pending', 'aminu', '56', 'week', 'panadol', 12, 56, 300, 3),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-18', '5197', '3', 'pending', 'aminu', '57', 'hour', 'Ibucap', 1, 57, 100, 4),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-18', '5197', '3', 'pending', 'aminu', '58', 'week', 'Quatem', 1, 58, 1300, 5),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-18', '5197', '3', 'pending', 'aminu', '59', 'day', 'paracetamol', 3, 59, 20, 6),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-25', '5202', '3', 'pending', 'aminu', '1', 'day', 'paracetamol', 2, 60, 20, 10),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-11-25', '5202', '3', 'pending', 'aminu', '2', 'week', 'Boska', 12, 61, 120, 20),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-12-15', '5231', '12', 'pending', 'Aisha', '1', 'hour', 'paracetamol', 2, 62, 20, 0),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-12-15', '5231', '4', 'pending', 'Aisha', '4', 'hour', 'amatem', 4, 64, 120, 0),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2018-12-27', '5193', '3', 'pending', 'Aisha', '1', 'hour', 'panadol', 2, 65, 300, 0);

-- --------------------------------------------------------

--
-- Table structure for table `referrals`
--

CREATE TABLE `referrals` (
  `id` char(36) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
  `referee` varchar(255) DEFAULT NULL,
  `refereeContact` varchar(255) DEFAULT NULL,
  `referer` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `referrals`
--

INSERT INTO `referrals` (`id`, `referee`, `refereeContact`, `referer`, `createdAt`, `updatedAt`) VALUES
('082e4afa-9f99-4175-a8a1-9dfdb1cf5ac7', '', 'issatoyin@gmail.com', '34', '2020-05-16 18:34:17', '2020-05-16 18:34:17');

-- --------------------------------------------------------

--
-- Table structure for table `repairlogs`
--

CREATE TABLE `repairlogs` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(11) NOT NULL,
  `date` varchar(255) DEFAULT NULL,
  `time` varchar(255) DEFAULT NULL,
  `repaired_by` varchar(255) DEFAULT NULL,
  `nature` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `repairlogs`
--

INSERT INTO `repairlogs` (`facilityId`, `id`, `date`, `time`, `repaired_by`, `nature`, `createdAt`, `updatedAt`) VALUES
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 1, '2019-12-24', '12:34', 'Aminu', 'reservice', '2019-12-24 15:38:11', NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 2, '2019-12-24', '23:12', 'ggggg', 'nljnkm', '2019-12-24 22:43:52', NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 3, '2019-12-25', '10:12', 'fahad', 'out of oil', '2019-12-25 09:48:13', NULL),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 4, '2019-12-25', '17:12', 'glo', 'illness', '2019-12-25 16:11:46', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `servicelogs`
--

CREATE TABLE `servicelogs` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(11) NOT NULL,
  `date` varchar(255) DEFAULT NULL,
  `next_service_due_date` varchar(255) DEFAULT NULL,
  `createdAt` datetime DEFAULT CURRENT_TIMESTAMP,
  `updatedAt` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `servicelogs`
--

INSERT INTO `servicelogs` (`facilityId`, `id`, `date`, `next_service_due_date`, `createdAt`, `updatedAt`) VALUES
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 1, NULL, '2019-12-30', '2019-12-24 00:00:00', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `services`
--

CREATE TABLE `services` (
  `facilityId` varchar(50) NOT NULL,
  `title` varchar(225) DEFAULT NULL,
  `description` varchar(225) DEFAULT NULL,
  `accHead` varchar(50) NOT NULL,
  `cost` varchar(7) DEFAULT '0',
  `service_id` int(11) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `services`
--

INSERT INTO `services` (`facilityId`, `title`, `description`, `accHead`, `cost`, `service_id`, `createdAt`) VALUES
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Staff Medical Bill', 'Companies', 'Income', '0', 23, '2019-12-21 19:39:03'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultations (Ortho, Neurosurgeon)', '', 'Income', '7000', 2, '2019-12-19 16:21:39'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Enema', '', 'Income', '5000', 3, '2019-12-19 16:23:10'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Surgery', '', 'Income', '0', 4, '2019-12-19 16:36:55'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Regular)', '', 'Income', '3000', 6, '2019-12-20 09:58:14'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Registration (Single)', '', 'Income', '5000', 7, '2019-12-20 09:58:45'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Registration (Family)', '', 'Income', '7000', 8, '2019-12-20 09:59:09'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Neurology)', '', 'Income', '8000', 9, '2019-12-20 09:59:49'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Specialist) F/Up', '', 'Income', '6000', 10, '2019-12-20 10:00:41'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Ortho, Neurosurgeon) F/Up', '', 'Income', '4000', 11, '2019-12-20 10:31:32'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (ENT)', '', 'Income', '8000', 12, '2019-12-20 10:35:19'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Nephrology)', '', 'Income', '8000', 13, '2019-12-20 10:35:57'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Psycharist)', '', 'Income', '8000', 14, '2019-12-20 10:36:39'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Paediatrics)', '', 'Income', '6000', 15, '2019-12-20 10:37:07'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Cardiology)', '', 'Income', '8000', 16, '2019-12-20 10:37:53'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Medication', 'Dispensed drugs, injection s and treatment', 'Income', '0', 24, '2019-12-22 10:08:36'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Wound Dressing (Minor)', '', 'Income', '1000', 19, '2019-12-20 10:39:05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Wound Dressing (Major)', '', 'Income', '2000', 20, '2019-12-20 10:39:05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'ECG', '', 'Income', '4000', 21, '2019-12-20 10:39:05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'General Ward', '', 'Income', '7000', 25, '2019-12-22 11:15:36'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'House (White, Blue, Green)', '', 'Income', '19000', 26, '2019-12-22 11:16:59'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'PSC (0,1,2,3)', '', 'Income', '17000', 27, '2019-12-22 11:17:25'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Private (1, 2, Yellow)', '', 'Income', '12000', 28, '2019-12-22 11:17:57'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Professional Management', 'In-patient consultations', 'Income', '4000', 29, '2019-12-22 11:27:22'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Investigation', '', 'Income', '0', 30, '2019-12-22 11:50:36'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Urology)', 'Payment before cosultation', 'Income', '8000', 31, '2019-12-22 19:17:33'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Consultation (Orthopedic)', 'Regular Orthopedic Consultation', 'Income', '7000', 32, '2019-12-23 11:52:27'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Orthopedic Registration (Family)', '', 'Income', '9000', 33, '2019-12-24 12:08:12'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Ear syringing', '', 'Income', '7000', 34, '2019-12-25 16:53:20'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Registration /Specialist Consultation (Family)', '', 'Income', '10000', 35, '2019-12-25 17:04:08'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'conversion of file', '', 'Income', '2000', 36, '2019-12-25 17:10:01'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Orthopedic Registration', '', 'Income', '7000', 37, '2019-12-25 17:13:16'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Uncology (Registration/Consultation)', '', 'Income', '8000', 38, '2019-12-26 14:00:06'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Laboratory (RBS)', '', 'Income', '500', 39, '2019-12-26 14:04:08'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Lab', '', 'Income', '0', 40, '2019-12-26 14:04:35'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Neurosurgeon (Registration)', '', 'Income', '7000', 42, '2019-12-27 14:35:36'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Urologist Registration', '', 'Income', '8000', 43, '2019-12-27 15:41:18'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Theatre fee', '', 'Income', '0', 44, '2019-12-29 13:45:01'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Implants', 'Screws and Rod', 'Income', '0', 45, '2019-12-29 13:48:29'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Nebulizer', '', 'Income', '0', 46, '2019-12-31 08:26:37'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Hospitalization Deposit', '', 'Income', '0', 47, '2020-01-01 19:16:05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Orthopaedic F/up', 'Wages', 'Income', '4000', 48, '2020-01-02 18:47:42'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Admission', '', 'Income', '0', 49, '2020-01-03 17:29:05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 'Specialist', 'First visit', 'Income', '8000', 50, '2020-01-04 19:10:25'),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 'Wound Dressing', '', 'Consultation', '2050', 53, '2020-07-15 21:56:59'),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 'Admission', '', 'Consultation', '3000', 54, '2020-07-15 21:57:17'),
('966a89f6-05d8-4564-b319-2f8863821e75', 'Admission', '', 'Other Income', '1000', 55, '2020-08-16 09:33:44');

-- --------------------------------------------------------

--
-- Table structure for table `staff`
--

CREATE TABLE `staff` (
  `id` int(11) NOT NULL,
  `Names` varchar(50) NOT NULL,
  `Address` varchar(100) NOT NULL,
  `role` varchar(100) NOT NULL,
  `Phone` varchar(30) NOT NULL,
  `code` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `suppliersinfo`
--

CREATE TABLE `suppliersinfo` (
  `facilityId` varchar(50) NOT NULL,
  `id` int(11) NOT NULL,
  `supplier_name` varchar(100) DEFAULT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `address` varchar(250) DEFAULT NULL,
  `phone` varchar(30) DEFAULT NULL,
  `code` varchar(10) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `suppliersinfo`
--

INSERT INTO `suppliersinfo` (`facilityId`, `id`, `supplier_name`, `date`, `address`, `phone`, `code`) VALUES
('18ed9422-5a43-4ff6-8e76-1f7af2b8e977', 19, 'AJM 123 Pharmacy', '2020-04-05 18:50:40', 'Lamido Crescent', '07038349783', '01'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 13, 'Worldwide Comm Venture Ltd (Galvus Met)', '2020-01-20 19:44:37', 'Matori Lagos', '08117995324', '06'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 12, 'Wellcare Pharmacy', '2020-01-20 19:43:57', 'M/M way', '0803333000000', '05'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 8, 'Abdulmaleek Medicine Store', '2020-01-20 17:31:45', 'D- line S/ Gari Kano', '08039510740', '01'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 9, 'AJM 123 Pharmacy', '2020-01-20 17:33:44', 'Lamido Crescent', '07038349783', '02'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 10, 'Lamco', '2020-01-20 17:34:17', 'AKTH EXIT GATE', '080222000000', '03'),
('1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', 11, 'Madachi Phamacy co', '2020-01-20 19:43:19', 'Bata House', '08133361456', '04'),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 25, 'AJM', '2020-08-20 08:42:40', 'Lamido Crescent, Kano', '08037047271', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 26, 'Salim Stores', '2020-08-20 18:07:37', 'No 1 Balarabe Musa Street,Victoria Island', '0930343445', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', 27, 'Samson', '2020-08-21 06:54:14', 'Whatsapp', '08034653480', ''),
('1d401e9f-0cb3-494d-98a5-901e0886a5c8', 28, 'AJM', '2020-08-23 04:58:14', 'Lamido Crescent', '08037047271', '');

--
-- Triggers `suppliersinfo`
--
DELIMITER $$
CREATE TRIGGER `after_edit` AFTER UPDATE ON `suppliersinfo` FOR EACH ROW BEGIN
    IF OLD.supplier_name <> new.supplier_name THEN
        INSERT INTO audit_trail(id,facilityId,	supplier_name,	date,	address,	phone,	code)
        VALUES(old.id, old.facilityId, old.supplier_name,old.date,old.address,old.phone,old.code);
    END IF;
END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `test`
--

CREATE TABLE `test` (
  `id` int(11) NOT NULL,
  `description` varchar(50) NOT NULL,
  `debit` varchar(50) NOT NULL,
  `amount` int(11) NOT NULL,
  `credit` varchar(50) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `transactions`
--

CREATE TABLE `transactions` (
  `facilityId` varchar(50) DEFAULT NULL,
  `createdAt` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `transaction_id` int(11) NOT NULL,
  `id` int(11) NOT NULL,
  `description` varchar(225) DEFAULT NULL,
  `acct` varchar(100) DEFAULT NULL,
  `debit` int(50) DEFAULT NULL,
  `credit` int(50) DEFAULT NULL,
  `enteredBy` varchar(20) DEFAULT NULL,
  `receiptDateSN` varchar(18) NOT NULL DEFAULT '0',
  `receiptNo` int(7) DEFAULT '0',
  `modeOfPayment` varchar(15) DEFAULT NULL,
  `status` varchar(10) DEFAULT 'pending',
  `approvedBy` varchar(20) DEFAULT NULL,
  `paymentStatus` varchar(11) NOT NULL DEFAULT '',
  `client_acct` varchar(11) DEFAULT NULL,
  `patient_id` varchar(50) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `transactions`
--

INSERT INTO `transactions` (`facilityId`, `createdAt`, `transaction_id`, `id`, `description`, `acct`, `debit`, `credit`, `enteredBy`, `receiptDateSN`, `receiptNo`, `modeOfPayment`, `status`, `approvedBy`, `paymentStatus`, `client_acct`, `patient_id`) VALUES
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 1, 0, 'ANGIZAAR 50MG', 'Drug Purchases', 0, 20000, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 2, 0, 'ANGIZAAR 50MG', 'Cash', 20000, 0, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 3, 0, 'THIAZAMIDE 500MG', 'Drug Purchases', 0, 20000, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 4, 0, 'THIAZAMIDE 500MG', 'Cash', 20000, 0, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 5, 0, 'DANACID', 'Drug Purchases', 0, 18000, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:13:25', 6, 0, 'DANACID', 'Cash', 18000, 0, '40', '23082011', 1, 'Cash', 'pending', NULL, '', NULL, ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:25:57', 7, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 360, '43', '23082027', 2, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 18:25:57', 8, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 360, 0, '43', '23082027', 2, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:02:03', 9, 0, 'DANACID', 'Cash', 0, 320, '43', '23082039', 3, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:02:03', 10, 0, 'ANGIZAAR 50MG', 'Cash', 0, 220, '43', '23082039', 3, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:02:03', 11, 0, 'DANACID', 'Drug Sales', 320, 0, '43', '23082039', 3, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:02:03', 12, 0, 'ANGIZAAR 50MG', 'Drug Sales', 220, 0, '43', '23082039', 3, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:00', 13, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '230820413', 4, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:00', 14, 0, 'ANGIZAAR 50MG', 'Cash', 0, 220, '43', '230820413', 4, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:00', 15, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '230820413', 4, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:00', 16, 0, 'ANGIZAAR 50MG', 'Drug Sales', 220, 0, '43', '230820413', 4, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:26', 17, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '230820517', 5, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:26', 18, 0, 'ANGIZAAR 50MG', 'Cash', 0, 2640, '43', '230820517', 5, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:26', 19, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '230820517', 5, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:05:26', 20, 0, 'ANGIZAAR 50MG', 'Drug Sales', 2640, 0, '43', '230820517', 5, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:23:02', 21, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '230820621', 6, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:23:02', 22, 0, 'DANACID', 'Cash', 0, 320, '43', '230820621', 6, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:23:02', 23, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '230820621', 6, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:23:02', 24, 0, 'DANACID', 'Drug Sales', 320, 0, '43', '230820621', 6, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:33:54', 25, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '230820725', 7, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:33:54', 26, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '230820725', 7, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:35:01', 27, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 1200, '43', '230820827', 8, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:35:01', 28, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 1200, 0, '43', '230820827', 8, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:36:10', 29, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '230820929', 9, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:36:10', 30, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '230820929', 9, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:36:44', 31, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201031', 10, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:36:44', 32, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201031', 10, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:37:05', 33, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201133', 11, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:37:05', 34, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201133', 11, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:37:45', 35, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201235', 12, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:37:45', 36, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201235', 12, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:38:18', 37, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201337', 13, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:38:18', 38, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201337', 13, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:39:18', 39, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201439', 14, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:39:18', 40, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201439', 14, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:42:07', 41, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 120, '43', '2308201541', 15, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:42:07', 42, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 120, 0, '43', '2308201541', 15, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:42:53', 43, 0, 'THIAZAMIDE 500MG', 'Cash', 0, 240, '43', '2308201643', 16, 'cash', 'pending', NULL, '', '', ''),
('6c6af0c0-35ea-40d8-a928-b13a9766113a', '2020-08-23 19:42:53', 44, 0, 'THIAZAMIDE 500MG', 'Drug Sales', 240, 0, '43', '2308201643', 16, 'cash', 'pending', NULL, '', '', ''),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:25:29', 45, 0, 'New Lab Request', 'Registration & Testing fees', 0, 800, '41', '24082011', 1, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:25:29', 46, 0, 'New Lab Request', 'Cash', 800, 0, '41', '24082011', 1, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:27:45', 47, 0, 'New Lab Request', 'Registration & Testing fees', 0, 3700, '41', '240820247', 2, '', 'pending', NULL, '', '2', '2'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:27:45', 48, 0, 'New Lab Request', 'Cash', 3700, 0, '41', '240820247', 2, '', 'pending', NULL, '', '2', '2'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:42:11', 49, 0, 'New Lab Request', 'Registration & Testing fees', 0, 1900, '41', '240820349', 3, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 14:42:11', 50, 0, 'New Lab Request', 'Cash', 1900, 0, '41', '240820349', 3, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:09:23', 51, 0, 'New Lab Request', 'Registration & Testing fees', 0, 800, '41', '240820451', 4, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:09:23', 52, 0, 'New Lab Request', 'Cash', 800, 0, '41', '240820451', 4, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:10:41', 53, 0, 'New Lab Request', 'Registration & Testing fees', 0, 4700, '41', '240820553', 5, '', 'pending', NULL, '', '2', '2'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:10:41', 54, 0, 'New Lab Request', 'Cash', 4700, 0, '41', '240820553', 5, '', 'pending', NULL, '', '2', '2'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:33:49', 55, 0, 'New Lab Request', 'Registration & Testing fees', 0, 2900, '41', '240820655', 6, '', 'pending', NULL, '', '1', '1'),
('966a89f6-05d8-4564-b319-2f8863821e75', '2020-08-24 16:33:49', 56, 0, 'New Lab Request', 'Cash', 2900, 0, '41', '240820655', 6, '', 'pending', NULL, '', '1', '1');

--
-- Triggers `transactions`
--
DELIMITER $$
CREATE TRIGGER `set_txn_date` BEFORE INSERT ON `transactions` FOR EACH ROW BEGIN
    		IF (isnull(new.createdAt)) THEN
    			SET NEW.createdAt=CURDATE();
            END IF;
        END
$$
DELIMITER ;

-- --------------------------------------------------------

--
-- Table structure for table `transactionsetup`
--

CREATE TABLE `transactionsetup` (
  `id` int(11) NOT NULL,
  `title` varchar(50) NOT NULL,
  `debit` varchar(50) NOT NULL,
  `credit` varchar(50) NOT NULL,
  `facilityId` varchar(50) NOT NULL,
  `createdBy` varchar(50) NOT NULL,
  `createdAt` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `transactionsetup`
--

INSERT INTO `transactionsetup` (`id`, `title`, `debit`, `credit`, `facilityId`, `createdBy`, `createdAt`) VALUES
(1, 'Admin Expenses', 'Revenue', 'Expenditure', '966a89f6-05d8-4564-b319-2f8863821e75', '41', '2020-08-11 12:36:41'),
(2, 'Drug Sales', 'Expenditure', 'Revenue', '966a89f6-05d8-4564-b319-2f8863821e75', '41', '2020-08-11 12:49:39'),
(3, '10 Bedrooms Duplex', 'Medical and Hospitalization Bill', 'Prime Clinic', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '1', '2020-08-11 20:56:51'),
(4, 'Payment from deposit', 'Trade Payable', 'Revenue', '966a89f6-05d8-4564-b319-2f8863821e75', 'undefined', '2020-08-15 11:28:25'),
(5, 'VATable Transaction', 'Trade Receivable', 'Expenditure', '966a89f6-05d8-4564-b319-2f8863821e75', 'undefined', '2020-08-15 12:49:01'),
(6, 'VATable Transaction', 'Trade Payable', 'Revenue', '966a89f6-05d8-4564-b319-2f8863821e75', 'undefined', '2020-08-15 12:49:01'),
(7, 'Instant Payment (POS/Bank Transfer)', 'Microbiology', 'Revenue', '966a89f6-05d8-4564-b319-2f8863821e75', 'undefined', '2020-08-15 12:50:25'),
(8, 'Payment from somewhere else', 'Hematology', 'Trade Payable', '966a89f6-05d8-4564-b319-2f8863821e75', '41', '2020-08-15 13:03:14'),
(9, '', 'Revenue', 'Cash', '6c6af0c0-35ea-40d8-a928-b13a9766113a', '40', '2020-08-17 08:13:26');

-- --------------------------------------------------------

--
-- Stand-in structure for view `transaction_view`
-- (See below for the actual view)
--
CREATE TABLE `transaction_view` (
`facilityId` varchar(50)
,`createdAt` datetime
,`acct` varchar(100)
,`debit` int(50)
,`description` varchar(225)
,`patient_id` varchar(50)
);

-- --------------------------------------------------------

--
-- Stand-in structure for view `transaction_view2`
-- (See below for the actual view)
--
CREATE TABLE `transaction_view2` (
`date` timestamp
,`drug` varchar(20)
,`quantity` int(11)
,`price` int(10)
,`profit` bigint(21)
,`amount` bigint(22)
,`facilityId` varchar(50)
);

-- --------------------------------------------------------

--
-- Table structure for table `transfers`
--

CREATE TABLE `transfers` (
  `id` int(11) NOT NULL,
  `facilityId` varchar(50) DEFAULT NULL,
  `date` datetime NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `amountReceived` int(12) NOT NULL DEFAULT '0',
  `amountHandedOver` int(12) DEFAULT '0',
  `transfer_from` varchar(50) NOT NULL,
  `transfer_to` varchar(50) NOT NULL,
  `status` varchar(10) NOT NULL DEFAULT 'pending',
  `comment` varchar(500) DEFAULT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

--
-- Dumping data for table `transfers`
--

INSERT INTO `transfers` (`id`, `facilityId`, `date`, `amountReceived`, `amountHandedOver`, `transfer_from`, `transfer_to`, `status`, `comment`) VALUES
(1, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-03 08:49:08', 0, 4000, 'Manager', 'Kemi', 'pending', '02-02-2020 / cash in'),
(2, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-05 09:54:39', 0, 129200, 'Patience', 'Manager', 'pending', 'Yesterday\'s day cash'),
(3, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-05 09:55:57', 0, 75200, 'Manager', 'Patience', 'pending', 'Today cash'),
(4, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-02-16 09:38:19', 0, 62000, 'Kemi', 'Manager', 'pending', '15-02 CASH IN'),
(5, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-03-14 14:50:51', 0, 50000, 'Manager', 'Kemi', 'pending', 'test'),
(6, '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', '2020-03-14 14:51:20', 0, 30000, 'Manager', 'abdurrahman', 'pending', 'netest'),
(7, 'b8823207-58e1-438c-bb62-f3c6c16d8d3d', '2020-03-19 14:51:59', 0, 1, 'isahboy01', 'isahboy01', 'pending', '');

-- --------------------------------------------------------

--
-- Table structure for table `users`
--

CREATE TABLE `users` (
  `id` int(11) NOT NULL,
  `firstname` varchar(255) DEFAULT NULL,
  `lastname` varchar(255) DEFAULT NULL,
  `privilege` int(11) DEFAULT '4',
  `role` varchar(255) DEFAULT NULL,
  `speciality` varchar(50) DEFAULT NULL,
  `accessTo` varchar(255) DEFAULT NULL,
  `username` varchar(255) DEFAULT NULL,
  `email` varchar(255) DEFAULT NULL,
  `prefix` varchar(5) DEFAULT NULL,
  `userType` varchar(10) DEFAULT NULL,
  `serviceCost` varchar(10) DEFAULT NULL,
  `licenceNo` varchar(50) DEFAULT NULL,
  `password` varchar(255) DEFAULT NULL,
  `status` varchar(20) DEFAULT 'pending',
  `loggedIn` varchar(200) DEFAULT NULL,
  `availableDays` varchar(200) DEFAULT NULL,
  `availableFromTime` varchar(20) DEFAULT NULL,
  `availableToTime` varchar(20) DEFAULT NULL,
  `address` varchar(200) DEFAULT NULL,
  `phone` varchar(50) DEFAULT NULL,
  `referralId` varchar(50) DEFAULT NULL,
  `lastLogin` varchar(20) DEFAULT NULL,
  `image` varchar(255) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL,
  `facilityId` varchar(50) NOT NULL,
  `createdBy` varchar(50) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

--
-- Dumping data for table `users`
--

INSERT INTO `users` (`id`, `firstname`, `lastname`, `privilege`, `role`, `speciality`, `accessTo`, `username`, `email`, `prefix`, `userType`, `serviceCost`, `licenceNo`, `password`, `status`, `loggedIn`, `availableDays`, `availableFromTime`, `availableToTime`, `address`, `phone`, `referralId`, `lastLogin`, `image`, `createdAt`, `updatedAt`, `facilityId`, `createdBy`) VALUES
(1, 'Adewale', 'Muritala', 8, 'Developer', 'Neurosurgery', 'Records,Doctors,Account,Pharmacy,Lab,Admin,Operation,Theater,Maintenance,Reports', 'emaitee', 'adewale@gmail.com', 'MST', 'admin', NULL, NULL, '$2a$10$mPqL/ehjm7v5UIy0pG9FFeWa1vfzfWo05.KyYHn/L3hmjoF8yM0vS', 'approved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2019-10-11 19:08:28', '2019-10-11 19:08:28', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(2, 'Adewale', 'Muritala', 8, 'Developer', 'Neurosurgery', 'Records,Doctors,Account,Pharmacy,Lab,Admin,Operation,Theater,Maintenance,Nurse', 'sammie', 'adewale@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$9PVSwNYnpnc0I9MGzV5VeeLqqrM1oNH9B/uvqc9F28/0msIUIH9MW', 'approved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'null', '2019-12-02 18:05:19', '2019-12-02 18:05:19', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(3, 'Adewale', 'Muritala', 4, 'Developer', 'Neurosurgery', 'Records,Doctors,Account,Pharmacy,Lab,Admin,Operation,Theater,Maintenance,Nurse', 'isahboy', 'adewale@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$c4ST/4CkMe0/emlRNcelmuJiQH1ExriJJ1P0lZvqjpxTRbDpyn2tC', 'approved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2019-12-02 18:40:13', '2019-12-02 18:40:13', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(14, 'Adewale', 'Muritala', 4, 'Developer', 'Neurosurgery', 'Records,Account,Pharmacy,Lab,Admin,Doctors,Theater,Maintenance', '8790fahad', 'adewale@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$jDIOqVdkgccu2rBLtZ1Uw.2luU/5ZovyApZTbZiHjZgrswMPUaDFy', 'approved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2019-12-09 16:11:49', '2019-12-09 16:11:49', '1be0a9da-bff9-4ab6-a36c-edfd8ca88f1a', NULL),
(29, 'Adewale', 'Muritala', 4, 'Admin', 'Neurosurgery', 'Pharmacy,Account,Admin', 'isahboy01', 'adewale@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$jAnsQNTfzUqqXXZvCBxRceHPYhNj6GID/5GrHD5w5vmrU8n3U5zcW', 'approved', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, '2020-03-13 20:00:05', '2020-03-13 20:00:05', 'b8823207-58e1-438c-bb62-f3c6c16d8d3d', NULL),
(35, 'Adewale2', 'Muritala2', 4, 'Doctor', 'Neurosurgery2', 'Doctors', 'wasiu', 'adewale@gmail.com', 'WAS', 'admin', '4000', '0993774774', '$2a$10$53oc7NfNr.m/O.zaLSzceuECbT5tbxTczEnyiO3/tgQQncnsICiVO', 'approved ', NULL, 'Monday,Tuesday,Wedne', '08:00', '21:00', 'Maiduguri', '07062942291', 'ckaz8jcx10000ucvd4dk1hm4o', NULL, '', '2020-05-15 05:00:48', '2020-06-23 09:25:22', 'doctors', NULL),
(40, 'My', 'User', 4, 'Admin', NULL, 'Admin,Pharmacy,Account', 'pharm_m', 'email@whats.com', NULL, NULL, NULL, NULL, '$2a$10$piWegS40cO/lwWsyXAm6Iel8fcCF7EGCy2M2jIP02F3l3VQp2PHmm', 'approved ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://res.cloudinary.com/emaitee/image/upload/v1593618169/mylikita/profile_images/docAvater.png', '2020-07-15 09:33:37', '2020-08-05 06:02:58', '6c6af0c0-35ea-40d8-a928-b13a9766113a', NULL),
(41, 'Samson', 'Pius', 4, 'Receptionist', '', 'Lab,Account,Admin', 'admin', 'sam@pharm.com', NULL, NULL, NULL, NULL, '$2a$10$qBGwRQSnwhQXrF5a95Mf5.xRLt6TnRjb6kOpLf2a7g6OTe2hmA0Hq', 'approved ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://res.cloudinary.com/emaitee/image/upload/v1593618169/mylikita/profile_images/docAvater.png', '2020-07-15 09:45:00', '2020-08-05 06:03:01', '966a89f6-05d8-4564-b319-2f8863821e75', NULL),
(43, 'Mustapha', 'Issa', 4, '', '', 'Account,Accounts(Admin),Pharmacy,Admin,Reports', 'muritala1', 'issatoyin@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$EKqf/m.N67vcwYMLLEQTueCDsovuW1Y4zaR09K1rgUqFYyL2i61kq', 'approved ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://res.cloudinary.com/emaitee/image/upload/v1593618169/mylikita/profile_images/docAvater.png', '2020-08-20 08:52:20', '2020-08-20 08:52:40', '6c6af0c0-35ea-40d8-a928-b13a9766113a', NULL),
(45, 'Lukman', 'Me', 4, 'Admin', NULL, 'Admin,Pharmacy,Reports,Account', 'remedix', 'issatoyin@gmail.com', NULL, NULL, NULL, NULL, '$2a$10$ltD0hfEjdSueMhFsXDUUuu2YtiNdy9faSi3tRHR7O0cAtH/uE/DPe', 'approved ', NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, 'https://res.cloudinary.com/emaitee/image/upload/v1598164009/mylikita/profile_images/WIN_20200302_16_52_40_Pro.jpg.png', '2020-08-23 04:56:18', '2020-08-23 06:26:49', '1d401e9f-0cb3-494d-98a5-901e0886a5c8', NULL);

-- --------------------------------------------------------

--
-- Table structure for table `voucher`
--

CREATE TABLE `voucher` (
  `vo_No` int(11) NOT NULL,
  `debit` varchar(40) NOT NULL,
  `Amount` int(11) NOT NULL,
  `credit` varchar(40) NOT NULL,
  `description` varchar(50) NOT NULL,
  `authorizedby` varchar(40) NOT NULL,
  `approveBy` varchar(40) NOT NULL,
  `PatientAcct` varchar(20) NOT NULL
) ENGINE=MyISAM DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Table structure for table `wholesale_transaction`
--

CREATE TABLE `wholesale_transaction` (
  `id` char(36) CHARACTER SET latin1 COLLATE latin1_bin NOT NULL,
  `date` varchar(100) NOT NULL,
  `time` varchar(50) DEFAULT NULL,
  `name` varchar(50) DEFAULT NULL,
  `phone_no` varchar(50) DEFAULT NULL,
  `unit` int(11) DEFAULT NULL,
  `amount` varchar(50) NOT NULL,
  `type` varchar(20) NOT NULL,
  `giver` varchar(100) DEFAULT NULL,
  `reciever` varchar(100) DEFAULT NULL,
  `description` varchar(100) DEFAULT NULL,
  `createdAt` datetime NOT NULL,
  `updatedAt` datetime NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=latin1;

-- --------------------------------------------------------

--
-- Structure for view `lab_requests`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `lab_requests`  AS  select `a`.`department` AS `department`,`a`.`patient_id` AS `patient_id`,`b`.`status` AS `status` from (`lab_requisition` `a` join `lab_numbers` `b` on((`a`.`patient_id` = `b`.`patient_id`))) ;

-- --------------------------------------------------------

--
-- Structure for view `overview`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `overview`  AS  select `a`.`drug` AS `drug`,`b`.`quantity` AS `quantity_bought`,(`b`.`quantity` * `b`.`cost_price`) AS `amount_bought`,`b`.`balance` AS `quantity_in_store`,(`b`.`balance` * `b`.`cost_price`) AS `amount_in_store`,`a`.`qty_out` AS `quantity_sold`,((`a`.`price` + `a`.`markup`) * `a`.`qty_out`) AS `amount_sold`,(`b`.`dispensary_balance` - `a`.`qty_out`) AS `quantity_in_shelf`,((`b`.`dispensary_balance` - `a`.`qty_out`) * (`a`.`price` + `a`.`markup`)) AS `amount_in_shelf`,`a`.`created_at` AS `sales_date`,`b`.`created_at` AS `purchase_date`,`a`.`facilityId` AS `facilityId` from (`drugs` `a` join `drugpurchaserecords` `b` on((`a`.`drug_code` = `b`.`drug_code`))) where ((`a`.`source` = 'dispensary') and (`a`.`qty_out` <> 0)) ;

-- --------------------------------------------------------

--
-- Structure for view `overview_wo_store`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `overview_wo_store`  AS  select `drugs`.`drug` AS `drug`,sum((`drugs`.`qty_in` - `drugs`.`qty_out`)) AS `quantity_in_shelf`,(sum((`drugs`.`qty_in` - `drugs`.`qty_out`)) * (`drugs`.`price` + `drugs`.`markup`)) AS `amount_in_shelf`,sum(`drugs`.`qty_out`) AS `quantity_sold`,(sum(`drugs`.`qty_out`) * (`drugs`.`price` + `drugs`.`markup`)) AS `amount_sold`,`drugs`.`created_at` AS `created_at`,`drugs`.`facilityId` AS `facilityId` from `drugs` where (`drugs`.`source` = 'dispensary') group by `drugs`.`drug` ;

-- --------------------------------------------------------

--
-- Structure for view `transaction_view`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `transaction_view`  AS  select `transactions`.`facilityId` AS `facilityId`,`transactions`.`createdAt` AS `createdAt`,`transactions`.`acct` AS `acct`,`transactions`.`debit` AS `debit`,`transactions`.`description` AS `description`,`transactions`.`patient_id` AS `patient_id` from `transactions` where (`transactions`.`debit` <> 0) ;

-- --------------------------------------------------------

--
-- Structure for view `transaction_view2`
--

CREATE ALGORITHM=UNDEFINED DEFINER=`root`@`localhost` SQL SECURITY DEFINER VIEW `transaction_view2`  AS  select `drugs`.`created_at` AS `date`,`drugs`.`drug` AS `drug`,`drugs`.`qty_in` AS `quantity`,`drugs`.`price` AS `price`,(`drugs`.`qty_in` * `drugs`.`markup`) AS `profit`,((`drugs`.`price` + `drugs`.`markup`) * `drugs`.`qty_in`) AS `amount`,`drugs`.`facilityId` AS `facilityId` from `drugs` where ((`drugs`.`source` = 'dispensary') and (`drugs`.`qty_in` <> 0)) ;

--
-- Indexes for dumped tables
--

--
-- Indexes for table `account`
--
ALTER TABLE `account`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `comment`
--
ALTER TABLE `comment`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `contacts`
--
ALTER TABLE `contacts`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `diagnosis`
--
ALTER TABLE `diagnosis`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dieselrefuel`
--
ALTER TABLE `dieselrefuel`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dieselusage`
--
ALTER TABLE `dieselusage`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `dispensary`
--
ALTER TABLE `dispensary`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `druglist`
--
ALTER TABLE `druglist`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `drugpurchaserecords`
--
ALTER TABLE `drugpurchaserecords`
  ADD PRIMARY KEY (`drug`,`expiry_date`,`cost_price`);

--
-- Indexes for table `feedbacks`
--
ALTER TABLE `feedbacks`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `lab`
--
ALTER TABLE `lab`
  ADD PRIMARY KEY (`test_id`);

--
-- Indexes for table `labservices`
--
ALTER TABLE `labservices`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `lab_numbers`
--
ALTER TABLE `lab_numbers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `lab_requisition`
--
ALTER TABLE `lab_requisition`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `lab_setup`
--
ALTER TABLE `lab_setup`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `operationnotes`
--
ALTER TABLE `operationnotes`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `patientfileinfo`
--
ALTER TABLE `patientfileinfo`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `patientrecords`
--
ALTER TABLE `patientrecords`
  ADD PRIMARY KEY (`patient_id`);

--
-- Indexes for table `prescriptionrequests`
--
ALTER TABLE `prescriptionrequests`
  ADD PRIMARY KEY (`drug_request_id`);

--
-- Indexes for table `referrals`
--
ALTER TABLE `referrals`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `services`
--
ALTER TABLE `services`
  ADD PRIMARY KEY (`service_id`);

--
-- Indexes for table `suppliersinfo`
--
ALTER TABLE `suppliersinfo`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `transactions`
--
ALTER TABLE `transactions`
  ADD PRIMARY KEY (`transaction_id`);

--
-- Indexes for table `transactionsetup`
--
ALTER TABLE `transactionsetup`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `transfers`
--
ALTER TABLE `transfers`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `users`
--
ALTER TABLE `users`
  ADD PRIMARY KEY (`id`);

--
-- Indexes for table `wholesale_transaction`
--
ALTER TABLE `wholesale_transaction`
  ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT for dumped tables
--

--
-- AUTO_INCREMENT for table `account`
--
ALTER TABLE `account`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=44;

--
-- AUTO_INCREMENT for table `diagnosis`
--
ALTER TABLE `diagnosis`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=70;

--
-- AUTO_INCREMENT for table `dieselrefuel`
--
ALTER TABLE `dieselrefuel`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=5;

--
-- AUTO_INCREMENT for table `dieselusage`
--
ALTER TABLE `dieselusage`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=7;

--
-- AUTO_INCREMENT for table `dispensary`
--
ALTER TABLE `dispensary`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=121;

--
-- AUTO_INCREMENT for table `druglist`
--
ALTER TABLE `druglist`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=486;

--
-- AUTO_INCREMENT for table `lab`
--
ALTER TABLE `lab`
  MODIFY `test_id` int(10) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=32;

--
-- AUTO_INCREMENT for table `labservices`
--
ALTER TABLE `labservices`
  MODIFY `id` int(20) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=19;

--
-- AUTO_INCREMENT for table `lab_numbers`
--
ALTER TABLE `lab_numbers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;

--
-- AUTO_INCREMENT for table `lab_requisition`
--
ALTER TABLE `lab_requisition`
  MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=15;

--
-- AUTO_INCREMENT for table `lab_setup`
--
ALTER TABLE `lab_setup`
  MODIFY `id` int(100) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=4;

--
-- AUTO_INCREMENT for table `patientfileinfo`
--
ALTER TABLE `patientfileinfo`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;

--
-- AUTO_INCREMENT for table `prescriptionrequests`
--
ALTER TABLE `prescriptionrequests`
  MODIFY `drug_request_id` int(30) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=66;

--
-- AUTO_INCREMENT for table `services`
--
ALTER TABLE `services`
  MODIFY `service_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=56;

--
-- AUTO_INCREMENT for table `suppliersinfo`
--
ALTER TABLE `suppliersinfo`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;

--
-- AUTO_INCREMENT for table `transactions`
--
ALTER TABLE `transactions`
  MODIFY `transaction_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=57;

--
-- AUTO_INCREMENT for table `transactionsetup`
--
ALTER TABLE `transactionsetup`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=10;

--
-- AUTO_INCREMENT for table `transfers`
--
ALTER TABLE `transfers`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=8;

--
-- AUTO_INCREMENT for table `users`
--
ALTER TABLE `users`
  MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=46;
COMMIT;

