Skip to content

Commit

Permalink
initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
lisavasiljewa committed Sep 27, 2023
0 parents commit 7ecd4bd
Show file tree
Hide file tree
Showing 67 changed files with 3,230 additions and 0 deletions.
18 changes: 18 additions & 0 deletions .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[bumpversion]
current_version = 1.2.1-snapshot
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\-(?P<release>\S+))?
serialize =
{major}.{minor}.{patch}-{release}
{major}.{minor}.{patch}
commit = False
tag = False

[bumpversion:part:release]
optional_value = release
values =
snapshot
release

[bumpversion:file:sushi-config.yaml]
search = version: {current_version}
replace = version: {new_version}
2 changes: 2 additions & 0 deletions .fsh-validator.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
exclude_code_systems:
- http://fhir.de/CodeSystem/bfarm/icd-10-gm
59 changes: 59 additions & 0 deletions .github/workflows/fhir-validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
name: FHIR Validation

on:
push:
branches:
- main
- master
- staging
pull_request:
branches:
- main
- master
- staging

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

env:
LANG: "en_US.UTF-8"

jobs:

fsh-fhir-validation:
runs-on: ubuntu-latest
steps:

# locale must be set explicitly, otherwise fhir validator 5.7.75 fails
- name: set locale
run: |
sudo locale-gen en_US.UTF-8
sudo update-locale LANG=en_US.UTF-8
- name: Checkout code
uses: actions/checkout@v3

- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'

- name: Install Python dependencies
uses: py-actions/py-dependency-install@v2

- name: Setup Java JDK
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'

- name: Setup NodeJS
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Prepare environment
run: ./scripts/prepare-environment.sh

- name: Execute validator
run: fsh-validator --all
71 changes: 71 additions & 0 deletions .github/workflows/ig-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: ImplementationGuide Publisher

# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the main or master branch
push:
branches:
- main
- master
- staging
pull_request:
branches:
- main
- master
- staging

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

jobs:
run-publisher:
# The type of runner that the job will run on
runs-on: ubuntu-latest

steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v3

# read id, version and canonical from sushi-config.yaml
- name: Run read-yaml action
id: yaml-data
uses: CumulusDS/get-yaml-paths-action@v1.0.1
with:
file: sushi-config.yaml
version: version
canonical: canonical
id: id

# display outputs from read-yaml action
- name: Display read-yaml output
run: |
echo "id: ${{ steps.yaml-data.outputs.id }}"
echo "target url: ${{ steps.yaml-data.outputs.canonical }}"
echo "version: ${{ steps.yaml-data.outputs.version }}"
- name: Run the IG publisher
uses: docker://hl7fhir/ig-publisher-base:latest
with:
args: ./scripts/run-ig-publisher.sh


# deploy implementation guide to github pages
- name: Deploy
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./output
force_orphan: true

# upload binaries to release
- name: Upload binaries to release
if: (github.ref == 'refs/heads/master' || github.ref == 'refs/heads/main')
uses: svenstaro/upload-release-action@v2
with:
repo_token: ${{ secrets.GITHUB_TOKEN }}
file: ./output/package.tgz
asset_name: ${{ steps.yaml-data.outputs.id }}-${{ steps.yaml-data.outputs.version }}.tgz
tag: v${{ steps.yaml-data.outputs.version }}
release_name: Release v${{ steps.yaml-data.outputs.version }}
overwrite: true
42 changes: 42 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# Temporary folders #
#####################
temp
template
output
input-cache
fsh-generated
_preprocessed
notes
notebooks

# IG publisher files #
###########################################
validator_cli.jar
publisher.jar
_gencontinuous.bat
_gencontinuous.sh

# OS generated files #
###########################
.DS_Store
Thumbs.db

# IDE folders and files
###########################
.vscode
*.code-workspace
.idea

# nodejs files/directories
###########################
package-lock.json
node_modules/
package.json

# cache folders
###########################
__pycache__/

# generated files
###########################
*-generated.md
11 changes: 11 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
exclude: '^docs/'
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: mixed-line-ending
- id: check-json
- id: pretty-format-json
args: ['--autofix', '--no-sort-keys']
35 changes: 35 additions & 0 deletions .zshrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/lisav/miniconda3/bin/conda' 'shell.zsh' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/lisav/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/lisav/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/lisav/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/lisav/miniconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/lisav/miniconda3/etc/profile.d/conda.sh" ]; then
. "/Users/lisav/miniconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/lisav/miniconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

export PATH=$PATH:/opt/sushi/bin


export PATH=$PATH:/opt/sushi/bin
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Template for CPG-on-EBMonFHIR machine-readable clinical practice guidelines# CICU
27 changes: 27 additions & 0 deletions _genonce.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
@ECHO OFF
SET publisher_jar=publisher.jar
SET input_cache_path=%CD%\input-cache

ECHO Checking internet connection...
PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
ECHO We're offline...
SET txoption=-tx n/a
GOTO igpublish

:isonline
ECHO We're online
SET txoption=

:igpublish

SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

IF EXIST "%input_cache_path%\%publisher_jar%" (
JAVA -jar "%input_cache_path%\%publisher_jar%" -ig . %txoption% %*
) ELSE If exist "..\%publisher_jar%" (
JAVA -jar "..\%publisher_jar%" -ig . %txoption% %*
) ELSE (
ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting...
)

PAUSE
30 changes: 30 additions & 0 deletions _genonce.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
#!/bin/bash
publisher_jar=publisher.jar
input_cache_path=./input-cache/
echo Checking internet connection...
curl -sSf tx.fhir.org > /dev/null

if [ $? -eq 0 ]; then
echo "Online"
txoption=""
else
echo "Offline"
txoption="-tx n/a"
fi

echo "$txoption"

export JAVA_TOOL_OPTIONS="$JAVA_TOOL_OPTIONS -Dfile.encoding=UTF-8"

publisher=$input_cache_path/$publisher_jar
if test -f "$publisher"; then
java -jar $publisher -ig . $txoption $*

else
publisher=../$publisher_jar
if test -f "$publisher"; then
java -jar $publisher -ig . $txoption $*
else
echo IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting...
fi
fi
Loading

0 comments on commit 7ecd4bd

Please sign in to comment.