这是indexloc提供的服务,不要输入任何密码
Skip to content
Ismail Sunni edited this page Sep 30, 2015 · 2 revisions

Data Loader

Loading Data

  1. Log in to healthsites.io with your account. (You must be a staff to load the data).
  2. Open Data Loader in menu bar.
  3. Fill the form:
    1. Organisation name: the name of your organisation.
    2. JSON Concept mapping: A json file that contains json mapping for your data.
    3. CSV data: The localities data in csv (comma separated value) format. Currently we only accept comma as separator. It must be less than 10MB.
    4. Data loader mode: Define the data loader's behaviour. See the difference for both mode in Data Loader section.
  4. Click Submit button.

If you successfully upload your data, you will get success message. The data has not been loaded to the site yet. The site will load the data in the background. It will send email to mark.herringer@gmail.com and ismail@kartoza.com. We use these email address since currently the user doesn't have email field. We will send the email to the user who load the data after we add email field in user's attribute.

Data Loader Mode

There are two data loader mode:

Replace Data

If we use this mode, the old data which has the same id will be overwritten by the new data whose the same id. For example:

```python
# Old data
id = '1234',
name = 'Hospital',
address = 'Swellendam, South Africa'
phone_number = '1234567'
```
```python
# new data to be loaded
id = '1234',
name = 'Drugstore',
address = 'Swellendam, South Africa'
owner = 'SA Government'
```
```python
# Data after loading
id = '1234',
name = 'Drugstore',
address = 'Swellendam, South Africa'
owner = 'SA Government'
```

The phone number field is removed in this mode.

Update Data

If replace data will overwrite the old data, update data will preserve the old data that doesn't have value in the loaded data. For example:

```python
# Old data
id = '1234',
name = 'Hospital',
address = 'Swellendam, South Africa'
phone_number = '1234567'
```
```python
# new data to be loaded
id = '1234',
name = 'Drugstore',
address = 'Swellendam, South Africa'
owner = 'SA Government'
```
```python
# Data after loading
id = '1234',
name = 'Drugstore',
address = 'Swellendam, South Africa'
owner = 'SA Government'
phone_number = '1234567'
```

The phone number field is preserved in this mode.

Clone this wiki locally