General information

Each openIMIS module can provide scripts that automatically generate test data with some different patterns to fill the database with a certain amount of data.

Since these scripts are only intended for special test installations and for security purpose, they can only be run from the command line.

Note for developers: do not forget to add a __init__.py file into your commands folder or the commands will not be available when installing the module from pypi.org


Insuree module

The insuree module has a custom Django command generateinsurees that can generate any number of insurees, along with their family and an optional active policy.

Requirements

The Faker module must be installed (see dev-requirements).

Syntax

The generateinsurees syntax is the following:

generateinsurees <number_of_families> <number_of_members_in_each_family> [--policy] [--verbose] [--locale=<locale_name>]

Each generated insuree will have a randomly generated chf_id (code).

Examples

openimis-be_py/openIMIS (openimis-venv) 
❯ python manage.py generateinsurees 4 2 --policy --locale=fr_BE

The above command will generate 4 families of 3 members (2 members + 1 head), with an active policy, with Belgian French names.

Similarly, with verbose output and Nepalese locale:

openimis-be_py/openIMIS (openimis-venv) 
❯ python manage.py generateinsurees 5 1 --locale=ne_NP --verbose
1 created head insuree and family शिखा राजकर्णिकार 151523265
Created family member 1 सानु
2 created head insuree and family उषा सुनुवार 767839402
Created family member 1 उम्मेद
3 created head insuree and family गोविन्द महर्जन 182442233
Created family member 1 डा.
4 created head insuree and family आयुषा श्रेष्ठ 165451952
Created family member 1 स्वेच्‍छा
5 created head insuree and family निम्मी शाह 376845104
Created family member 1 श्रद्धा

Claim module

The claim module has a custom Django command generateclaims that can generate any number of claims, along with their services and items.

Syntax

The generateclaims syntax is the following:

generateclaims <number_of_claims> <number_of_services_in_each_claim> <number_of_items_in_each_claim> [--verbose]

Example

openimis-be_py/openIMIS (openimis-venv) 
❯ python manage.py generateclaims 4 2 0 --verbose

The above command will generate 4 claims, each of which will have 2 services and no item. The generation process will be displayed in the standard output.