EyeSeeTea / WHO-custom-forms

Custom forms developed for WHO
GNU General Public License v3.0
0 stars 0 forks source link

Discuss basic structure of generic custom form #3

Open ifoche opened 5 years ago

ifoche commented 5 years ago

Just for the record, we finally chose to use the same engine that was used for Reactive Vaccination, being able to generate the custom form with an execution of that engine, instead of using a template that reads in execution time what needs to load. The idea is to make the custom form as performant as possible.

I keep this issue open for @tokland and @matiasgarcia91 to briefly describe the final architecture that is being implemented, for the future to use it as documentation

matiasgarcia91 commented 5 years ago

The selected approach consists of a Node.js script with the following main dependencies:

The script receives as input:

Example:

$ node lib/cli.js --url='https://admin:district@play.dhis2.org/2.30' --dataset-id='eZDhcZi6FLP'

The scripts retrieves the data set and its sections to build a custom form based on the mock-up provided:

image

Finally, the script sends a single POST to /metadata with a JSON containing both the new dataEntryForm as well as the updated dataSet referencing the new dataEntryForm.

The solution proposed for the Event capture forms of programs is totally analogous.