Skip to content

Commit

Permalink
Merge branch 'HL7:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
jkiddo authored Jan 8, 2025
2 parents 6ad1700 + 231504f commit a6a193f
Show file tree
Hide file tree
Showing 305 changed files with 5,455 additions and 1,315,820 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/validate-docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: Validate docs

on:
push:
branches: [ master ]
pull_request:
types: [opened, synchronize] # This will trigger the workflow only when a PR is opened or updated with new commits

jobs:
sushi:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Sushi
run: sudo npm install -g fsh-sushi

- name: Validate with Sushi
run: sushi .

ig-publisher:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3

- name: Install Jekyll
run: sudo gem install jekyll

- name: Install Sushi
run: sudo npm install -g fsh-sushi

- name: Install IG publisher
run: |
chmod +x ./_updatePublisher.sh
./_updatePublisher.sh -y
- name: Validate IG
run: |
chmod +x ./_genonce.sh
./_genonce.sh
9 changes: 7 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
temp
template
output
fsh-generated

# Don't commit this because it's so large #
# Don't commit txcache or other input-cache files #
###########################################
/input-cache/org.hl7.fhir.publisher.jar
input-cache

# Windows generated files #
###########################
Expand All @@ -21,3 +22,7 @@ Thumbs.db
################
*.bak
/fsh/build

# generated file #
################
FHIR-ips.xml
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# International Patient Summary (IPS) FHIR Implementation Guide Repository

Authors: Rob Hausam, Giorgio Cangioli
Authors: Rob Hausam, Giorgio Cangioli, John D'Amore

Empty file modified _gencontinuous.sh
100644 → 100755
Empty file.
10 changes: 5 additions & 5 deletions _genonce.bat
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
@ECHO OFF
SET publisher_jar=org.hl7.fhir.publisher.jar
SET publisher_jar=publisher.jar
SET input_cache_path=%CD%\input-cache

ECHO Checking internet connection...
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
ECHO We're offline...
SET txoption=-tx n/a
GOTO igpublish
Expand All @@ -17,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 -jar "%input_cache_path%\%publisher_jar%" -ig . %txoption% %*
) ELSE If exist "..\%publisher_jar%" (
JAVA -jar "..\%publisher_jar%" -ig ig.ini %txoption% %*
JAVA -jar "..\%publisher_jar%" -ig . %txoption% %*
) ELSE (
ECHO IG Publisher NOT FOUND in input-cache or parent folder. Please run _updatePublisher. Aborting...
)

PAUSE
PAUSE
8 changes: 5 additions & 3 deletions _genonce.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/bin/bash
publisher_jar=org.hl7.fhir.publisher.jar
publisher_jar=publisher.jar
input_cache_path=./input-cache/
echo Checking internet connection...
curl -sSf tx.fhir.org > /dev/null
Expand All @@ -14,14 +14,16 @@ 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 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
Expand Down
42 changes: 23 additions & 19 deletions _updatePublisher.bat
Original file line number Diff line number Diff line change
Expand Up @@ -2,23 +2,25 @@

SETLOCAL

SET dlurl=https://storage.googleapis.com/ig-build/org.hl7.fhir.publisher.jar
SET publisher_jar=org.hl7.fhir.publisher.jar
SET dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar
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.
ECHO Checking internet connection...
PING tx.fhir.org -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
PING tx.fhir.org -4 -n 1 -w 1000 | FINDSTR TTL && GOTO isonline
ECHO We're offline, nothing to do...
GOTO end

Expand All @@ -37,6 +39,7 @@ IF DEFINED ARG (

FOR %%x IN ("%CD%") DO SET upper_path=%%~dpx

ECHO.
IF NOT EXIST "%input_cache_path%%publisher_jar%" (
IF NOT EXIST "%upper_path%%publisher_jar%" (
SET jarlocation="%input_cache_path%%publisher_jar%"
Expand All @@ -63,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 @@ -128,9 +131,10 @@ GOTO done



ECHO Will place publisher jar here: %input_cache_path%%publisher_jar%
IF "%skipPrompts%"=="true" (
SET updateScripts="Y"
ECHO.
ECHO Updating scripts
IF "%skipPrompts%"=="y" (
SET updateScripts=Y
) ELSE (
SET /p updateScripts="Update scripts? (Y/N) "
)
Expand Down Expand Up @@ -212,4 +216,4 @@ start copy /y "_updatePublisher.new.bat" "_updatePublisher.bat" ^&^& del "_updat

IF "%skipPrompts%"=="true" (
PAUSE
}
)
110 changes: 89 additions & 21 deletions _updatePublisher.sh
Original file line number Diff line number Diff line change
@@ -1,30 +1,60 @@
#!/bin/bash
dlurl=https://storage.googleapis.com/ig-build/org.hl7.fhir.publisher.jar
publisher_jar=org.hl7.fhir.publisher.jar
input_cache_path=./input-cache/
pubsource=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/
publisher_jar=publisher.jar
dlurl=$pubsource$publisher_jar

input_cache_path=$PWD/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"
curl -sSf tx.fhir.org > /dev/null

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 @@ -38,27 +68,65 @@ 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 $dlurl -o "$jarlocation" --create-dirs
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
chmod +x _gencontinuous.sh
rm /tmp/_gencontinuous.new

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

curl -L $update_sh_url -o /tmp/_updatePublisher.new
cp /tmp/_updatePublisher.new _updatePublisher.sh
chmod +x _updatePublisher.sh
rm /tmp/_updatePublisher.new
fi
2 changes: 2 additions & 0 deletions fsh.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[FSH]
timeout = 600
4 changes: 2 additions & 2 deletions ig.ini
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
[IG]
ig = input/ig-uv-ips.xml
template = hl7.fhir.template
ig = fsh-generated/resources/ImplementationGuide-hl7.fhir.uv.ips.json
template = hl7.fhir.template#current
usage-stats-opt-out = false
Loading

0 comments on commit a6a193f

Please sign in to comment.