Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,35 @@ npx ts-node src/scripts/import-multiple-files.ts \
--results-path="/path/to/folder/for/json_results" \
file1.xlsx file2.xlsx
```

### Regenerate template metadata (from DHIS2)

You can use the script `regenerate-metadata.ts` to refresh **only** the Metadata
sheet of an existing template from fresh DHIS2 metadata, leaving every other sheet
(custom form, dropdowns, VBA) untouched:

```bash
yarn regenerate-metadata \
--dhis2-url="https://play.dhis2.org" \
--auth="user:pass" \
--input=template.xlsm \
--output=template.regenerated.xlsm \
--form-id=U6z7eJniNfL \
--form-type=trackerPrograms \
--include-codes
```

| Flag | Required | Description |
| ---- | -------- | ----------- |
| `--dhis2-url` / `-u` | yes | DHIS2 base URL (auth can be embedded here or via `--auth`). |
| `--auth` / `-a` | — | `"username:password"` (special characters are handled). |
| `--input` / `-i` | yes | Path to the input template (`.xlsm`/`.xlsx`). |
| `--output` / `-o` | yes | Path where the regenerated template is written. |
| `--form-id` | yes | DHIS2 program/dataSet id whose metadata is used. |
| `--form-type` | — | `trackerPrograms` \| `programs` \| `dataSets` (default `trackerPrograms`). |
| `--language` | — | Metadata name language (default `en`). |
| `--include-codes` | — | Write the Code column in the Metadata sheet (default off). |
| `--use-codes` | — | Use item codes instead of names for org units, data elements, options… (default off). |
| `--org-unit-short-name` | — | Use each org unit's short name instead of its regular name (default off). |

The same operation is available in the app, under Settings → Maintenance → Regenerate template metadata.
174 changes: 108 additions & 66 deletions i18n/en.pot
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ msgstr ""
"Content-Type: text/plain; charset=utf-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1)\n"
"POT-Creation-Date: 2026-06-30T17:31:02.698Z\n"
"PO-Revision-Date: 2026-06-30T17:31:02.699Z\n"
"POT-Creation-Date: 2026-07-29T11:52:52.301Z\n"
"PO-Revision-Date: 2026-07-29T11:52:52.301Z\n"

msgid "Events - Create/update"
msgstr ""
Expand Down Expand Up @@ -120,6 +120,11 @@ msgstr ""
msgid "Found in {{locations}} of the Excel file"
msgstr ""

msgid ""
"Could not identify this template. Check the file is a Bulk Load template "
"and that your session is still active."
msgstr ""

msgid "Cannot read data form id"
msgstr ""

Expand Down Expand Up @@ -369,6 +374,80 @@ msgstr ""
msgid "Items older than {{period}}"
msgstr ""

msgid "File cleanup completed successfully"
msgstr ""

msgid "An error occurred during file cleanup"
msgstr ""

msgid "History cleanup completed successfully"
msgstr ""

msgid "An error occurred during history cleanup"
msgstr ""

msgid "Regenerate template metadata"
msgstr ""

msgid "Maintenance"
msgstr ""

msgid "File cleanup"
msgstr ""

msgid ""
"Remove files older than the selected period. History entries will be kept "
"but the files will be unaccessible"
msgstr ""

msgid "Cleaning up files..."
msgstr ""

msgid "Confirm File Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all files older than the selected period? "
"This action cannot be undone. History entries will be kept but the files "
"will be inaccessible."
msgstr ""

msgid "Remove files older than"
msgstr ""

msgid "Clean up files"
msgstr ""

msgid "History cleanup"
msgstr ""

msgid ""
"Remove history entries and their documents older than the selected period. "
"This action cannot be undone"
msgstr ""

msgid "Cleaning up history..."
msgstr ""

msgid "Confirm History Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all history entries and their documents "
"older than the selected period? This action cannot be undone."
msgstr ""

msgid "Remove history entries older than"
msgstr ""

msgid "Clean up history"
msgstr ""

msgid ""
"Refresh the Metadata sheet of an existing template file with current DHIS2 "
"metadata"
msgstr ""

msgid "Access to Template Generation"
msgstr ""

Expand Down Expand Up @@ -404,16 +483,30 @@ msgstr ""
msgid "Populate events for every Tracked Entity Instance (TEI)"
msgstr ""

msgid "File cleanup completed successfully"
msgid "Regenerate"
msgstr ""

msgid "An error occurred during file cleanup"
msgid "Drag and drop the template file to regenerate"
msgstr ""

msgid "History cleanup completed successfully"
msgid "Template"
msgstr ""

msgid "An error occurred during history cleanup"
msgid "Data Form Type"
msgstr ""

msgid "Include the Code column in the Metadata sheet"
msgstr ""

msgid "Use codes instead of names for metadata items"
msgstr ""

msgid "Use the short name of organisation units"
msgstr ""

msgid ""
"The Metadata sheet will be re-protected with the standard Bulk Load sheet "
"password. All other sheets and the macros are left untouched."
msgstr ""

msgid "Select Organisation Units on template generation"
Expand Down Expand Up @@ -531,60 +624,6 @@ msgstr ""
msgid "Permissions"
msgstr ""

msgid "Maintenance"
msgstr ""

msgid "File cleanup"
msgstr ""

msgid ""
"Remove files older than the selected period. History entries will be kept "
"but the files will be unaccessible"
msgstr ""

msgid "Cleaning up files..."
msgstr ""

msgid "Confirm File Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all files older than the selected period? "
"This action cannot be undone. History entries will be kept but the files "
"will be inaccessible."
msgstr ""

msgid "Remove files older than"
msgstr ""

msgid "Clean up files"
msgstr ""

msgid "History cleanup"
msgstr ""

msgid ""
"Remove history entries and their documents older than the selected period. "
"This action cannot be undone"
msgstr ""

msgid "Cleaning up history..."
msgstr ""

msgid "Confirm History Cleanup"
msgstr ""

msgid ""
"Are you sure you want to remove all history entries and their documents "
"older than the selected period? This action cannot be undone."
msgstr ""

msgid "Remove history entries older than"
msgstr ""

msgid "Clean up history"
msgstr ""

msgid "Edit custom template"
msgstr ""

Expand Down Expand Up @@ -674,9 +713,6 @@ msgstr ""
msgid "Description"
msgstr ""

msgid "Data Form Type"
msgstr ""

msgid "Type"
msgstr ""

Expand Down Expand Up @@ -1001,9 +1037,6 @@ msgstr ""
msgid "Select available organisation units to include in the template"
msgstr ""

msgid "Template"
msgstr ""

msgid "Data Model"
msgstr ""

Expand Down Expand Up @@ -1161,6 +1194,15 @@ msgstr ""
msgid "Error loading import details"
msgstr ""

msgid "Only .xlsx and .xlsm template files are accepted"
msgstr ""

msgid "Regenerating metadata..."
msgstr ""

msgid "Metadata regenerated"
msgstr ""

msgid "Error deleting data values"
msgstr ""

Expand Down
Loading
Loading