Open ifoche opened 5 years ago
The selected approach consists of a Node.js script with the following main dependencies:
The script receives as input:
http://{username}:{password}@{path}
.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:
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.
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