function drop_tables()
 {
     module::execsql("DROP TABLE `m_consult_lab_radiology`;");
     module::execsql("DROP TABLE `m_lib_rad_facility`;");
     module::execsql("DROP TABLE `m_lib_rad_dxcodes`;");
     module::execsql("DROP TABLE `m_lib_rad_types`;");
 }
 function drop_tables()
 {
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
     }
     module::execsql("DROP TABLE `m_lib_weekly_calendar`");
 }
 function drop_tables()
 {
     if (func_num_args() > 0) {
         $arg_list = func_get_args();
     }
     module::execsql("DROP TABLE `m_lib_population`");
 }
    function drop_tables() {
    //
    // called from delete_module()
    //

        module::execsql("DROP TABLE `m_lib_wtforage`");
    }
Example #5
0
 function drop_tables()
 {
     //
     // called from delete_module()
     //
     module::execsql("DROP TABLE `m_news`;");
 }
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_consult_report`;");
     module::execsql("DROP TABLE `m_patient_consult_tcl`;");
     module::execsql("DROP TABLE `m_consult_report_dailyservice`;");
     module::execsql("DROP TABLE `m_consult_ccdev_report_dailyservice`;");
     module::execsql("DROP TABLE `m_consult_mc_report_dailyservice`;");
 }
 function drop_tables()
 {
     //
     // called from delete_module()
     //
     module::execsql("DROP TABLE `m_patient_pregnancy`;");
     module::execsql("DROP TABLE `m_consult_pregnancy`;");
 }
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_lib_questions`;");
     module::execsql("DROP TABLE `m_lib_questioncat`;");
     module::execsql("DROP TABLE `m_complaint_question`;");
     module::execsql("DROP TABLE `m_consult_complaint_question`;");
     module::execsql("DROP TABLE `m_complaint_question_diagnosis`;");
 }
    function drop_tables() {
        module::execsql("SET foreign_key_checks=0;");
        module::execsql("DROP TABLE `m_consult_diagnosis`;");
        module::execsql("DROP TABLE `m_consult_complaint`;");
        module::execsql("DROP TABLE `m_healthcenter_modules`;");
        module::execsql("DROP TABLE `m_consult_vitals`;");
        module::execsql("DROP TABLE `m_consult_ptgroup`;");
        module::execsql("DROP TABLE `m_consult`;");
	module::execsql("DROP TABLE `m_lib_supply_source`");
        module::execsql("SET foreign_key_checks=1;");
    }
Example #10
0
    function drop_tables() {

        module::execsql("SET foreign_key_checks=0;");
        module::execsql("DROP TABLE `m_consult_mc_labs_request`;");
        module::execsql("DROP TABLE `m_consult_mc_prenatal`;");
        module::execsql("DROP TABLE `m_consult_mc_postpartum`;");
        module::execsql("DROP TABLE `m_consult_mc_visit_risk`;");
        module::execsql("DROP TABLE `m_consult_mc_services`;");
        module::execsql("DROP TABLE `m_consult_mc_vaccine`;");
        module::execsql("DROP TABLE `m_patient_mc`;");
        module::execsql("DROP TABLE `m_lib_mc_risk_factors`;");
        module::execsql("DROP TABLE `m_lib_mc_outcome`;");
        module::execsql("DROP TABLE `m_lib_mc_vaccines`;");
        module::execsql("DROP TABLE `m_lib_mc_services`;");
        module::execsql("DROP TABLE `m_lib_mc_birth_attendant`;");
        module::execsql("SET foreign_key_checks=1;");
    }
    function drop_tables() {

        module::execsql("set foreign_key_checks=0;");
        module::execsql("DROP TABLE `m_consult_notes_complaint`;");
        module::execsql("DROP TABLE `m_consult_notes_dxclass`;");
        module::execsql("DROP TABLE `m_lib_notes_dxclass`;");
        module::execsql("DROP TABLE `m_lib_notes_template`;");
        module::execsql("DROP TABLE `m_consult_notes`;");
        module::execsql("set foreign_key_checks=1;");
    }
Example #12
0
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_lib_laboratory`;");
     module::execsql("SET foreign_key_checks=0; DROP TABLE `m_consult_lab`; SET foreign_key_checks=1; ");
 }
 function drop_tables()
 {
     module::execsql("DROP table m_patient_fp");
     module::execsql("DROP table m_lib_fp_methods");
     module::execsql("DROP table m_lib_fp_history_cat");
     module::execsql("DROP table m_lib_fp_history");
     module::execsql("DROP table m_lib_fp_pe_cat");
     module::execsql("DROP table m_lib_fp_pe");
     module::execsql("DROP table m_lib_fp_pelvic_cat");
     module::execsql("DROP table m_lib_fp_pelvic");
 }
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_consult_service`;");
     module::execsql("SET foreign_key_checks=1;");
 }
Example #15
0
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_lib_alert_type`;");
     module::execsql("DROP TABLE `m_lib_alert_indicators`;");
 }
 function drop_sql()
 {
     module::execsql("DROP TABLE m_consult_lab_hematology");
 }
Example #17
0
 function drop_tables()
 {
     module::execsql("set foreign_key_checks=0;");
     module::execsql("DROP TABLE `m_consult_fp_services`;");
     module::execsql("DROP TABLE `m_consult_fp_hx`;");
     module::execsql("DROP TABLE `m_consult_fp_pe`;");
     module::execsql("DROP TABLE `m_consult_fp_pelvic_exam`;");
     module::execsql("DROP TABLE `m_lib_fp_history_cat`;");
     module::execsql("DROP TABLE `m_lib_fp_history`;");
     module::execsql("DROP TABLE `m_lib_fp_methods`;");
     module::execsql("DROP TABLE `m_patient_fp`;");
     module::execsql("set foreign_key_checks=1;");
 }
 function drop_tables() {
     module::execsql("DROP TABLE `m_quotations`;");
 }
Example #19
0
 function drop_tables() {
 //
 // pay attention to order of deletion
 // to prevent foerign key constraint errors
 //
     module::execsql("DROP TABLE `m_family_address`;");
     module::execsql("DROP TABLE `m_family_members`;");
     module::execsql("DROP TABLE `m_family`;");
 }
 function drop_tables()
 {
     //
     // called from delete_module()
     //
     module::execsql("DROP TABLE `m_patient_reminder_data`;");
     module::execsql("DROP TABLE `m_consult_reminder`;");
     module::execsql("DROP TABLE `m_lib_reminder_sms_template`;");
 }
    /**
     * Create System Tables
     * 
     * @param string $dbname
     */
    function create_system_tables() {
        if (func_num_args()>0) {
            $arg_list = func_get_args();
            $dbname = $arg_list[0];
        }

        mysql_select_db($dbname);

        //module::load_sql("setup.sql");
        //
        // set up system tables
        //
        if (module::execsql("set foreign_key_checks=0;")) {
            print "<font color='BLUE'>FOREIGN KEY CHECKS DISABLED...</font><br>";
        }

        // table: content
        // this table manages content module layout in content section
        //    of enterprise application; this means you can set up any
        //    content management module (news, quotes, articles, etc.)
        if (module::execsql("CREATE TABLE content (".
            "content_id int(11) NOT NULL auto_increment,".
            "content_module varchar(25) NOT NULL default '',".
            "content_column int(11) NOT NULL default '0',".
            "content_active char(1) NOT NULL default '',".
            "content_display int(11) NOT NULL default '10',".
            "content_level int(11) NOT NULL default '0',".
            "PRIMARY KEY  (content_id),".
            "KEY key_module (content_module),".
            "CONSTRAINT `content_ibfk_1` FOREIGN KEY (`content_module`) REFERENCES `modules` (`module_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>CONTENT table created...</font><br>";
        }
        // content content
        module::execsql("INSERT INTO content VALUES (1,'news',1,'Y',10,1);");

        // error codes
        if (module::execsql("CREATE TABLE errorcodes (".
            "error_id char(3) NOT NULL default '',".
            "error_name varchar(100) NOT NULL default '',".
            "PRIMARY KEY  (error_id)".
            ") TYPE=MyISAM;")) {
            print "<font color='BLUE'>ERRORCODES table created...</font><br>";
        }
        // error codes content
        module::execsql("INSERT INTO errorcodes VALUES ('001','Invalid account.');");
        module::execsql("INSERT INTO errorcodes VALUES ('002','Please complete entries');");

        // table: game_user
        // This table contains system user information.
        // A user is anyone who should have access to the system application
        // through a username and password. This is linked to the role table so administrator
        // can specify more fine-grained permissions for read, update and delete,
        // and to the module menu and global permissions for menu-level permissions. A
        // module can be created for more fine-grained access at the module level.
        if (module::execsql("CREATE TABLE game_user (".
            "user_id float NOT NULL auto_increment,".
            "user_lastname varchar(100) NOT NULL default '',".
            "user_firstname varchar(100) NOT NULL default '',".
            "user_middle varchar(100) NOT NULL default '',".
            "user_dob date NOT NULL default '0000-00-00',".
            "user_gender char(1) NOT NULL default '',".
            "user_role varchar(5) NOT NULL default '',".
            "user_admin char(1) NOT NULL default '',".
            "user_login varchar(10) NOT NULL default '',".
            "user_password varchar(32) NOT NULL default '',".
            "user_lang varchar(10) NOT NULL default 'english',".
            "user_email varchar(100) default '',".
            "user_cellular varchar(100) NOT NULL default '',".
            "user_pin varchar(4) NOT NULL default '',".
            "user_active char(1) NOT NULL default '',".
            "PRIMARY KEY  (user_id)".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>GAME_USER table created...</font><br>";
        }

        // game user content
        module::execsql("INSERT INTO game_user VALUES (1,'User','Admin','','0000-00-00','','','Y','admin','43e9a4ab75570f5b','english','','','','Y');");

        // table: location
        // This table interacts with permission system to specify module access
        // per given location. A location entity is typical of health care enterprise
        // systems. Examples of locations in health centers: admission section,
        // treatment rooms, consulation and laboratory.
        if (module::execsql("CREATE TABLE location (".
            "location_id varchar(10) NOT NULL default '',".
            "location_name varchar(50) NOT NULL default '',".
            "PRIMARY KEY  (location_id)".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>LOCATION table created...</font><br>";
        }

        // location content
        // we put here some locations mentioned above
        module::execsql("INSERT INTO location VALUES ('ADM','Admissions');");
        module::execsql("INSERT INTO location VALUES ('CONS','Consultations');");
        module::execsql("INSERT INTO location VALUES ('LAB','Laboratory');");
        module::execsql("INSERT INTO location VALUES ('TX','Treatment');");

        // table: module_dependencies
        // This table takes care of tracking module dependencies as
        // the central table. Dependencies are specified at the module
        // level through module::set_dep().
        if (module::execsql("CREATE TABLE module_dependencies (".
            "module_id varchar(25) NOT NULL default '',".
            "req_module varchar(25) NOT NULL default '',".
            "PRIMARY KEY  (module_id,req_module),".
            "CONSTRAINT `foreign` FOREIGN KEY (`module_id`) REFERENCES `modules` (`module_id`) ON DELETE CASCADE ON UPDATE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_DEPENDENCIES table created...</font><br>";
        }

        // table: module_menu
        // This table stores menu information for each module. Modules
        // specify their own menus.
        if (module::execsql("CREATE TABLE module_menu (".
            "menu_id int(11) NOT NULL auto_increment,".
            "module_id varchar(25) NOT NULL default '0',".
            "menu_cat varchar(10) NOT NULL default '',".
            "menu_title varchar(20) NOT NULL default '',".
            "menu_rank int(11) NOT NULL default '0',".
            "menu_visible char(1) NOT NULL default 'Y',".
            "menu_action varchar(100) NOT NULL default '',".
            "PRIMARY KEY  (menu_id,module_id),".
            "UNIQUE KEY ukey_modulemenu (module_id,menu_action),".
            "KEY key_module (module_id),".
            "CONSTRAINT `module_menu_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `modules` (`module_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_MENU table created...</font><br>";
        }

        // table: module_menu_location
        // This table is a bridge entity between menu and location. This enables location-based 
        // menu access.
        if (module::execsql("CREATE TABLE module_menu_location (".
            "location_id varchar(10) NOT NULL default '',".
            "module_id varchar(25) NOT NULL default '',".
            "menu_id int(11) NOT NULL default '0',".
            "PRIMARY KEY  (location_id,menu_id,module_id),".
            "KEY key_menu (menu_id),".
            "KEY key_module (module_id),".
            "KEY key_location (location_id),".
            "CONSTRAINT `module_menu_location_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `modules` (`module_id`) ON DELETE CASCADE,".
            "CONSTRAINT `module_menu_location_ibfk_2` FOREIGN KEY (`location_id`) REFERENCES `location` (`location_id`) ON DELETE CASCADE,".
            "CONSTRAINT `module_menu_location_ibfk_3` FOREIGN KEY (`menu_id`) REFERENCES `module_menu` (`menu_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_MENU_LOCATION table created...</font><br>";
        }

        // table: module_menu_permissions
        // This table is a bridge entity and stores information about
        // what menus are available for each game user.
        if (module::execsql("CREATE TABLE module_menu_permissions (".
            "module_id varchar(25) NOT NULL default '',".
            "menu_id float NOT NULL default '0',".
            "user_id float NOT NULL default '0',".
            "PRIMARY KEY  (module_id,menu_id,user_id),".
            "KEY key_module (module_id),".
            "KEY key_menu (menu_id),".
            "KEY key_user (user_id),".
            "CONSTRAINT `module_menu_permissions_ibfk_1` FOREIGN KEY (`user_id`) REFERENCES `game_user` (`user_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_MENU_PERMISSIONS table created...</font><br>";
        }

        // table: module_permissions
        // This table is a bridge entity and stores module level permissions per user.
        if (module::execsql("CREATE TABLE module_permissions (".
            "module_id varchar(25) NOT NULL default '0',".
            "user_id float NOT NULL default '0',".
            "PRIMARY KEY  (module_id,user_id),".
            "KEY key_module (module_id),".
            "KEY key_user (user_id),".
            "CONSTRAINT `module_permissions_ibfk_1` FOREIGN KEY (`module_id`) REFERENCES `modules` (`module_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_PERMISSIONS table created...</font><br>";
        }

        // table: module_user_location
        // This table is a bridge entity and tracks which users are at what location
        if (module::execsql("CREATE TABLE module_user_location (".
            "location_id varchar(10) NOT NULL default '',".
            "user_id float NOT NULL default '0',".
            "PRIMARY KEY  (location_id,user_id),".
            "KEY key_user (user_id),".
            "KEY key_location (location_id),".
            "CONSTRAINT `module_user_location_ibfk_1` FOREIGN KEY (`location_id`) REFERENCES `location` (`location_id`) ON DELETE CASCADE,".
            "CONSTRAINT `module_user_location_ibfk_2` FOREIGN KEY (`user_id`) REFERENCES `game_user` (`user_id`) ON DELETE CASCADE".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULE_USER_LOCATION table created...</font><br>";
        }

        // table: modules
        // This table stores module definitions
        if (module::execsql("CREATE TABLE modules (".
            "module_id varchar(25) NOT NULL default '',".
            "module_init char(1) NOT NULL default 'N',".
            "module_version varchar(25) default '',".
            "module_desc text NOT NULL,".
            "module_author varchar(50) NOT NULL default '',".
            "module_name varchar(100) NOT NULL default '',".
            "PRIMARY KEY  (module_id),".
            "UNIQUE KEY ukey_modules (module_name)".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>MODULES table created...</font><br>";
        }

        // table: role
        // This table stores role definitions. Data access field is codes as follows:
        // Position 1: Read (1 or 0)
        // Position 2: Update (1 or 0)
        // Position 3: Delete (1 or 0)
        if (module::execsql("CREATE TABLE role (".
            "role_id varchar(10) NOT NULL default '',".
            "role_dataaccess char(3) NOT NULL default '',".
            "role_name varchar(100) NOT NULL default '',".
            "PRIMARY KEY  (role_id)".
            ") TYPE=InnoDB;")) {
            print "<font color='BLUE'>ROLE table created...</font><br>";
        }

        // role content
        // NOTE: you change this to be more specific to your setting
        //
        module::execsql("INSERT INTO role VALUES ('BHW','110','Barangay Health Worker');");
        module::execsql("INSERT INTO role VALUES ('MD','111','Physician');");
        module::execsql("INSERT INTO role VALUES ('MWIFE','110','Midwife');");
        module::execsql("INSERT INTO role VALUES ('RN','110','Nurse');");
        module::execsql("INSERT INTO role VALUES ('LABAIDE','110','Lab Aide');");

        // table: terms
        // This is the multilingualization table. Please see detailed description in
        // developer guide.
        if (module::execsql("CREATE TABLE terms (".
            "termid varchar(50) NOT NULL default '',".
            "languageid varchar(10) NOT NULL default '',".
            "langtext text,".
            "remarks text,".
            "translationof varchar(50) default NULL,".
            "module_id varchar(25) NOT NULL default '',".
            "isenglish char(1) NOT NULL default 'Y',".
            "PRIMARY KEY  (termid,languageid)".
            ") TYPE=MyISAM;")) {
            print "<font color='BLUE'>TERMS table created...</font><br>";
        }

        if (module::execsql("set foreign_key_checks=1;")) {
            print "<font color='BLUE'>FOREIGN KEY CHECKS ENABLED...</font><br>";
        }
    }
    function drop_tables() {

        module::execsql("SET foreign_key_checks=0;");
        module::execsql("DROP TABLE `m_lib_mc_risk_factors`;");
        module::execsql("DROP TABLE `m_lib_mc_outcome`;");
        module::execsql("DROP TABLE `m_lib_mc_vaccines`;");
        module::execsql("DROP TABLE `m_lib_mc_services`;");
        module::execsql("DROP TABLE `m_lib_mc_birth_attendant`;");
        module::execsql("SET foreign_key_checks=1;");
    }
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_consult_epi_report`;");
     module::execsql("DROP TABLE `m_patient_epi_tcl`;");
 }
Example #24
0
 function drop_tables()
 {
     module::execsql("DROP TABLE `m_leprosy_diagnosis`");
     module::execsql("DROP TABLE `m_leprosy_past_treatment`");
     module::execsql("DROP TABLE `m_leprosy_other_illness`");
     module::execsql("DROP TABLE `m_leprosy_contact_examination`");
     module::execsql("DROP TABLE `m_leprosy_skin_smear`");
     module::execsql("DROP TABLE `m_leprosy_drug_collection_chart`");
     module::execsql("DROP TABLE `m_leprosy_voluntary_muscle_testing`");
     module::execsql("DROP TABLE `m_leprosy_eye_evaluation`");
     module::execsql("DROP TABLE `m_leprosy_who_disability_grade`");
     module::execsql("DROP TABLE `m_leprosy_post_treatment`");
 }
    function drop_tables() {

        module::execsql("DROP TABLE `m_lib_education`;");
    }
Example #26
0
 function drop_tables()
 {
     module::execsql("set foreign_key_checks=0;");
     module::execsql("DROP TABLE `m_consult_ccdev_services`;");
     module::execsql("DROP TABLE `m_consult_ccdev_vaccine`;");
     module::execsql("DROP TABLE `m_patient_ccdev_sibling`;");
     module::execsql("DROP TABLE `m_lib_ccdev_services`;");
     module::execsql("DROP TABLE `m_patient_ccdev`;");
     module::execsql("set foreign_key_checks=1;");
 }
    function drop_tables() {

        module::execsql("DROP TABLE `m_lib_graph_piegraph`;");
        module::execsql("DROP TABLE `m_lib_graph_bargraph`;");
    }
Example #28
0
 function drop_tables() {
     module::execsql("DROP TABLE `m_consult_lab_sputum`;");
     module::execsql("DROP TABLE `m_lib_sputum_appearance`;");
     module::execsql("DROP TABLE `m_lib_sputum_reading`;");        
     module::execsql("DROP TABLE `m_lib_sputum_period`;");        
 }
Example #29
0
 function drop_tables()
 {
     module::execsql("DROP TABLE m_consult_lab_urinalysis");
 }
 function drop_tables()
 {
     module::execsql("DROP table m_patient_fp");
     module::execsql("DROP table m_patient_fp_dropout");
     module::execsql("DROP table m_patient_fp_hx");
     module::execsql("DROP table m_patient_fp_method");
     module::execsql("DROP table m_patient_fp_method_service");
     module::execsql("DROP table m_patient_fp_obgyn");
     module::execsql("DROP table m_patient_fp_obgyn_details");
     module::execsql("DROP table m_patient_fp_pe");
     module::execsql("DROP table m_patient_fp_pelvic");
     module::execsql("DROP table m_lib_fp_methods");
     module::execsql("DROP table m_lib_fp_history_cat");
     module::execsql("DROP table m_lib_fp_history");
     module::execsql("DROP table m_lib_fp_pe_cat");
     module::execsql("DROP table m_lib_fp_pe");
     module::execsql("DROP table m_lib_fp_pelvic_cat");
     module::execsql("DROP table m_lib_fp_pelvic");
     module::execsql("DROP table m_lib_fp_client");
     module::execsql("DROP table m_lib_fp_dropoutreason");
     module::execsql("DROP table m_lib_fp_obgyn");
 }