EyeSeeTea / WHO-custom-forms

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

Snakebite changes phase 2 #46

Closed xurxodev closed 3 years ago

xurxodev commented 3 years ago

:pushpin: References

https://app.clickup.com/t/buyh6f

:memo: Implementation

Vials

:art: Screenshots

:fire: Is there anything the reviewer should know to test it?

Metadata changes

Subnational tab use the same SQL view that HWF module 1 subnational single entry -> F9WNm3XNjli

This sql view change to return a new field path of the organisation unit

SELECT ou.uid, ou.shortname,ou.path
   FROM organisationunit ou
   LEFT JOIN datasetsource dss ON ou.organisationunitid = dss.sourceid
   LEFT JOIN dataset ds ON dss.datasetid = ds.datasetid
 WHERE ds.uid = '${dataSet}' and ou.path like '%${orgUnit}%'
 Order by ou.shortname ASC

Data Store

  "dataElements": {
    "laW8yBtixac": {
      "defaultCatOptionComboName":"total 1",
    }

To generate the custom form

cd /HEP-data-entry
yarn build
node lib/cli.js --url='http://user:pwd!@dhisUrl' --dataset-id='XBgvNrxpcDC' --module='snakebite'

Important: the command uploads all data set to the server. Important: Sometimes to generate the custom form, age category options are duplicated in data elements. I think this is an API bug.

:bookmark_tabs: Others

xurxodev commented 3 years ago

@ifoche changes are fixed: For the default cat option combo name there are a new feature adding defaultCatOptionComboName prop to data element the default column name is customizable by data element:

  "dataElements": {
    "laW8yBtixac": {
      "defaultCatOptionComboName":"total 1",
    }