Skip to content

Commit

Permalink
Merge pull request #13 from dhis2/INTEROP-57
Browse files Browse the repository at this point in the history
docs: prepare for App Hub submission
  • Loading branch information
JohanGHole authored Jan 13, 2025
2 parents 91aa496 + a776d3c commit 7333dbc
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 10 deletions.
55 changes: 55 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,58 @@
## DHIS2 Implementation Guide Generator App
The IG Generator app enables users to create FHIR Implementation Guides (IGs) based on DHIS2 tracker program metadata. The app allows users to set the configuration of an IG, select tracker programs, and transform the DHIS2 tracker metadata into FHIR artifacts. The app generates a local IG bundle, ready to be built with external tools like [SUSHI](https://github.com/FHIR/sushi). A DHIS2 instance with tracker metadata is required, and the app is designed as a tool to simplify IG authoring.

![Tracker Program Selector](public/images/overview.png)

## Building the Generated Implementation Guide (IG)

After using the IG Generator app, you will have a downloaded, zipped IG bundle. Follow the steps below to build the IG and view its contents:

### 1. **Unzip the Generated IG Bundle**
- Extract the downloaded ZIP file into a directory of your choice.

### 2. **Set Up Required Tools**
Ensure the following tools are installed and available in your environment:
- **[SUSHI](https://github.com/FHIR/sushi)**: For compiling FHIR Shorthand into FHIR definitions.
```bash
npm install -g fsh-sushi
```
- **[Java JDK](https://www.oracle.com/java/technologies/downloads/)** (version 17 or higher): Required for running the IG Publisher.
- **[Ruby](https://www.ruby-lang.org/en/downloads/)** and **[Jekyll](https://jekyllrb.com/docs/installation/)**: Required for the IG Publisher.

### 3. **Run the IG Publisher**
The IG Publisher will generate the IG content, validate it, and create a browsable website.

#### **Steps:**
1. Open a terminal and navigate to the extracted IG directory.
```bash
cd path/to/ig
```
2. Run the `_updatePublisher` script to download the latest version of the IG Publisher:
- **Linux/macOS**:
```bash
./_updatePublisher.sh
```
- **Windows**:
```cmd
_updatePublisher.bat
```
3. Run the `_genonce` script to generate the IG content:
- **Linux/macOS**:
```bash
./_genonce.sh
```
- **Windows**:
```cmd
_genonce.bat
```

### 4. **View the Generated IG**
1. Navigate to the `output` folder in the extracted IG directory.
2. Open the `index.html` file in a web browser.
3. Explore the IG, including the **Artifacts** tab, to view all generated FHIR artifacts.

---

This project was bootstrapped with [DHIS2 Application Platform](https://github.com/dhis2/app-platform).

## Available Scripts
Expand Down
2 changes: 1 addition & 1 deletion d2.config.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
const config = {
type: 'app',

title: "FHIR IG Generator App",
entryPoints: {
app: './src/App.js',
},
Expand Down
4 changes: 2 additions & 2 deletions public/assets/ProgramLogicalModel.fsh.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ Description: "{{description}}"
* enrollmentDate 1..1 date "{{enrollmentDateLabel}}"
* incidentDate 0..1 date "{{incidentDateLabel}}"
{{#programTrackedEntityAttributes}}
* {{toFhirDataElementName trackedEntityAttribute}} {{toFhirCardinality mandatory}}..1 {{toFhirDataType trackedEntityAttribute.valueType trackedEntityAttribute.optionSet}} "{{toFhirElementDescription trackedEntityAttribute}}"
* {{toFhirDataElementName trackedEntityAttribute}} {{toFhirCardinality mandatory}}..1 {{toFhirDataType trackedEntityAttribute.valueType trackedEntityAttribute.optionSet}} "{{{toFhirElementDescription trackedEntityAttribute}}}"
{{#if trackedEntityAttribute.optionSet}}
* {{toFhirDataElementName trackedEntityAttribute}} from {{toPascalCase trackedEntityAttribute.optionSet.name}}VS (required)
{{/if}}
{{/programTrackedEntityAttributes}}
{{#programStages}}
* {{toCamelCase name}} 0..{{isRepeatable repeatable}} {{toPascalCase name}} "{{toFhirElementDescription this}}"
* {{toCamelCase name}} 0..{{isRepeatable repeatable}} {{toPascalCase name}} "{{{toFhirElementDescription this}}}"
{{/programStages}}
2 changes: 1 addition & 1 deletion public/assets/ProgramStageLogicalModel.fsh.handlebars
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Description: "{{description}}"
{{/if}}
* executionDate 0..1 date "{{displayExecutionDateLabel}}"
{{#programStageDataElements}}
* {{toFhirDataElementName dataElement}} {{toFhirCardinality compulsory}}..1 {{toFhirDataType dataElement.valueType dataElement.optionSet}} "{{toFhirElementDescription dataElement}}"
* {{toFhirDataElementName dataElement}} {{toFhirCardinality compulsory}}..1 {{toFhirDataType dataElement.valueType dataElement.optionSet}} "{{{toFhirElementDescription dataElement}}}"
{{#if dataElement.optionSet}}
* {{toFhirDataElementName dataElement}} from {{toPascalCase dataElement.optionSet.name}}VS (required)
{{/if}}
Expand Down
Binary file modified public/assets/ig.zip
Binary file not shown.
Binary file added public/images/ig-config-form.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 public/images/ig-result.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 public/images/overview.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/IGConfigForm.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ const IGConfigForm = ({ onSubmit }) => {
version: "0.1.0",
releaseLabel: "ci-build",
publisher: {
name: "Example Publisher",
url: "http://example.org/example-publisher",
name: "DHIS2",
url: "https://dhis2.org",
},
}}
>
Expand Down Expand Up @@ -103,7 +103,7 @@ const IGConfigForm = ({ onSubmit }) => {
component={InputFieldFF}
className={styles.inputField}
validate={hasValue}
helpText="Default: Example Publisher"
helpText="Default: DHIS2"
/>
</div>
<div className={styles.row}>
Expand All @@ -114,7 +114,7 @@ const IGConfigForm = ({ onSubmit }) => {
component={InputFieldFF}
className={styles.inputField}
validate={hasValue}
helpText="Default: http://example.org/example-publisher"
helpText="Default: https://dhis2.org"
/>
</div>

Expand Down
2 changes: 1 addition & 1 deletion src/tests/resources/expectedTbProgram.fsh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Title: "TB program"
Parent: Base
* enrollmentDate 1..1 date "Start of treatment date"
* incidentDate 0..1 date "Start of treatment date"
* firstName 1..1 string "First name"
* firstName 1..1 string "This is the person's first name"
* lastName 1..1 string "Last name"
* gender 1..1 code "Gender"
* gender from GenderVS (required)
Expand Down
2 changes: 1 addition & 1 deletion src/tests/resources/mockTbProgram.json
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@
"trackedEntityAttribute": {
"name": "First name",
"shortName": "First name",
"description": "First name",
"description": "This is the person's first name",
"valueType": "TEXT",
"displayName": "First name"
}
Expand Down

0 comments on commit 7333dbc

Please sign in to comment.