diff --git a/.github/workflows/RenderAllDiagrams.yml b/.github/workflows/RenderAllDiagrams.yml
new file mode 100644
index 0000000..9e36638
--- /dev/null
+++ b/.github/workflows/RenderAllDiagrams.yml
@@ -0,0 +1,84 @@
+name: Render All Diagrams
+
+on:
+ push:
+ paths:
+ - '**/Material/imgsrc/**/*.puml'
+ - '**/Material/imgsrc/**/*.drawio'
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+
+ # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ # Installs Java distribution for running the plantUML jar
+ - name: Install Java
+ uses: actions/setup-java@v3
+ with:
+ distribution: 'temurin'
+ java-version: '17'
+ check-latest: true
+
+ # Install graphviz for plantuml
+ - name: Setup Graphviz
+ uses: ts-graphviz/setup-graphviz@v1
+
+ # Download plantUML jar
+ - name: Download plantuml file
+ run: |
+ wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/download/lastest/plantuml.jar"
+
+ # Clean Folder
+ name: Ensure and clean folder
+ run: |
+ imagedir=ImplementationGuide/diagrams
+ mkdir -p $imagedir
+ rm -rf ImplementationGuide/diagrams/*.svg
+
+ # Generate the SVGs from PUML
+ - name: Render PUML to SVG and Move files
+ run: |
+ imagedir=ImplementationGuide/diagrams
+ FileNamePaths=$(find . -path "*/imgsrc/*/*.puml" -exec dirname {} \; | sort -u)
+ for dir in $FileNamePaths
+ do
+ # Render SVGs from PUMLs
+ find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \;
+
+ # Move SVGs to out directory
+ find $dir -name "*.svg" -exec mv {} $out_dir \;
+ done
+
+ # Generate the SVGs from DrawIO
+ - name: Render DrawIO to SVG with predefined action
+ uses: rlespinasse/drawio-export-action@v2
+ with:
+ path: ./Material/imgsrc/drawio/
+ output: .
+ format: svg
+ action-mode: all
+
+ # copies the created png & svg files to the images/diagrams folder and deletes the drawio files
+ - name: Copy draw io
+ run: |
+ imagedir=ImplementationGuide/images/diagrams
+ cp -RT ./Material/imgsrc/drawio/ $imagedir
+ find $imagedir -name '*.drawio' -exec rm -rv {} \;
+ tree ./images
+
+ # add and commit the new generated files
+ - name: Commit and push
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add -A
+ git commit -m "Add rendered PlantUML and DrawIO to SVG diagrams" || exit 0
+ git push
diff --git a/.github/workflows/RenderPlantUML.yml b/.github/workflows/RenderPlantUML.yml
new file mode 100644
index 0000000..d9ed9de
--- /dev/null
+++ b/.github/workflows/RenderPlantUML.yml
@@ -0,0 +1,46 @@
+name: Render PlantUML diagrams
+
+on:
+ push:
+ paths:
+ - '**/Material/imgsrc/**/*.puml'
+
+ # Allows you to run this workflow manually from the Actions tab
+ workflow_dispatch:
+
+jobs:
+ build:
+ runs-on: ubuntu-latest
+
+ steps:
+ - name: Checkout repository
+ uses: actions/checkout@v3
+
+ - name: Install dependencies
+ run: |
+ sudo apt-get install -y graphviz
+ wget -O plantuml.jar "https://github.com/plantuml/plantuml/releases/download/lastest/plantuml.jar"
+
+ - name: Render and Move SVG files
+ run: |
+ # Find all unique directories containing *.puml files under any /imgsrc/ folder
+ directories=$(find . -path "*/imgsrc/*/*.puml" -exec dirname {} \; | sort -u)
+ for dir in $directories; do
+ # Generate the corresponding out directory path
+ out_dir=ImplementationGuide/diagrams
+ mkdir -p $out_dir
+
+ # Render SVGs from PUMLs
+ find $dir -name "*.puml" -exec java -jar plantuml.jar -tsvg {} \;
+
+ # Move SVGs to out directory
+ find $dir -name "*.svg" -exec mv {} $out_dir \;
+ done
+
+ - name: Commit and push
+ run: |
+ git config --local user.email "action@github.com"
+ git config --local user.name "GitHub Action"
+ git add -A
+ git commit -m "Add rendered PlantUML to SVG diagrams" || exit 0
+ git push
\ No newline at end of file
diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml
index 6db33ce..61545d7 100644
--- a/.github/workflows/main.yml
+++ b/.github/workflows/main.yml
@@ -4,11 +4,11 @@ name: CI (FHIR Validation)
# Controls when the action will run.
on:
- # Triggers the workflow on push or pull request events but only for the master branch
+ # Triggers the workflow on all push or pull request events but only for the main branches
push:
- branches: [ master ]
+ branches: [ main* ]
pull_request:
- branches: [ master ]
+ branches: [ main* ]
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
@@ -38,7 +38,6 @@ jobs:
JAVA_VALIDATION_ENABLED: true
OUTPUT_FORMAT: RAW
JAVA_VALIDATION_OPTIONS: -allow-example-urls true
- JAVA_VALIDATOR_VERSION: 6.0.11
SIMPLIFIER_USERNAME: ${{ secrets.SIMPLIFIER_USERNAME }}
SIMPLIFIER_PASSWORD: ${{ secrets.SIMPLIFIER_PASSWORD }}
SUSHI_ENABLED: true
@@ -46,6 +45,11 @@ jobs:
SUSHI_OPTIONS: Resources/
EXPECTED_FAILS: VALIDATION_CONFORMANCE_DOTNET VALIDATION_CONFORMANCE_JAVA VALIDATION_EXAMPLES_JAVA
+ # - name: Add & Commit
+ # uses: EndBug/add-and-commit@v7
+ # with:
+ # add: 'Resources/fsh-generated/resources/'
+
- name: Check for Uncommitted Changes
run: |
git diff --exit-code 'Resources/fsh-generated/resources'|| (echo "Es gibt Änderungen durch die Pipeline. Lokale Sushi Konfiguration prüfen!" && exit 1)
\ No newline at end of file
diff --git a/.vscode/keybindings.json b/.vscode/keybindings.json
new file mode 100644
index 0000000..79192d7
--- /dev/null
+++ b/.vscode/keybindings.json
@@ -0,0 +1,11 @@
+[
+ {
+ "key": "f5",
+ "command": "workbench.action.tasks.runTask",
+ "args": "buildWithReplaceIncludes"
+ },
+ {
+ "key": "f5",
+ "command": "-workbench.action.debug.start"
+ }
+]
diff --git a/.vscode/tasks.json b/.vscode/tasks.json
new file mode 100644
index 0000000..7359920
--- /dev/null
+++ b/.vscode/tasks.json
@@ -0,0 +1,15 @@
+{
+ "version": "2.0.0",
+ "tasks": [
+ {
+ "label": "buildWithReplaceIncludes",
+ "type": "shell",
+ "command": "./resources/scripts/build_with_replace_includes.sh",
+ "problemMatcher": [],
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ }
+ }
+ ]
+}
diff --git a/ImplementationGuide/diagrams/component.svg b/ImplementationGuide/diagrams/component.svg
new file mode 100644
index 0000000..b7f47e1
--- /dev/null
+++ b/ImplementationGuide/diagrams/component.svg
@@ -0,0 +1 @@
+
\ No newline at end of file
diff --git a/Gematik_Logo_Flag.png b/ImplementationGuide/images/Gematik_Logo_Flag.png
similarity index 100%
rename from Gematik_Logo_Flag.png
rename to ImplementationGuide/images/Gematik_Logo_Flag.png
diff --git a/Material/docs/Beispiel_MedikationsAbgleich.xlsx b/Material/docs/Beispiel_MedikationsAbgleich.xlsx
new file mode 100644
index 0000000..8d7eb95
Binary files /dev/null and b/Material/docs/Beispiel_MedikationsAbgleich.xlsx differ
diff --git a/Material/imgsrc/drawio/Klassendiagramm.drawio b/Material/imgsrc/drawio/Klassendiagramm.drawio
new file mode 100644
index 0000000..c6d9cc5
--- /dev/null
+++ b/Material/imgsrc/drawio/Klassendiagramm.drawio
@@ -0,0 +1 @@
+7V1rc+I2FP01zLSdgbH8Aj4Gstk+sm3atJu23wwWoI2xqC2WkF9fyZaxLYEfiR/AOpMJ0bUtyzpXukdHkulp0/XLR8/arD5hGzo9VbFfetptT1UBGI7oB7PsQ8tQUULD0kM2Pyk2PKJXyI3RaVtkQz91IsHYIWiTNs6x68I5Sdksz8O79GkL7KTvurGWUDI8zi1Htj4hm6xC60gdxvYfIVquojsDcxweWVvRyfxJ/JVl413CpH3oaVMPYxL+t36ZQodVXlQvTz/tn5z7Z/Pjz7/7/1l/TX7589fP/TCzuzKXHB7Bgy55c9avz4u7Hz/rX/7ePNz9vlM+3sx+7vNLlK+Ws+X19Qna6NkiCLt+/x75BPKHJ/uoRv0dWjuWS1OTBXbJIz+i0LTloKVL/5/TgkKPGr5CjyAKxg0/QPCGWucr5Nj31h5v2eP4xJo/R6nJCnvolWZrOfQQoAZ62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XREdysLs4OiJLmR0dKUNHcvyhJjoiLInsm3pjDlPgjYFn8Na0uhfPNE4gpJeYvZFARHpCvCRBkOXORwpRR8eLWqsUosuC83VxjxMr/arlHuLbl/qNab+6rP1eE/vIRq9a9tE8drIM2ZGRUmQk2z1qIiNiW2+QjFzKsuA+e5FKJIaE64JNPVonfEYLg3nwy18YXPKdfhW9ElZalyJ0TYVJEMjJ6IxIkLjZSm/gNSqGLFJfFwlqZO1veyTIuOrVvzno1UKC1NyGXRl2svjZkaBSJKiVZcBDYXNJYxzIOLYK2HSYQ8zoP8twY1hoQJHhCSIKOdtke2sR6OLZF/jMvv9V+e51MBnQz9+8peUiP9hzTUmTSsum3Fnz1QZ6fmy52S7Yi5DZxtrvmUsi16YfK0S9SVVet+zvDPo+vRO9QGHuO57OaA5oviIO/fNMi0EPuCxNP20WdX1CH5oMoiLTOkHiY1Bb4tFKNwZrS7DPXbBUM5BbUfJ76XhrCF0+s4lkN6dCHeMbtm2rab83ouiU2NQ3jAJ/alNf+S9goMn4y5JDR4+/clr78D8=
\ No newline at end of file
diff --git a/Material/imgsrc/plantuml/amts_data_objects.puml b/Material/imgsrc/plantuml/amts_data_objects.puml
new file mode 100644
index 0000000..ae92f0a
--- /dev/null
+++ b/Material/imgsrc/plantuml/amts_data_objects.puml
@@ -0,0 +1,10 @@
+```plantuml
+@startuml component_example
+actor client
+node app
+database db
+
+db -> app
+app -> client
+@enduml
+```
\ No newline at end of file
diff --git a/README.md b/README.md
index 1119369..28e851f 100644
--- a/README.md
+++ b/README.md
@@ -1,3 +1,5 @@
+![Include Gematik Logo](ImplementationGuide/images/Gematik_Logo_Flag.png)
+
# About
This template standardizes the development of fhir resources with .fsh resources. It should reduce time for setup and ease the development process.
diff --git a/plantuml.jar b/plantuml.jar
new file mode 100644
index 0000000..0e402de
Binary files /dev/null and b/plantuml.jar differ
diff --git a/scripts/build_with_replace_includes.sh b/scripts/build_with_replace_includes.sh
new file mode 100644
index 0000000..745893f
--- /dev/null
+++ b/scripts/build_with_replace_includes.sh
@@ -0,0 +1,67 @@
+#!/bin/bash
+echo "Start building source files"
+
+# check prerequisites
+required_asciidoctor_version="2.0.20"
+actual_asciidoctor_version=$(asciidoctor --version)
+if ! grep -q "$required_asciidoctor_version" <<<"$actual_asciidoctor_version"; then
+ echo "Incorrect asciidoctor version. Expected $required_asciidoctor_version but found $actual_asciidoctor_version"
+ exit 1
+fi
+
+required_asciidoctor_diagram_version="2.2.14"
+actual_asciidoctor_diagram_version=$(gem list | grep "asciidoctor-diagram (")
+if ! grep -q "$required_asciidoctor_diagram_version" <<<"$actual_asciidoctor_diagram_version"; then
+ echo "Incorrect asciidoctor diagram version. Expected $required_asciidoctor_diagram_version but found $actual_asciidoctor_diagram_version"
+ exit 1
+fi
+
+# STAGE_1: creates images from the puml files and will store them in /puml/images
+
+# prepare
+cd "$(dirname "$0")" || exit
+# rm ../../images/puml_*
+
+# loop through all puml files and create the image
+for filename in $(find ../../puml -name '*.puml'); do
+
+ filebase=$(basename -- "$filename") # test.adoc
+ name="${filebase%.*}" # test
+
+ if ! git diff --quiet -- "$filename"; then
+ echo "$filebase has been modified. Creating Puml"
+
+ pumlPath=../puml/${name}.puml
+ newFileRoot=../puml/${name}
+ newFileName=${newFileRoot//-source/}
+ echo "Creating Puml ${name}"
+
+ tempAdocFile=../../docs_sources/${name}.adoc
+
+ # creates a temporary adoc file in order to render with asciidoctor-diagram
+ touch ${tempAdocFile}
+ echo "[plantuml, target=../../images/puml_${name}, format=png]
+....
+include::${pumlPath}[]
+...." >${tempAdocFile}
+ asciidoctor -r asciidoctor-diagram -o ../puml/$newFileName ../../docs_sources/${name}.adoc
+ rm ../../docs_sources/${name}.adoc
+ fi
+
+done
+
+# cleanup temp files
+if [ -d "../puml" ]; then
+ rm -r ../puml
+fi
+
+# STAGE_2 this creates new adoc files in /docs/resources
+
+for filename in $(find ../../docs_sources -name '*.adoc'); do
+ newFileName=${filename//-source/}
+ newFileName=${newFileName//_sources/}
+ asciidoctor-reducer $filename -o $newFileName
+done
+
+# Echo that the process is finished
+echo "Finished building source files"
diff --git a/scripts/release_publish.py b/scripts/release_publish.py
new file mode 100644
index 0000000..92e9cca
--- /dev/null
+++ b/scripts/release_publish.py
@@ -0,0 +1,170 @@
+import re
+import subprocess
+import os
+import argparse
+from datetime import date
+
+class FileWithVersionToUpdate:
+ def __init__(self, filename, version_regex) -> None:
+ self.filename = filename
+ self.version_regex = version_regex
+ self.location = None
+
+ def set_file_location(self, location):
+ self.location = location
+
+class FileWithDateToUpdate:
+ def __init__(self, filename, date_regex) -> None:
+ self.filename = filename
+ self.date_regex = date_regex
+ self.location = None
+
+ def set_file_location(self, location):
+ self.location = location
+
+# class FileWithDateToUpdate:
+# def __init__(self, filename, date_regex, format) -> None:
+# self.filename = filename
+# self.date_regex = date_regex
+# self.location = None
+# self.format = format
+# def set_file_location(self, location):
+# self.location = location
+
+
+
+
+def get_new_release_version_from_branch_name() -> str:
+ git_branch = subprocess.check_output(['git', 'rev-parse', '--abbrev-ref', 'HEAD']).strip().decode()
+ return git_branch
+
+def replace_version_in_files(files : list, new_release_version: str):
+ if files is None:
+ print("Error: No Files found!")
+ return
+
+ for file in files:
+ replace_version_in_file(file,new_release_version)
+
+def replace_version_in_file(file: FileWithVersionToUpdate,new_release_version: str):
+ with open(file.location, 'r') as input_file:
+ input_text = input_file.read()
+
+ output_text = re.sub(file.version_regex, rf'\g<1>{new_release_version}\g<3>', input_text)
+ print(f"Info: Replaced version with '{new_release_version}' in file '{file.location}'.")
+
+ with open(file.location, 'w') as output_file:
+ output_file.write(output_text)
+
+def replace_date_in_files(files : list, new_release_date: str):
+ if files is None:
+ print("Error: No Files found!")
+ return
+
+ for file in files:
+ replace_date_in_file(file,new_release_date)
+
+def replace_date_in_file(file: FileWithVersionToUpdate, new_date: str):
+ with open(file.location, 'r') as input_file:
+ input_text = input_file.read()
+
+ #output_text = re.sub(file.date_regex, rf'\g<1>{new_date.strftime(file.format)}\g<3>', input_text) #see https://www.programiz.com/python-programming/datetime#:~:text=Python%20format%20datetime&text=It%27s%20more%20common%20to%20use,()%20methods%20to%20handle%20this.
+ output_text = re.sub(file.date_regex, rf'\g<1>{new_date}\g<3>', input_text)
+ print(f"Info: Replaced date with '{new_date}' in file '{file.location}'.")
+
+ with open(file.location, 'w') as output_file:
+ output_file.write(output_text)
+
+def get_file_to_update_version_list():
+ file_list = []
+ file_list.append(FileWithVersionToUpdate('package.json', r'("version":\s*")([\d\.]+.*)(")'))
+ file_list.append(FileWithVersionToUpdate('sushi-config.yaml', r'(version:\s*")(\d+\.\d+\.\d+.*)(")'))
+ file_list.append(FileWithVersionToUpdate('sushi-config.yaml', r'(version:\s*)(\d+\.\d+\.\d+.*)()'))
+ file_list.append(FileWithVersionToUpdate('ruleset.fsh', r'(\*\s*version\s*=\s*")([\d\.]+.*)(")'))
+ file_list.append(FileWithVersionToUpdate('ruleset.fsh', r'(\*\s*\^version\s*=\s*")([\d\.]+.*)(")'))
+ file_list.append(FileWithVersionToUpdate('Einfuehrung.md', r'(Version: \s*)(\d+\.\d+\.\d+.*)()'))
+ file_list.append(FileWithVersionToUpdate('ImplementierungsleitfadenIsiK_basismodul.json', r'("version":\s*")([\d\.]+.*)(")'))
+ file_list.append(FileWithVersionToUpdate('ImplementierungsleitfadenIsiK_Terminplanung.json', r'("version":\s*")([\d\.]+.*)(")'))
+ return file_list
+
+def get_file_to_update_date_list():
+ file_list = []
+ #file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(date\s*=\s*")(\d+\-\d+\-\d+)(")'), '%m/%d/%Y' )
+ #file_list.append(FileWithDateToUpdate('Einfuehrung.md', r'(Datum: \s*)(\d+\.\d+\.\d+)()') , '%m/%d/%Y')
+ file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(\*\s*date\s*=\s*")(\d+\-\d+\-\d+)(")'))
+ file_list.append(FileWithDateToUpdate('ruleset.fsh', r'(\*\s*\^date\s*=\s*")(\d+\-\d+\-\d+)(")'))
+ file_list.append(FileWithDateToUpdate('Einfuehrung.md', r'(Datum:\s*)(\d+\.\d+\.\d+.*)()'))
+ return file_list
+
+
+def locate_files_in_current_project(files: list):
+ return_list = []
+ for current_file in files:
+ file_location = find_file(current_file.filename, ".")
+ if file_location is not None:
+ current_file.set_file_location(file_location)
+ return_list.append(current_file)
+ else:
+ print(f"Warning: File '{current_file.filename}' not found.")
+ return return_list
+
+def find_file(name, path="."):
+ for root, dirs, files in os.walk(path):
+
+ if name in files:
+ print(f"Info: Found '{name}' in {root}.")
+ return os.path.join(root, name)
+ return None
+
+def get_latest_release_tag():
+ cmd = 'git describe --abbrev=0 --tags --match "v*.*.*" HEAD'
+ try:
+ output = subprocess.check_output(cmd, shell=True)
+ return output.decode().strip()
+ except subprocess.CalledProcessError:
+ return None
+
+def output_commit_messages_since_last_release():
+ latest_release_tag = get_latest_release_tag()
+ if latest_release_tag is None:
+ print("Warning: No release tag found.")
+ return
+
+ cmd = f'git log --pretty=format:"%s" {latest_release_tag}..HEAD'
+ try:
+ output = subprocess.check_output(cmd, shell=True)
+ print(output.decode())
+ except subprocess.CalledProcessError:
+ print("Warning: Failed to get commit messages.")
+
+def main():
+ today = date.today()
+
+ parser = argparse.ArgumentParser(description='Update release version number')
+ parser.add_argument('-b', '--branch', action='store_true', help='get new version from branch name')
+ parser.add_argument('-v', '--version', type=str, help='specify new version number')
+ parser.add_argument('-o', '--output', action='store_true', help='output commit messages since last release')
+ # TODO new argument -d if not date_time now
+
+ args = parser.parse_args()
+
+ if args.version:
+ new_release_version = args.version
+ elif args.branch:
+ new_release_version = get_new_release_version_from_branch_name()
+ else:
+ parser.error('No new release version specified. Please use either -v or -b to specify the new release version.')
+
+ if args.output:
+ output_commit_messages_since_last_release()
+
+ file_to_update_version_list = get_file_to_update_version_list()
+ file_version_list = locate_files_in_current_project(file_to_update_version_list)
+ replace_version_in_files(file_version_list, new_release_version)
+
+ file_to_update_date_list = get_file_to_update_date_list()
+ file_date_list = locate_files_in_current_project(file_to_update_date_list)
+ replace_date_in_files(file_date_list, today)
+
+if __name__ == "__main__":
+ main()
\ No newline at end of file
diff --git a/scripts/setup.sh b/scripts/setup.sh
index 849557a..196c20e 100644
--- a/scripts/setup.sh
+++ b/scripts/setup.sh
@@ -1,6 +1,10 @@
#!/bin/bash
rm ./Resources/input/fsh/*.fsh
rm ./Resources/fsh-generated/resources/*
+rm ./Material/docs/*
+rm ./Material/docs/imgsrc/drawio/*
+rm ./Material/docs/imgsrc/plantuml/*
+rm ./ImplementationGuide/diagrams/*
rm ./README.md
cat Readme_template.md USAGE.md > ./README.md
rm Readme_template.md