~ihris+cssc/ihris-manage/data-import-4.0

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
The script 
    import_tools/module_creator.php
is used to create the modules for standradized data which
resides .csv files in:
    import_tools/standrad_data
the name of the .csv file (without the .csv) is the name
of the form $form that a module should be created for. the first 
row of each .csv file is the name of the field in the form
that column corresponds to.  The modules are created as:
     modules/data-$form/ihris-manage-data-$form.xml
It extracts the district list from the employee list as provided from
IMA.  This employee list is expected to live in:
      import_tools/sensitive_data/emplyees.csv


Note:  eveyrthing in import_tools/sensitive_data should be 'bzr ignore'd.





================OLD README  NO LONGER RELEVANT==============
There are two scripts that can be run.  Both scripts use the 
"base data" included in the 'data/' subdirectory. This defines 
things like Employers, Payers, Georaphic data, etc.

import_facility.php
 Expects as one command line argument the name of a CSV file
 containing facility data.  
 As the 'CSSC Code' is unique per facilility it can
 be run multiple times on the same facility data file and
 will not produce duplicate facilities. 
 The expected columns of the facility data are:
    cssc_code
    type
    reg_no
    facility
    zone
    region
    district
    contact
    phone
    alt_phone 
    email
    address
 although the last two columns are not used. 
 It produces a file:
   facilities.incomplete.DATE.csv
 which contain a list of the facilities with incomplete data.
 The columns of this file are the same as the input file with an
 additional column containing a brief description as why this
 facility data was considered incomplete.



import_employee.php
 Expects as one command line argument the name of a CSV file
 containing employee data.   As there is no unique identifier
 for an employee, if it is rerun on the same file, it will
 produce DUPLICATE records.
 The expected columns of the employee data are:
      rev_date
      nbr
      cssc_code
      id_num
      zone
      name
      sex
      birth_year
      job_unrevised
      employer_short
      degree_short
      qual_year
      years_at_facility
      payer_short
      year_last_promotion
      last_training
      training_topic
      salary_monthly
      salary_comments
      zone
      rec_change
      job_short
      region
      district
 Training data is ignored.  The job_unrevised column is ignored in
 favor of the job_short column which contains the job code.  It attempts
 create a new position for each employee.  It outputs four files:
    employees.bad.DATE.csv
	The employess whose records could not be added to the
        system. For example, they were missing a name.
    employees.noposition.DATE.csv
        The employees who could be added to the system, but who do not
        have a position (for example because of a bad job code)
    employees.incomplete.DATE.csv
        The employees who were added to the system with a position,
        but some of the provided information is incomplete or inaccurate
    employees.good.DATE.csv
        The employees who were succesfully added to the system.
 The columns of all these files are the same as the input file, with
 the addition of an extra column indicating the problem.