From 2e9e0d5c6c471601ebeac371a40944582b06faf7 Mon Sep 17 00:00:00 2001 From: healthedata1 Date: Thu, 9 Nov 2023 17:54:43 -0800 Subject: [PATCH] pdate canonical urls in examples to include the version --- publish.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/publish.sh b/publish.sh index ab579d5..53ac74e 100644 --- a/publish.sh +++ b/publish.sh @@ -297,12 +297,14 @@ if [[ $APP_VERSION ]]; then tmp=$(mktemp -d -d ./input/_examples) echo "========= tmp is $tmp ===========" ver=$(jq -r '.version' fsh-generated/resources/ImplementationGuide*.json) + canon=$(jq -r '.url | split("/ImplementationGuide/")[0]' fsh-generated/resources/ImplementationGuide-hl7.fhir.us.core.json) + echo "========= canon is $canon ===========" echo "========= current version is $ver ===========" for file in $examples/*.json do # echo "file is $file" # echo "basename is $(basename $file)" - jq --arg ver "$ver" 'if (.meta.profile) then .meta.profile[0] = .meta.profile[0] + "|"+ $ver else . end' < $file > $tmp/$(basename $file) + jq --arg ver "$ver" --arg canon "$canon" 'if (.meta.profile and (.meta.profile[0] | contains($canon)) ) then .meta.profile[0] = .meta.profile[0] + "|"+ $ver else . end' < $file > $tmp/$(basename $file) done mv -f $tmp/*.json $examples