Skip to content

Commit

Permalink
feat: add readme
Browse files Browse the repository at this point in the history
  • Loading branch information
eirikhaugstulen committed May 12, 2024
1 parent 31e67f5 commit 7e9d980
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 45 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@
node_modules
.d2
src/locales
build
build
.idea
98 changes: 54 additions & 44 deletions README.md
Original file line number Diff line number Diff line change
@@ -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.<br />
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.<br />
You will also see any lint errors in the console.

### `yarn test`

Launches the test runner and runs all available tests found in `/src`.<br />

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.<br />
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.<br />
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.<br />
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.<br/>
You must run `yarn build` before running `yarn deploy`.<br />

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/).
3 changes: 3 additions & 0 deletions d2.config.js
Original file line number Diff line number Diff line change
@@ -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' },
};
Expand Down

0 comments on commit 7e9d980

Please sign in to comment.