diff --git a/.gitignore b/.gitignore index 6570aa5..20cabf7 100644 --- a/.gitignore +++ b/.gitignore @@ -2,4 +2,5 @@ node_modules .d2 src/locales -build \ No newline at end of file +build +.idea diff --git a/README.md b/README.md index 66d08c1..4658839 100644 --- a/README.md +++ b/README.md @@ -1,45 +1,55 @@ -This project was bootstrapped with [DHIS2 Application Platform](https://github.com/dhis2/app-platform). +# Capture Growth Charts + +A plugin for displaying growth charts in the Capture app. +The plugin is based on the [WHO growth standards](https://www.who.int/childgrowth/standards/en/) and is intended to be used in the context of child growth monitoring or nutrition programs. + +## Features + +- Display growth charts for weight-for-age, height-for-age, weight-for-height, and head circumference-for-age. +- Display growth charts for children aged 0-5 years. +- Easily switch between different growth charts. +- Create printed copies for parents or health workers. + +## Installation + +1. Download the latest version of the plugin from the [App hub](https://apps.dhis2.org). +2. Upload the plugin to your DHIS2 instance. +3. Configure the capture app to display the growth charts in the correct context. +4. Map required data elements and attributes to the growth chart plugin. + +## Configuration + +The plugins expect a configuration object to be found in the Data Store. The configuration object tells the plugin which data elements and attributes to use when calculating the growth charts. + +The configuration object should look something like this: + +```json +{ + "metadata": { + "attributes": { + "dateOfBirth": "AMl8BkN8Lyq", + "gender": "tyNlJWNnEbs", + "firstName": "Sx5Gd4JfPrL", + "lastName": "sljlq9XtqaA", + "femaleOptionCode": "CGC_Female", + "maleOptionCode": "CGC_Male" + }, + "dataElements": { + "headCircumference": "GfchA70xtmP", + "height": "wWCSulSdUgd", + "weight": "yZwKJdYXTZF" + }, + "program": { + "programStageId": "h3gT08Et4sC" + } + }, + "settings": { + "usePercentiles": false, + "weightInGrams": false + } +} + +``` + +Want to read more in details of how to configure the plugin? Check out the [documentation](https://github.com/dev-otta/dhis2-who-growth-chart/blob/master/docs/using-capture-growth-charts.md) in our user guide. -## Available Scripts - -In the project directory, you can run: - -### `yarn start` - -Runs the app in the development mode.
-Open [http://localhost:3000](http://localhost:3000) to view it in the browser. - -The page will reload if you make edits.
-You will also see any lint errors in the console. - -### `yarn test` - -Launches the test runner and runs all available tests found in `/src`.
- -See the section about [running tests](https://platform.dhis2.nu/#/scripts/test) for more information. - -### `yarn build` - -Builds the app for production to the `build` folder.
-It correctly bundles React in production mode and optimizes the build for the best performance. - -The build is minified and the filenames include the hashes.
-A deployable `.zip` file can be found in `build/bundle`! - -See the section about [building](https://platform.dhis2.nu/#/scripts/build) for more information. - -### `yarn deploy` - -Deploys the built app in the `build` folder to a running DHIS2 instance.
-This command will prompt you to enter a server URL as well as the username and password of a DHIS2 user with the App Management authority.
-You must run `yarn build` before running `yarn deploy`.
- -See the section about [deploying](https://platform.dhis2.nu/#/scripts/deploy) for more information. - -## Learn More - -You can learn more about the platform in the [DHIS2 Application Platform Documentation](https://platform.dhis2.nu/). - -You can learn more about the runtime in the [DHIS2 Application Runtime Documentation](https://runtime.dhis2.nu/). - -To learn React, check out the [React documentation](https://reactjs.org/). diff --git a/d2.config.js b/d2.config.js index 23cee57..f09673d 100644 --- a/d2.config.js +++ b/d2.config.js @@ -1,6 +1,9 @@ const config = { type: 'app', name: 'capture-growth-chart', + title: 'Capture Growth Chart', + description: 'A plugin for displaying growth charts in the Capture app', + minDHIS2Version: '2.38', entryPoints: { plugin: './src/Plugin.tsx' }, };