Skip to content

Commit

Permalink
Merge pull request #51 from HL7/Dave
Browse files Browse the repository at this point in the history
Dave
  • Loading branch information
keithboone authored Apr 8, 2021
2 parents 5700155 + a4e6c59 commit 12a9107
Show file tree
Hide file tree
Showing 1,595 changed files with 807 additions and 722,203 deletions.
7 changes: 0 additions & 7 deletions .checkstyle

This file was deleted.

39 changes: 0 additions & 39 deletions .classpath

This file was deleted.

12 changes: 6 additions & 6 deletions .github/workflows/feature.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ jobs:
- name: Maven Clean, Test and Package the output
run: mvn -B test

- name: Run Plant UML
uses: lokkju/github-action-plantuml@master
with:
args: -tsvg $GITHUB_WORKSPACE/input/images-source/*.txt -o $GITHUB_WORKSPACE/input/images
#
# - name: Run Plant UML
# uses: lokkju/github-action-plantuml@master
# with:
# args: -tsvg $GITHUB_WORKSPACE/input/images-source/*.txt -o $GITHUB_WORKSPACE/input/images

- name: Checkin Generated Inputs
run: |
Expand All @@ -43,4 +43,4 @@ jobs:
git commit --allow-empty -m "Generated Content, Images and FHIR Shorthand Files"
git push
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,5 @@ Thumbs.db
/output
/template
/temp
/old
.settings
648 changes: 0 additions & 648 deletions FHIR-fhir-saner.xml

This file was deleted.

Binary file removed Organization-Location.zip
Binary file not shown.
Binary file removed SANERLogo-small.png
Binary file not shown.
Binary file removed SANERLogo.png
Binary file not shown.
Binary file removed SANERreportingnational.png
Binary file not shown.
6 changes: 0 additions & 6 deletions _gencontinuous.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,2 @@
@ECHO OFF
REM ***********************************************************************************************
REM * WARNING: DO NOT EDIT THIS FILE *
REM * *
REM * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
REM ***********************************************************************************************

CALL ./_genonce.bat -watch
9 changes: 1 addition & 8 deletions _gencontinuous.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,9 +1,2 @@
#!/bin/bash

# *************************************************************************************************
# * WARNING: DO NOT EDIT THIS FILE *
# * *
# * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
# *************************************************************************************************

./_genonce.sh -watch
./_genonce.sh -watch
14 changes: 4 additions & 10 deletions _genonce.bat
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
@ECHO OFF
REM ***********************************************************************************************
REM * WARNING: DO NOT EDIT THIS FILE *
REM * *
REM * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
REM ***********************************************************************************************

SET publisher_jar=publisher.jar
SET input_cache_path=%CD%\input-cache

SET GRAPHVIZ_DOT=dot.exe
ECHO Checking internet connection...
PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
ECHO We're offline...
Expand All @@ -23,11 +17,11 @@ SET txoption=
SET JAVA_TOOL_OPTIONS=-Dfile.encoding=UTF-8

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

PAUSE
PAUSE
14 changes: 4 additions & 10 deletions _genonce.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,13 +1,7 @@
#!/bin/bash

# *************************************************************************************************
# * WARNING: DO NOT EDIT THIS FILE *
# * *
# * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
# *************************************************************************************************

publisher_jar=publisher.jar
input_cache_path=./input-cache/
GRAPHVIZ_DOT=/usr/bin/dot
echo Checking internet connection...
curl -sSf tx.fhir.org > /dev/null

Expand All @@ -23,13 +17,13 @@ echo "$txoption"

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

else
publisher=../$publisher_jar
if test -f "$publisher"; then
java -jar $publisher -ig ig.ini $txoption $*
java -jar $publisher -ig . $txoption $*
else
echo IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting...
fi
fi
fi
34 changes: 15 additions & 19 deletions _updatePublisher.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,4 @@
@ECHO OFF
REM ***********************************************************************************************
REM * WARNING: DO NOT EDIT THIS FILE *
REM * *
REM * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
REM ***********************************************************************************************

SETLOCAL

Expand All @@ -12,14 +7,15 @@ SET publisher_jar=publisher.jar
SET input_cache_path=%CD%\input-cache\
SET skipPrompts=false

set update_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.bat
set gen_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_genonce.bat
set gencont_bat_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_gencontinuous.bat
set gencont_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_gencontinuous.sh
set gen_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_genonce.sh
set update_sh_url=https://raw.githubusercontent.com/FHIR/sample-ig/master/_updatePublisher.sh
SET scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main
SET update_bat_url=%scriptdlroot%/_updatePublisher.bat
SET gen_bat_url=%scriptdlroot%/_genonce.bat
SET gencont_bat_url=%scriptdlroot%/_gencontinuous.bat
SET gencont_sh_url=%scriptdlroot%/_gencontinuous.sh
SET gen_sh_url=%scriptdlroot%/_genonce.sh
SET update_sh_url=%scriptdlroot%/_updatePublisher.sh

IF "%~1"=="/f" SET skipPrompts=true
IF "%~1"=="/f" SET skipPrompts=y


ECHO.
Expand Down Expand Up @@ -70,21 +66,21 @@ IF DEFINED FORCE (
GOTO download
)

IF "%skipPrompts%"=="true" (
SET create="Y"
IF "%skipPrompts%"=="y" (
SET create=Y
) ELSE (
SET /p create="Ok? (Y/N) "
)
IF /I "%create%"=="Y" (
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
MKDIR "%input_cache_path%" 2> NUL
GOTO download
)
GOTO done

:upgrade
IF "%skipPrompts%"=="true" (
SET overwrite="Y"
IF "%skipPrompts%"=="y" (
SET overwrite=Y
) ELSE (
SET /p overwrite="Overwrite %jarlocation%? (Y/N) "
)
Expand Down Expand Up @@ -137,8 +133,8 @@ GOTO done

ECHO.
ECHO Updating scripts
IF "%skipPrompts%"=="true" (
SET updateScripts="Y"
IF "%skipPrompts%"=="y" (
SET updateScripts=Y
) ELSE (
SET /p updateScripts="Update scripts? (Y/N) "
)
Expand Down
112 changes: 87 additions & 25 deletions _updatePublisher.sh
100644 → 100755
Original file line number Diff line number Diff line change
@@ -1,37 +1,64 @@
#!/bin/bash
pubsource=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/
publisher_jar=publisher.jar
dlurl=$pubsource$publisher_jar

# *************************************************************************************************
# * WARNING: DO NOT EDIT THIS FILE *
# * *
# * This file is generated by SUSHI. Any edits you make to this file will be overwritten. *
# *************************************************************************************************
input_cache_path=$PWD/input-cache/

dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar
publisher_jar=publisher.jar
input_cache_path=./input-cache/
scriptdlroot=https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main
update_bat_url=$scriptdlroot/_updatePublisher.bat
gen_bat_url=$scriptdlroot/_genonce.bat
gencont_bat_url=$scriptdlroot/_gencontinuous.bat
gencont_sh_url=$scriptdlroot/_gencontinuous.sh
gen_sh_url=$scriptdlroot/_genonce.sh
update_sh_url=$scriptdlroot/_updatePublisher.sh

skipPrompts=false
FORCE=false

set -e
if ! type "curl" > /dev/null; then
echo "ERROR: Script needs curl to download latest IG Publisher. Please install curl."
exit 1
fi

FORCE=false

while :; do
while [ "$#" -gt 0 ]; do
case $1 in
-f|--force) FORCE=true ;;
--)
shift
break
;;
*) break
-f|--force) FORCE=true ;;
-y|--yes) skipPrompts=true ; FORCE=true ;;
*) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;;
esac
shift
done

echo "Checking internet connection"
case "$OSTYPE" in
linux-gnu* ) ping tx.fhir.org -4 -c 1 -w 1000 >/dev/null ;;
darwin* ) ping tx.fhir.org -c 1 >/dev/null ;;
*) echo "unknown: $OSTYPE"; exit 1 ;;
esac

if [ $? -ne 0 ] ; then
echo "Offline (or the terminology server is down), unable to update. Exiting"
exit 1
fi

if [ ! -d "$input_cache_path" ] ; then
if [ $FORCE != true ]; then
echo "$input_cache_path does not exist"
message="create it?"
read -r -p "$message" response
else
response=y
fi
fi

if [[ $response =~ ^[yY].*$ ]] ; then
mkdir ./input-cache
fi

publisher="$input_cache_path$publisher_jar"
if test -f "$publisher"; then

if test -f "$publisher" ; then
echo "IG Publisher FOUND in input-cache"
jarlocation="$publisher"
jarlocationname="Input Cache"
Expand All @@ -45,27 +72,62 @@ else
jarlocationname="Parent Folder"
upgrade=true
else
echo IG Publisher NOT FOUND in input-cache or parent folder...
echo "IG Publisher NOT FOUND in input-cache or parent folder"
jarlocation=$input_cache_path$publisher_jar
jarlocationname="Input Cache"
upgrade=false
fi
fi

if [[ "$FORCE" != true ]]; then
if "$upgrade"; then
if [[ $skipPrompts == false ]]; then

if [[ $upgrade == true ]]; then
message="Overwrite $jarlocation? (Y/N) "
else
echo Will place publisher jar here: "$jarlocation"
message="Ok (enter 'y' or 'Y' to continue, any other key to cancel)?"
fi
read -r -p "$message" response
else
response=y
fi
if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then

if [[ "$FORCE" == true ]] || [[ "$response" =~ ^([yY])$ ]]; then
echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit"
# wget "https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar" -O "$jarlocation"
curl -L $dlurl -o "$jarlocation" --create-dirs
else
echo cancel...
echo cancelled publisher update
fi

if [[ $skipPrompts != true ]]; then
message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?"
read -r -p "$message" response
fi

if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then
echo "Downloading most recent scripts "

curl -L $update_bat_url -o /tmp/_updatePublisher.new
cp /tmp/_updatePublisher.new _updatePublisher.bat
rm /tmp/_updatePublisher.new

curl -L $gen_bat_url -o /tmp/_genonce.new
cp /tmp/_genonce.new _genonce.bat
rm /tmp/_genonce.new

curl -L $gencont_bat_url -o /tmp/_gencontinuous.new
cp /tmp/_gencontinuous.new _gencontinuous.bat
rm /tmp/_gencontinuous.new

curl -L $gencont_sh_url -o /tmp/_gencontinuous.new
cp /tmp/_gencontinuous.new _gencontinuous.sh
rm /tmp/_gencontinuous.new

curl -L $gen_sh_url -o /tmp/_genonce.new
cp /tmp/_genonce.new _genonce.sh
rm /tmp/_genonce.new

curl -L $update_sh_url -o /tmp/_updatePublisher.new
cp /tmp/_updatePublisher.new _updatePublisher.sh
rm /tmp/_updatePublisher.new
fi
2 changes: 1 addition & 1 deletion build-images.cmd
Original file line number Diff line number Diff line change
@@ -1 +1 @@
%JAVAEXE% -classpath %PLANTUMLCP% -jar %PLANTUMLCP% -tsvg %LOC%\images-source\*.txt -o ..\images
%JAVAEXE% -classpath %PLANTUMLCP% -jar %PLANTUMLCP% -tsvg %LOC%\images-source\*.plantuml -o ..\images
Loading

0 comments on commit 12a9107

Please sign in to comment.