Clone or download
Latest commit 9681eac Dec 11, 2018
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Add pr template for next time Apr 27, 2018
app Move specific seeding action to separate function Dec 6, 2018
bin Add binstub for rspec Aug 7, 2017
config Fix the demo seeding action Dec 5, 2018
db Run seeds in qa as well Dec 5, 2018
doc Add some screenshots to README Jul 26, 2017
lib Fix rubocop issues Dec 5, 2018
log Generate rails app : rails new scorpio --database=postgresql -T and t… Nov 28, 2016
public Generate rails app : rails new scorpio --database=postgresql -T and t… Nov 28, 2016
script Don't error when hesabu can't be found Dec 5, 2018
spec Add a way to check for non production environments Dec 5, 2018
vendor/assets Implement filter and speedup popover Jul 18, 2018
.codeclimate.yml Codeclimate tuning Jul 26, 2017
.csslintrc Codeclimate tuning Jul 26, 2017
.eslintignore Codeclimate tuning Jul 26, 2017
.eslintrc.yml Codeclimate tuning Jul 26, 2017
.flayignore Enable pronto and fix style errors May 30, 2017
.gitignore Generate rails app : rails new scorpio --database=postgresql -T and t… Nov 28, 2016
.pronto.yml Papertrail : stop using controller info, rely on model to fill in pro… Jun 26, 2017
.rspec Add rspec other related quality/debuggin gems. Nov 28, 2016
.rubocop.yml Autocomplete by id Jul 18, 2018
.ruby-version Upgrade to ruby 2.5.1 and remove lot deprecation warnings Mar 30, 2018
.travis.yml Let travis use our script Dec 5, 2018
CODE_OF_CONDUCT Add a code of conduct Jul 26, 2017
Gemfile Update rack Nov 16, 2018
Gemfile.lock Update rack Nov 16, 2018
LICENSE Add license Jul 25, 2017
Procfile make sidekiq concurrency configurable via SIDEKIQ_CONCURRENCY May 24, 2017
README.md Adding a Heroku deploy button Dec 5, 2018
Rakefile Generate rails app : rails new scorpio --database=postgresql -T and t… Nov 28, 2016
app.json Inherit the ORBF_STAGING env variable Dec 6, 2018
coffeelint.json Codeclimate tuning Jul 26, 2017
config.ru Generate rails app : rails new scorpio --database=postgresql -T and t… Nov 28, 2016
diagram.png Diagram Dec 6, 2016
model.md Diagram Dec 6, 2016

README.md

Build Status Test Coverage Code Climate

About

OpenRBF 2.0 logo

A rule engine on top of dhis2 developed by Bluesquare, to let power users describe their Results-Based Financing scheme.

More info about the tool https://bluesquarehub.com/services/openrbf-2-0/

Created with the support of the World Bank.

World Bank logo

Thanks to the DHIS2 team for their help and support

DHIS2 logo

Using

A wizard approach guiding you in the setup of projects

With your rules editor and visual explanation

activity rule dependency graph

payment rule  dependency graph

each formula will be mapped to a dhis2 data element.

You can easily verify your formula with the invoicing simulation form with a built-in invoice explainer showing you how was this amount/score calculated

invoicing explainer

Every change is tracked and you publish your project draft to be used at a given period.

Contributing

Dependencies and config

Run script/setup, this should install all dependencies and create the local databases.

Run script/test to check if everything was successfull.

A default user and program will be create by the db/seeds.rb file.

Seed a project

We have an example project that can be created using the public DHIS2 demo instance (https://play.dhis2.org/demo/) to showcase a RBF project configuration:

http://127.0.0.1:3000/setup/seeds

This will generate a "typical" RBF project with quality, quantity & payment rules for you to explore and play with.

Admin interface

You can access any element in the application using the admin interface at

http://127.0.0.1:3000/admin

Tests

Run the tests after any change:

bin/rspec

Deploying

Hosting provider

We recommand Heroku to host the application, but any hosting should work as long as it support Rails & Postgresql. On heroku, deploy should be as simple as:

git push heroku master
heroku run rake db:create db:migrate db:seed

Or you can use this button to get up and running immediately:

Deploy

Restoring a testing or production Environment

get a fresh copy using Heroku

heroku pg:pull DATABASE_URL orbf2 --app yourappname

to speed up things you can a copy without the dhis2_logs table

bundle exec rake db:fetch APP_NAME=yourappname

note that you need a pg 9.6.1 version