EyeSeeTea / WHO-custom-forms

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

[HEP] [Program] Custom Form generator script #11

Closed matiasgarcia91 closed 5 years ago

matiasgarcia91 commented 5 years ago

:pushpin: References

:tophat: What is the goal?

Create script to generate custom forms for Hepatitis Policy Uptake

:memo: Implementation

Script creates a custom form for event capture composed of: 3 sections defined by three dataElementGroups with an order attribute for the display order. Also, dataElementGroups have a second attribute to specify if fields should be textFields or comboBoxes (DHIS optionList).

🖌 To-do:

:art: Screenshots

image

:boom: How can it be tested?

cd into HEP-event-capture folder, run yarn install and follow README.

:floppy_disk: Requires DB migration?

matiasgarcia91 commented 5 years ago

@tokland This is ready for review.

Two things I would like you to take a special look into:

  1. I added an attribute to the dataElements to specify if their inputs should be OptionList (comboxes) or regular TextFields. This could also be done checking for the existence of optionSets within the dataElements, but there could be cases when optionsSets are defined but TextFields are preferred.

  2. The call for fetching the data might have ended up too nested and could be split into two (program-id -> get programStageDataElements and a reference to the dataElementGroups and then a second call to get all dataElementGroups (Sections) with their respective dataElements).