commit
d09eaf0ef0
@ -1,30 +1,64 @@
|
|||||||
#!/bin/bash
|
#/bin/bash
|
||||||
dlurl=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar
|
pubsource=https://github.com/HL7/fhir-ig-publisher/releases/latest/download/
|
||||||
publisher_jar=publisher.jar
|
publisher_jar=publisher.jar
|
||||||
input_cache_path=./input-cache/
|
dlurl=$pubsource$publisher_jar
|
||||||
|
|
||||||
|
input_cache_path=$PWD/input-cache/
|
||||||
|
|
||||||
|
scriptdlroot=https://raw.githubusercontent.com/FHIR/sample-ig/master
|
||||||
|
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
|
if ! type "curl" > /dev/null; then
|
||||||
echo "ERROR: Script needs curl to download latest IG Publisher. Please install curl."
|
echo "ERROR: Script needs curl to download latest IG Publisher. Please install curl."
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
FORCE=false
|
while [ "$#" -gt 0 ]; do
|
||||||
|
|
||||||
while :; do
|
|
||||||
case $1 in
|
case $1 in
|
||||||
-f|--force) FORCE=true ;;
|
-f|--force) FORCE=true ;;
|
||||||
--)
|
-y|--yes) skipPrompts=true ; FORCE=true ;;
|
||||||
shift
|
*) echo "Unknown parameter passed: $1. Exiting"; exit 1 ;;
|
||||||
break
|
|
||||||
;;
|
|
||||||
*) break
|
|
||||||
esac
|
esac
|
||||||
shift
|
shift
|
||||||
done
|
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"
|
publisher="$input_cache_path$publisher_jar"
|
||||||
if test -f "$publisher"; then
|
|
||||||
|
if test -f "$publisher" ; then
|
||||||
echo "IG Publisher FOUND in input-cache"
|
echo "IG Publisher FOUND in input-cache"
|
||||||
jarlocation="$publisher"
|
jarlocation="$publisher"
|
||||||
jarlocationname="Input Cache"
|
jarlocationname="Input Cache"
|
||||||
@ -38,27 +72,62 @@ else
|
|||||||
jarlocationname="Parent Folder"
|
jarlocationname="Parent Folder"
|
||||||
upgrade=true
|
upgrade=true
|
||||||
else
|
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
|
jarlocation=$input_cache_path$publisher_jar
|
||||||
jarlocationname="Input Cache"
|
jarlocationname="Input Cache"
|
||||||
upgrade=false
|
upgrade=false
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$FORCE" != true ]]; then
|
if [[ $skipPrompts == false ]]; then
|
||||||
if "$upgrade"; then
|
|
||||||
|
if [[ $upgrade == true ]]; then
|
||||||
message="Overwrite $jarlocation? (Y/N) "
|
message="Overwrite $jarlocation? (Y/N) "
|
||||||
else
|
else
|
||||||
echo Will place publisher jar here: "$jarlocation"
|
echo Will place publisher jar here: "$jarlocation"
|
||||||
message="Ok (enter 'y' or 'Y' to continue, any other key to cancel)?"
|
message="Ok (enter 'y' or 'Y' to continue, any other key to cancel)?"
|
||||||
fi
|
fi
|
||||||
read -r -p "$message" response
|
read -r -p "$message" response
|
||||||
|
else
|
||||||
|
response=y
|
||||||
|
fi
|
||||||
|
if [[ $skipPrompts == true ]] || [[ $response =~ ^[yY].*$ ]]; then
|
||||||
|
|
||||||
|
echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit"
|
||||||
|
curl -L $dlurl -o "$jarlocation" --create-dirs
|
||||||
|
else
|
||||||
|
echo cancelled publisher update
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$FORCE" == true ]] || [[ "$response" =~ ^([yY])$ ]]; then
|
if [[ $skipPrompts != true ]]; then
|
||||||
echo "Downloading most recent publisher to $jarlocationname - it's ~100 MB, so this may take a bit"
|
message="Update scripts? (enter 'y' or 'Y' to continue, any other key to cancel)?"
|
||||||
# wget "https://fhir.github.io/latest-ig-publisher/org.hl7.fhir.publisher.jar" -O "$jarlocation"
|
read -r -p "$message" response
|
||||||
curl $dlurl -o "$jarlocation" --create-dirs
|
fi
|
||||||
else
|
|
||||||
echo cancel...
|
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
|
fi
|
||||||
|
|||||||
@ -307,7 +307,7 @@
|
|||||||
{% if c.contentType = 'text/cql' %}
|
{% if c.contentType = 'text/cql' %}
|
||||||
<tr>
|
<tr>
|
||||||
<table>
|
<table>
|
||||||
<tr><th><b>Content: </b> {{c.contentType}}</th></tr>
|
<tr><th><a id="cql-content"><b>Content: </b></a> {{c.contentType}}</th></tr>
|
||||||
<tr><td><pre><code>{{c.data.decode('base64').escape('html')}}</code></pre></td></tr>
|
<tr><td><pre><code>{{c.data.decode('base64').escape('html')}}</code></pre></td></tr>
|
||||||
</table>
|
</table>
|
||||||
</tr>
|
</tr>
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user