Skip to content

Embedding Philippine PSGC code and morbidity week in the installation script

alisonperez edited this page Sep 13, 2010 · 3 revisions
GOAL : To automatically populate barangay and morbidity weeks table upon installation of CHITS

Aside from supplying basic database information in the installation script, there is a need to have the demographics data in CHITS be set as well in the installation as well. Demographics data are presently recorded in: 

a. config.xml code tags for the PSGC code of the Municipality or Province

b. config.xml name tags for the name of the Rural Health Unit (i.e. Malibay Health Center, Victoria Rural Health Unit)

c. chits_query/globals.php: $_SESSION[province] for the name of the province. Leave this as blank if the area is a  city

d. chits_query/globals.php: $_SESSION[lgu] for the name of the LGU concerned. Place the name of the municipality or city here

e. At database level, the table 'm_lib_barangay' is used to store barangay information by using the data entry form for LIBRARIES --> BARANGAY. The table field / data entry field association is listed below together with the definition of required values. 

   1. barangay_id / BARANGAY NUMBER -  pertains to a sequential number from PSGC of Municipality/City + [1 - n] where n is the total number of barangays (i.e. 030101 where 03010 is the PSGC and 1 is the first barangay of that municapility)
   2. barangay_name / BARANGAY NAME - pertains to the label or name of the barangay itself (i.e Barangay Kahoy)
   3. area_code / AREA CODE - pertains to the PSGC code of the municipality of the municipality or the city


All the fields mentioned above are manually being encoded as of this writing. Yet, such items can be automatically be pre-loaded upon installation. Installation script must include the following protocols listed below:

1. Create a file wherein the list of complete PGGC codes will be written. The source data will be a wget'd from an online repository. 

2. Ask the user to enter the name of the Province. Save the province name to the chits_query/globals.php file and assigned to the $_SESSION[province] parameter

3. Ask the user to enter the name of the municipality or city. Save the municipality / city name to the chits_query/globals.php file and assigned to the $_SESSION[lgu] parameter. 

4. Show an option box (in numerical format) possible PSGC codes based on the name of the municipality enter in #3. The contents will be coming from the  Example, if the municipality entered is San Fernando, the option should show,
   Select Number for PSGC code:
     1 - San Fernando, Pampanga (03202232)
     2 - San Fernando, La Union (0321032)

5. Script will save the PSGC code in the config.xml file under the <code> tag.

6. Ask for the name of the health center and telephone number. Save this at the <name> and <number> tags of config.xml respectively.