-
Notifications
You must be signed in to change notification settings - Fork 35
docs: [DHIS2-18603] add Bulk data entry Plugin developer portal docs #4066
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
fb5a5ab
feat: batch data entry widget and plugin entry point
simonadomnisoru c8aef0d
feat: batch data entry widget and plugin entry point
simonadomnisoru e5e4d7d
feat: batch data entry widget and plugin entry point
simonadomnisoru 6fcb410
chore: rename variable to pluginSource
simonadomnisoru 33219da
feat: use react query to get batchDataEntryFromIndexedDB
simonadomnisoru 7d37a5b
Merge branch 'master' into DHIS2-18889
simonadomnisoru a929baa
chore: handle all page statuses in the main page container
simonadomnisoru 9fee265
chore: handle all page statuses in the main page container
simonadomnisoru 8ea4c6f
chore: apply css styles from detailed design
simonadomnisoru 77456bb
chore: rename batch to bulk
simonadomnisoru dc294d1
chore: handle long titles in active mode
simonadomnisoru 6afd618
chore: simplify cachedBulkDataEntry checks
simonadomnisoru 3699028
feat: replace ' list' with 'Program overview' as the Breadcrumbs orig…
simonadomnisoru 480a81d
chore: flow
simonadomnisoru 4a79b78
feat: add tracked entities from WL to bulk data entry
simonadomnisoru 518ee9f
fix: sonarcube warnings
simonadomnisoru 4f6e222
feat: add tracked entities from WL to bulk data entry
simonadomnisoru afd33e2
fix: uncaught runtime error
simonadomnisoru 328462a
chore: increese cacheVersion
simonadomnisoru 3551341
chore: fix cypress selectors
simonadomnisoru 40219c6
Merge branch 'master' into DHIS2-18889
simonadomnisoru d038129
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru 59c2151
docs: add Bulk data entry Plugin developer portal docs
simonadomnisoru 95208cc
chore: improve css
simonadomnisoru 1ad3c4a
feat: make useActiveBulkDataEntryList responsible for updating the da…
simonadomnisoru 5576959
Merge branch 'master' into DHIS2-18889
simonadomnisoru 3e61417
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru 8b16dd0
chore: improve bulkDataEntryIsActive
simonadomnisoru 7db181c
Merge branch 'DHIS2-19024' into DHIS2-18603
simonadomnisoru 51163da
chore: fix typos and title case
simonadomnisoru b71aa44
feat: validate the datastore config using zod & add version to config
simonadomnisoru b406a15
Merge branch 'master' into DHIS2-18889
simonadomnisoru 0bc12c6
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru 5b29e88
chore: refactor useBulkDataEntryConfigurations hook
simonadomnisoru 5da7f11
chore: move common files to components/common/bulkDataEntry/
simonadomnisoru b5614da
chore: do not expose isError
simonadomnisoru f119b2d
fix: fill the screen vertically with the Plugin contents
simonadomnisoru 074efee
Merge branch 'master' into DHIS2-18889
simonadomnisoru 571d853
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru 3cf9dfe
fix: unify callbacks into onOpenBulkDataEntryPlugin and onCloseBulkDa…
simonadomnisoru 6e14789
chore: move BulkActionBar from WorkingListsBase to WorkingListsCommon
simonadomnisoru 01a403f
chore: fix breadcrumb default label
simonadomnisoru 18868dc
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru ccc4004
chore: renames customTopBarActions & bulkDataEntryTrackedEntityIds & …
simonadomnisoru 4795dd6
chore: split injectSelectedRowsToBulkDataEntryPlugin
simonadomnisoru 5192d30
chore: improve the Plugin interface
simonadomnisoru 6a4aca5
Merge branch 'master' into DHIS2-18889
simonadomnisoru 434b166
Merge branch 'DHIS2-18889' into DHIS2-19024
simonadomnisoru d68f8ef
chore: fix sonarqube warnings
simonadomnisoru 648b202
Merge branch 'DHIS2-19024' into DHIS2-18603
simonadomnisoru 31fbedf
docs: update with lastest Plugin interface and DataStore config
simonadomnisoru 19538a2
docs: apply PR suggetions
simonadomnisoru 1e92c1d
chore: norwegian translation
simonadomnisoru da7559b
docs: improve pluginSource
simonadomnisoru d089388
Merge branch 'master' into DHIS2-18603
simonadomnisoru eb73da7
chore: improve wording
simonadomnisoru File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
37 changes: 37 additions & 0 deletions
37
docs/developer/bulk-data-entry-plugin/developer-details.mdx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| --- | ||
| title: Developer Details (Bulk Data Entry Plugin) | ||
| sidebar_label: Developer details | ||
| id: developer-details | ||
| --- | ||
|
|
||
| Here are some details for developers who want to develop a bulk data entry plugin for the DHIS2 Capture app. | ||
|
|
||
| ## Plugin Interface | ||
|
|
||
| The plugin receives the following props: | ||
|
|
||
| ```ts | ||
| type BulkDataEntryPluginProps = {| | ||
| pluginSource: string, | ||
| configKey: string, | ||
| dataKey?: string, | ||
| onComplete: () => void, | ||
| onDefer: () => void, | ||
| trackedEntityIds?: Array<string>, | ||
| |}; | ||
| ``` | ||
|
|
||
| ### Exiting the Plugin | ||
|
|
||
| To exit the Plugin and return to the Program overview or Search pages, use the `onDefer` function provided as a prop. This will place the Plugin in an idle state until further action is taken. | ||
|
|
||
| ```ts | ||
| onDefer(); | ||
| ``` | ||
|
|
||
| ### Closing the Plugin | ||
|
|
||
| To ensure proper cleanup and resource management, use the `onComplete` function provided as a prop to close the plugin. This will clear the selected configuration from `IndexedDB`. | ||
| ```ts | ||
| onComplete(); | ||
| ``` |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| --- | ||
| title: What is the Bulk Data Entry Plugin? | ||
| sidebar_label: Introduction | ||
| id: introduction | ||
| --- | ||
|
|
||
| The Bulk Data Entry Plugin is an extension point that can be accessed through the Search page or Working list page in Capture app. This extension point enables developers to create and configure plugins for custom bulk operations on tracked entities carried over from the working list page or added manually in the plugin itself. | ||
| The main reason for developing this extension point in the DHIS2 Capture app was to support a plugin for bulk data entry in a grid form, adding new events to all tracked entities in a list, including applying same values for a column or copy and pasting values from a row to another. The aim is to reduce time spent on data entry, for example secondary from paper forms. | ||
|
|
||
| Some plugin use cases for the extension point can include: | ||
|
|
||
| 1. Enter data for multiple tracked entities at the same time (Forthcoming core Capture plugin) | ||
| 2. Validate and update data across multiple tracked entity records simultaneously | ||
| 3. Update the status of multiple events in one go | ||
| 4. Merging or deduplicating tracked entities | ||
| 5. Any other custom bulk operations or changes your workflow might require |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,108 @@ | ||
| --- | ||
| title: Manual Setup (Bulk Data Entry Plugin) | ||
| sidebar_label: Manual setup | ||
| id: manual-setup | ||
| --- | ||
|
|
||
| To enable bulk data entry functionality, you need to configure the data store in your DHIS2 instance. Follow these steps: | ||
|
|
||
| 1. Access your DHIS2 Data Store Management app | ||
| 2. Create a new key called `bulkDataEntry` in the `capture` namespace | ||
| 3. The data store interface should look similar to this: | ||
|
|
||
|  | ||
|
|
||
| ## Configuration Structure | ||
|
|
||
| In the `bulkDataEntry` key you created, you can store your bulk data entry form configurations. The structure is as follows: | ||
|
|
||
| ```json title="capture/bulkDataEntry" | ||
| { | ||
| "version": 1, | ||
| "config": [] | ||
| } | ||
| ``` | ||
|
|
||
| The `version` field indicates the configuration version as a number. The `config` array contains one or more bulk data entry configuration objects. Below is an example showcasing three different configurations: | ||
|
|
||
| ```json title="capture/bulkDataEntry" | ||
| { | ||
| "version": 1, | ||
| "config": [ | ||
| { | ||
| "title": { | ||
| "en": "Routine visit" | ||
| }, | ||
| "dataKey": "routineVisit", | ||
| "subtitle": { | ||
| "en": "Covers all patient visit forms" | ||
| }, | ||
| "configKey": "routineVisit", | ||
| "programId": "IpHINAT79UW", | ||
| "pluginSource": "https://debug.dhis2.org/dev/api/apps/routine-visit/plugin.html" | ||
| }, | ||
| { | ||
| "title": { | ||
| "es": "Tratamiento", | ||
| "en": "Treatment", | ||
| "fr": "Traitement", | ||
| "nb": "Behandling" | ||
| }, | ||
| "configKey": "treatment", | ||
| "programId": "IpHINAT79UW", | ||
| "pluginSource": "https://debug.dhis2.org/dev/api/apps/treatment/plugin.html" | ||
| }, | ||
| { | ||
| "title": { | ||
| "en": "Case based surveillance" | ||
| }, | ||
| "subtitle": { | ||
| "en": "Covers ad-hoc visits and RMNCH238972" | ||
| }, | ||
| "configKey": "caseBasedSurveillance", | ||
| "programId": "uy2gU8kT1jF", | ||
| "pluginSource": "https://debug.dhis2.org/dev/api/apps/case-based-surveillance/plugin.html" | ||
| } | ||
| ] | ||
| } | ||
| ``` | ||
|
|
||
| ### Configuration Fields | ||
|
|
||
| Each configuration object requires the following fields: | ||
|
|
||
| | Field | Required | Description | | ||
| |-------|----------|-------------| | ||
| | `configKey` | Yes | An identifier for the configuration. Must be unique per `programId`. Will be passed to the plugin. | | ||
| | `programId` | Yes | The identifier of the program where this bulk data entry will be available. | | ||
| | `pluginSource` | Yes | The URL of the plugin. Must point to a valid plugin installed on the instance and follow the pattern: https://{instance-url}/api/apps/{plugin-name}/plugin.html. | | ||
| | `title` | Yes | The display title of the configuration. Supports multiple languages using locale codes (e.g., "en", "es"). | | ||
| | `subtitle` | No | An optional subtitle for the configuration. Supports multiple languages using locale codes. | | ||
| | `dataKey` | No | An optional identifier that is not used internally by the app but is passed through to the plugin. This property is intended for advanced usage and can be used by the plugin to maintain separate in-progress caches for a given `configKey`. | | ||
|
|
||
| ## Selecting a Plugin Configuration | ||
|
|
||
| Once configured, bulk data entry plugins are accessible in multiple locations throughout the Capture app. You'll find them displayed as widgets on both the Program overview and Search pages: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| The plugins can also be accessed via dropdown menus from the tracked entities working lists or the program stages working lists: | ||
|
|
||
|  | ||
|  | ||
|
|
||
| After the user selects a plugin configuration, it is stored in `IndexedDB` for the duration of use. | ||
|
|
||
| ### Passing Tracked Entities to the Plugin | ||
|
|
||
| The plugin receives tracked entities through the `trackedEntityIds` prop - an array containing the IDs of selected tracked entities. | ||
|
|
||
| ### Cleanup and Disposal | ||
|
|
||
| To exit the Plugin and return to the Program overview or Search pages, use the `onDefer` function provided as a prop. This will place the Plugin in an idle state until further action is taken. | ||
|
|
||
|  | ||
|  | ||
|
|
||
| To ensure proper cleanup and resource management, use the `onComplete` function provided as a prop to close the plugin. This will clear the selected configuration from `IndexedDB`. | ||
Binary file added
BIN
+171 KB
docs/developer/resources/data-store-management-bulk-data-entry-empty.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+345 KB
...veloper/resources/dropdown-menu-bulk-data-entry-program-stage-working-lists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+264 KB
...oper/resources/dropdown-menu-bulk-data-entry-tracked-entities-working-lists.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.