Skip to content

Commit aca9268

Browse files
git Merge branch 'SBM-ressources-corps' into SBM-corps-FHIR
2 parents 1a7a229 + b1a06b5 commit aca9268

23 files changed

Lines changed: 26909 additions & 21 deletions

.github/workflows/fhir-workflows.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ jobs:
1111
- uses: actions/checkout@v3
1212
with:
1313
path: igSource
14-
- uses: ansforge/IG-workflows@v0.4.0
14+
- uses: ansforge/IG-workflows@main
1515
with:
1616
repo_ig: "./igSource"
1717
github_page: "true"

_build.sh

Lines changed: 176 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,176 @@
1+
#!/bin/bash
2+
3+
set -e
4+
5+
# Variables
6+
dlurl="https://github.com/HL7/fhir-ig-publisher/releases/latest/download/publisher.jar"
7+
publisher_jar="publisher.jar"
8+
input_cache_path="$(pwd)/input-cache/"
9+
skipPrompts=false
10+
upper_path="../"
11+
scriptdlroot="https://raw.githubusercontent.com/HL7/ig-publisher-scripts/main"
12+
build_bat_url="${scriptdlroot}/_build.bat"
13+
build_sh_url="${scriptdlroot}/_build.sh"
14+
15+
function check_jar_location() {
16+
if [ -f "${input_cache_path}${publisher_jar}" ]; then
17+
jar_location="${input_cache_path}${publisher_jar}"
18+
echo "Found publisher.jar in input-cache"
19+
elif [ -f "${upper_path}${publisher_jar}" ]; then
20+
jar_location="${upper_path}${publisher_jar}"
21+
echo "Found publisher.jar in parent folder"
22+
else
23+
jar_location="not_found"
24+
echo "publisher.jar not found in input-cache or parent folder"
25+
fi
26+
}
27+
28+
function check_internet_connection() {
29+
if ping -c 1 tx.fhir.org &>/dev/null; then
30+
online=true
31+
echo "We're online and tx.fhir.org is available."
32+
latest_version=$(curl -s https://api.github.com/repos/HL7/fhir-ig-publisher/releases/latest | grep tag_name | cut -d'"' -f4)
33+
else
34+
online=false
35+
echo "We're offline or tx.fhir.org is unavailable."
36+
fi
37+
}
38+
39+
40+
function update_publisher() {
41+
echo "Publisher jar location: ${input_cache_path}${publisher_jar}"
42+
read -p "Download or update publisher.jar? (Y/N): " confirm
43+
if [[ "$confirm" =~ ^[Yy]$ ]]; then
44+
echo "Downloading latest publisher.jar (~200 MB)..."
45+
mkdir -p "$input_cache_path"
46+
curl -L "$dlurl" -o "${input_cache_path}${publisher_jar}"
47+
else
48+
echo "Skipped downloading publisher.jar"
49+
fi
50+
51+
update_scripts_prompt
52+
}
53+
54+
55+
function update_scripts_prompt() {
56+
read -p "Update scripts (_build.bat and _build.sh)? (Y/N): " update_confirm
57+
if [[ "$update_confirm" =~ ^[Yy]$ ]]; then
58+
echo "Updating scripts..."
59+
curl -L "$build_bat_url" -o "_build.new.bat" && mv "_build.new.bat" "_build.bat"
60+
curl -L "$build_sh_url" -o "_build.new.sh" && mv "_build.new.sh" "_build.sh"
61+
chmod +x _build.sh
62+
echo "Scripts updated."
63+
else
64+
echo "Skipped updating scripts."
65+
fi
66+
}
67+
68+
69+
function build_ig() {
70+
if [ "$jar_location" != "not_found" ]; then
71+
args=()
72+
if [ "$online" = "false" ]; then
73+
args+=("-tx" "n/a")
74+
fi
75+
java -Dfile.encoding=UTF-8 -jar "$jar_location" -ig . "${args[@]}" "$@"
76+
else
77+
echo "publisher.jar not found. Please run update."
78+
fi
79+
}
80+
81+
82+
function build_nosushi() {
83+
if [ "$jar_location" != "not_found" ]; then
84+
java -Dfile.encoding=UTF-8 -jar "$jar_location" -ig . -no-sushi "$@"
85+
else
86+
echo "publisher.jar not found. Please run update."
87+
fi
88+
}
89+
90+
function build_notx() {
91+
if [ "$jar_location" != "not_found" ]; then
92+
java -Dfile.encoding=UTF-8 -jar "$jar_location" -ig . -tx n/a "$@"
93+
else
94+
echo "publisher.jar not found. Please run update."
95+
fi
96+
}
97+
98+
function jekyll_build() {
99+
echo "Running Jekyll build..."
100+
jekyll build -s temp/pages -d output
101+
}
102+
103+
function cleanup() {
104+
echo "Cleaning up temp directories..."
105+
if [ -f "${input_cache_path}${publisher_jar}" ]; then
106+
mv "${input_cache_path}${publisher_jar}" ./
107+
rm -rf "${input_cache_path}"*
108+
mkdir -p "$input_cache_path"
109+
mv "$publisher_jar" "$input_cache_path"
110+
fi
111+
rm -rf ./output ./template ./temp
112+
echo "Cleanup complete."
113+
}
114+
115+
check_jar_location
116+
check_internet_connection
117+
118+
# Handle command-line argument or menu
119+
case "$1" in
120+
update) update_publisher ;;
121+
build) build_ig ;;
122+
nosushi) build_nosushi ;;
123+
notx) build_notx ;;
124+
jekyll) jekyll_build ;;
125+
clean) cleanup ;;
126+
exit) exit 0 ;;
127+
*)
128+
# Compute default choice
129+
default_choice=2 # Build by default
130+
131+
if [ "$jar_location" = "not_found" ]; then
132+
default_choice=1 # Download if jar is missing
133+
elif [ "$online" = "false" ]; then
134+
default_choice=4 # Offline build
135+
elif [ -n "$latest_version" ]; then
136+
current_version=$(java -jar "$jar_location" -v 2>/dev/null | tr -d '\r')
137+
if [ "$current_version" != "$latest_version" ]; then
138+
default_choice=1 # Offer update if newer version exists
139+
fi
140+
fi
141+
142+
echo "---------------------------------------------"
143+
echo "Publisher: ${current_version:-unknown}; Latest: ${latest_version:-unknown}"
144+
echo "Publisher location: $jar_location"
145+
echo "Online: $online"
146+
echo "---------------------------------------------"
147+
echo
148+
echo "Please select an option:"
149+
echo "1) Update publisher"
150+
echo "2) Build IG"
151+
echo "3) Build IG without Sushi"
152+
echo "4) Build IG without TX server"
153+
echo "5) Jekyll build"
154+
echo "6) Cleanup temp directories"
155+
echo "0) Exit"
156+
echo
157+
158+
# Read with timeout, but default if nothing entered
159+
echo -n "Choose an option [default: $default_choice]: "
160+
read -t 5 choice || choice="$default_choice"
161+
choice="${choice:-$default_choice}"
162+
echo "You selected: $choice"
163+
164+
case "$choice" in
165+
1) update_publisher ;;
166+
2) build_ig ;;
167+
3) build_nosushi ;;
168+
4) build_notx ;;
169+
5) jekyll_build ;;
170+
6) cleanup ;;
171+
0) exit 0 ;;
172+
*) echo "Invalid option." ;;
173+
esac
174+
;;
175+
176+
esac

_gencontinuous.sh

100644100755
File mode changed.

_genonce.sh

100644100755
File mode changed.

_updatePublisher.sh

100644100755
File mode changed.

input/fsh/RessourcesFHIREntete/aliases.fsh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,18 @@ Alias: $JDV_J141-RoleClass-CISIS = https://mos.esante.gouv.fr/NOS/JDV_J141-RoleC
1616
Alias: $jdv-type-systeme-cisis = https://smt.esante.gouv.fr/fhir/ValueSet/jdv-type-systeme-cisis
1717
Alias: $jdv-j368-categorie-etablissement-cisis = https://smt.esante.gouv.fr/fhir/ValueSet/jdv-j368-categorie-etablissement-cisis
1818
Alias: $jdv-role-informateur-cisis = https://smt.esante.gouv.fr/fhir/ValueSet/jdv-role-informateur-cisis
19+
1920
// TRE
2021
Alias: $TRE_R66-CategorieEtablissement = https://mos.esante.gouv.fr/NOS/TRE_R66-CategorieEtablissement/FHIR/TRE-R66-CategorieEtablissement
2122
Alias: $TRE_G13-OrientationParticuliere = https://mos.esante.gouv.fr/NOS/TRE_G13-OrientationParticuliere/FHIR/TRE-G13-OrientationParticuliere
2223
Alias: $TRE_R359-SurspecialiteTransversale = https://mos.esante.gouv.fr/NOS/TRE_R359-SurspecialiteTransversale/FHIR/TRE-R359-SurspecialiteTransversale
24+
2325
Alias: $TRE_R38-SpecialiteOrdinale = https://mos.esante.gouv.fr/NOS/TRE_R38-SpecialiteOrdinale/FHIR/TRE-R38-SpecialiteOrdinale
2426
Alias: $TRE_R39-Competence = https://mos.esante.gouv.fr/NOS/TRE_R39-Competence/FHIR/TRE-R39-Competence
25-
Alias: $TRE_R40-CompetenceExclusive = https://mos.esante.gouv.fr/NOS/TRE_R40-CompetenceExclusive/FHIR/TRE-R40-CompetenceExclusive
2627
Alias: $TRE_R42-DESCnonQualifiant = https://mos.esante.gouv.fr/NOS/TRE_R42-DESCnonQualifiant/FHIR/TRE-R42-DESCnonQualifiant
2728
Alias: $TRE_R43-CapaciteSavoirFaire = https://mos.esante.gouv.fr/NOS/TRE_R43-CapaciteSavoirFaire/FHIR/TRE-R43-CapaciteSavoirFaire
2829
Alias: $TRE_R44-QualificationPAC = https://mos.esante.gouv.fr/NOS/TRE_R44-QualificationPAC/FHIR/TRE-R44-QualificationPAC
2930
Alias: $TRE_R45-FonctionQualifiee = https://mos.esante.gouv.fr/NOS/TRE_R45-FonctionQualifiee/FHIR/TRE-R45-FonctionQualifiee
30-
Alias: $TRE_R97-DroitExerciceCompl = https://mos.esante.gouv.fr/NOS/TRE_R97-DroitExerciceCompl/FHIR/TRE-R97-DroitExerciceCompl
3131
Alias: $TRE_G05-SousSectionTableauCNOP = https://mos.esante.gouv.fr/NOS/TRE_G05-SousSectionTableauCNOP/FHIR/TRE-G05-SousSectionTableauCNOP
3232
Alias: $TRE_R85-RolePriseCharge = https://mos.esante.gouv.fr/NOS/TRE_R85-RolePriseCharge/FHIR/TRE-R85-RolePriseCharge
3333
Alias: $TRE_R04-TypeSavoirFaire = https://mos.esante.gouv.fr/NOS/TRE_R04-TypeSavoirFaire/FHIR/TRE-R04-TypeSavoirFaire

input/fsh/RessourcesFHIREntete/profils/FrPractitionerDocument.fsh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Description: "Ce profil permet de décrire un professionnel de santé dans le ca
2828
* qualification[savoirFaire][professionMedecin].code.coding ^slicing.discriminator.path = "$this"
2929
* qualification[savoirFaire][professionMedecin].code.coding ^slicing.rules = #closed
3030
* qualification[savoirFaire][professionMedecin].code.coding contains savoirFaire 0..1
31-
* qualification[savoirFaire][professionMedecin].code.coding[savoirFaire] from FRValueSetSavoirFaireProfessionMedecin (required)
3231

3332
* qualification[savoirFaire][professionMedecin].code.coding contains typeSavoirFaire 0..1
3433
* qualification[savoirFaire][professionMedecin].code.coding[typeSavoirFaire] from FRValueSetTypeSavoirFaireProfessionMedecin (required)

input/fsh/RessourcesFHIREntete/valueSets/FrValueSetSavoirFaireProfessionMedecin.fsh

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)