EyeSeeTea / WHO-custom-forms

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

Cases/deaths/disabilities at subnational level #40

Closed xurxodev closed 3 years ago

xurxodev commented 3 years ago

:pushpin: References

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

:memo: Implementation

To store custom metadata we are using the data store.

It's necessary to create the snake-bite namespace with a customMetadata key in the data store and with the next structure:

{
  "dataElements": {
      "uidDE1": {
      "totalName": "DE Text", // (if not exists the text total is shown)
      "info": "Info text, it will appear next to Data element text",  //(if not exists the info icon is not visible)
    },
    ....
  },
  "optionCombos": {
      "uidCatOptionCombo1": {
      "name": "CatOptionCombo text",   // (if not exists the CatOptionCombo name is shown)
       "info": "Info text, it will appear next to CatOptionCombo header text", // (if not exists the info icon is not visible),
       "order": 2 //(order into DE row, if not exist 0 is asigned)
    },
  ...
  },
  "subnationalDataSet": "SAV16xEdCZW" // (data set uid used by subnational tab)
}

Important: The subnational data set must be assigned to correct org units

Example used in development content in this json: customMetadata.json.zip

To generate Snakebite custom form is necessary changes in metadata:

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

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