You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
-`--dataSet` (`-ds`): dataSet code of the original dataSet
44
+
-`--dataSet-destination` (`-ds-dest`): dataSet code of the destination/approval dataSet (required)
45
+
-`--dataElement-submission` (`-de-sub`): dataElement code where the submission date is going to be saved (this must be in the APPROVAL dataSet)
46
+
-`--dataElement-approval` (`-de-apprv`): dataElement code where the approval date is going to be saved (this must be in the APPROVAL dataSet)
47
+
-`--persist`: save sqlViews to `dhis` or `disk`
48
+
49
+
When `--persist dhis` is used, the script also creates a DataSetConfiguration in the DHIS2 DataStore with `submitAndComplete: true`, `revokeAndIncomplete: true`, and empty permissions (only admin users have access to this dataSet. You can edit this in the settings page of the application).
50
+
51
+
## Generate DataSet Approval metadata
52
+
53
+
Script to clone an existing DataSet and its DataElements with the `-APVD` suffix, generating a new approval DataSet and metadata file.
54
+
55
+
Make sure the following variables are configured in your `.env` file:
44
56
45
57
```
46
-
$ yarn build-webapp # Creates dist/d2-reports.zip
58
+
REACT_APP_DHIS2_BASE_URL=http://localhost:8080
59
+
REACT_APP_DHIS2_AUTH='admin:district'
47
60
```
61
+
62
+
Run the script:
63
+
64
+
```shell
65
+
yarn run generate-dataset-approval --dataSet MY_DS_CODE \
66
+
--dataElement-submission "MY_DS_CODE-Submission date module1-APVD" \
67
+
--dataElement-approval "MY_DS_CODE-Approval date module1-APVD" \
68
+
--persist
69
+
```
70
+
71
+
Parameters:
72
+
73
+
-`--dataSet` (`-ds`): dataSet code of the original dataSet (required)
74
+
-`--post`: commit metadata to DHIS2 (default: validate only)
75
+
76
+
Notes:
77
+
78
+
- Writes a metadata JSON file named `<dataSetCode>_<timestamp>.json` in the current directory.
79
+
- Show dataElements without code and saves them to `warning_<dataSetCode>_<timestamp>.json`.
80
+
- On validation/import errors, saves details to `errors_<dataSetCode>_<timestamp>.json`.
0 commit comments