Skip to content

Commit 34dc89d

Browse files
committed
Update Simplifier API endpoint and use multi-part form upload
1 parent c22f989 commit 34dc89d

File tree

1 file changed

+14
-6
lines changed

1 file changed

+14
-6
lines changed

.github/workflows/publish-to-simplifier.yml

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,25 @@ jobs:
2929

3030
- name: Publish FHIR Resources to Simplifier
3131
run: |
32-
# Get list of JSON resources (profiles, extensions, examples, CodeSystems, ValueSets)
32+
# Upload JSON resources to Simplifier project
33+
# Using the direct project file upload endpoint
34+
PROJECT_ID="Syrian-Core-Profiles"
35+
3336
for file in fsh-generated/resources/*.json; do
3437
filename=$(basename "$file")
35-
# Skip the ImplementationGuide JSON if you prefer
38+
39+
# Skip ImplementationGuide
3640
if [[ "$filename" != "ImplementationGuide-"* ]]; then
3741
echo "Uploading: $filename"
38-
curl -X POST "https://simplifier.net/api/Project/Syrian-Core-Profiles/Res/CustomResource" \
42+
43+
# Try uploading to Simplifier
44+
curl -X POST "https://api.simplifier.net/Project/$PROJECT_ID/Upload" \
45+
-H "Authorization: Basic $(echo -n "${{ secrets.SIMPLIFIER_USERNAME }}:${{ secrets.SIMPLIFIER_PASSWORD }}" | base64)" \
3946
-H "Content-Type: application/fhir+json" \
40-
-u "${{ secrets.SIMPLIFIER_USERNAME }}:${{ secrets.SIMPLIFIER_PASSWORD }}" \
41-
--data-binary "@$file" \
42-
-v
47+
-F "file=@$file" \
48+
--max-time 30 \
49+
-w "\nHTTP Status: %{http_code}\n" \
50+
-v || echo "Upload failed for $filename"
4351
fi
4452
done
4553

0 commit comments

Comments
 (0)