diff --git a/README.md b/README.md index 66d08c1..585691a 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/d2.config.js b/d2.config.js index fb32d27..7941f95 100644 --- a/d2.config.js +++ b/d2.config.js @@ -1,6 +1,6 @@ const config = { type: 'app', - + title: "FHIR IG Generator App", entryPoints: { app: './src/App.js', }, diff --git a/public/assets/ProgramLogicalModel.fsh.handlebars b/public/assets/ProgramLogicalModel.fsh.handlebars index cfa0ceb..383fc1c 100644 --- a/public/assets/ProgramLogicalModel.fsh.handlebars +++ b/public/assets/ProgramLogicalModel.fsh.handlebars @@ -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}} \ No newline at end of file diff --git a/public/assets/ProgramStageLogicalModel.fsh.handlebars b/public/assets/ProgramStageLogicalModel.fsh.handlebars index 1950bde..8223234 100644 --- a/public/assets/ProgramStageLogicalModel.fsh.handlebars +++ b/public/assets/ProgramStageLogicalModel.fsh.handlebars @@ -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}} diff --git a/public/assets/ig.zip b/public/assets/ig.zip index fc53aa3..8acf2b7 100644 Binary files a/public/assets/ig.zip and b/public/assets/ig.zip differ diff --git a/public/images/ig-config-form.png b/public/images/ig-config-form.png new file mode 100644 index 0000000..2f35403 Binary files /dev/null and b/public/images/ig-config-form.png differ diff --git a/public/images/ig-result.png b/public/images/ig-result.png new file mode 100644 index 0000000..73454f7 Binary files /dev/null and b/public/images/ig-result.png differ diff --git a/public/images/overview.png b/public/images/overview.png new file mode 100644 index 0000000..7740be7 Binary files /dev/null and b/public/images/overview.png differ diff --git a/src/components/IGConfigForm.js b/src/components/IGConfigForm.js index df8c154..be04b97 100644 --- a/src/components/IGConfigForm.js +++ b/src/components/IGConfigForm.js @@ -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", }, }} > @@ -103,7 +103,7 @@ const IGConfigForm = ({ onSubmit }) => { component={InputFieldFF} className={styles.inputField} validate={hasValue} - helpText="Default: Example Publisher" + helpText="Default: DHIS2" />
@@ -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" />
diff --git a/src/tests/resources/expectedTbProgram.fsh b/src/tests/resources/expectedTbProgram.fsh index 51b9bbc..cdd79dc 100644 --- a/src/tests/resources/expectedTbProgram.fsh +++ b/src/tests/resources/expectedTbProgram.fsh @@ -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) diff --git a/src/tests/resources/mockTbProgram.json b/src/tests/resources/mockTbProgram.json index 2de1f6b..431449f 100644 --- a/src/tests/resources/mockTbProgram.json +++ b/src/tests/resources/mockTbProgram.json @@ -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" }