Compare commits

..

30 Commits

Author SHA1 Message Date
jobayer
777f2b3a0d chore: update version to 0.2.1
All checks were successful
FHIR IG CI/CD Pipeline with Version Persistence / build-ig (push) Successful in 8m31s
FHIR IG CI/CD Pipeline with Version Persistence / deploy (push) Successful in 11s
2025-12-22 15:56:22 +06:00
jobayer
791dda3931 ci: enhance pipeline with pre-build package-list.json update
Some checks failed
FHIR IG CI/CD Pipeline with Version Persistence / build-ig (push) Failing after 4s
FHIR IG CI/CD Pipeline with Version Persistence / deploy (push) Has been skipped
Move package-list.json update to occur before the build step for release builds,
allowing IG Publisher to generate history.html correctly. Adjust post-build steps
to only update package-feed.xml, and add verification for history.html generation
and deployment. This ensures registry files are prepared earlier in the process.
2025-12-22 15:41:41 +06:00
jobayer
205f3e58a1 -
All checks were successful
FHIR IG CI/CD Pipeline with Version Persistence / build-ig (push) Successful in 6m33s
FHIR IG CI/CD Pipeline with Version Persistence / deploy (push) Successful in 9s
2025-12-22 15:28:57 +06:00
jobayer
c5e0a7d039 ci: enhance deployment with file cleanup and forced container recreation
All checks were successful
FHIR IG CI/CD Pipeline with Version Persistence / build-ig (push) Successful in 6m25s
FHIR IG CI/CD Pipeline with Version Persistence / deploy (push) Successful in 9s
2025-12-22 13:38:59 +06:00
jobayer
3297b88035 ci: enhance pipeline with version persistence and direct deployment
Some checks failed
FHIR IG CI/CD Pipeline with Version Persistence / build-ig (push) Successful in 6m58s
FHIR IG CI/CD Pipeline with Version Persistence / deploy (push) Failing after 8s
- Add version extraction from IG and tag validation for releases
- Update package-list.json and package-feed.xml automatically on releases
- Replace Docker-based deployment with direct file upload via SCP/SSH
- Add publication request configuration for FHIR registry
- Remove obsolete Dockerfile.serve as deployment strategy changed
2025-12-22 12:58:59 +06:00
18c7029f91 fixed reverted back the download page
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m46s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 6s
2025-10-06 15:44:18 +00:00
0b3ed58124 Added SHR Dashboard and SHR Info
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m26s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-05 12:15:01 +06:00
ea9714686d fixed codesystem warnings
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 15m34s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-03 13:03:07 +00:00
96c7f1038e fixed canonical url and id mismatches
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m28s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 12s
2025-10-03 12:35:18 +00:00
debd34938f changed package name and canonical url
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m8s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-03 09:42:42 +00:00
6f9ef8f32c #
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 42m0s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 12s
2025-10-03 08:25:05 +00:00
9f903f8971 #
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 37m9s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 17:29:54 +00:00
e96406dd66 Prepare v0.2.0 release: Fixed package name canonical url
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m26s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 11:51:37 +00:00
7c70cbd667 Prepare v0.2.0 release: Fixed package name canonical url
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m52s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 10s
2025-10-02 10:51:40 +00:00
441ba94e45 Prepare v0.2.0 release: Fixed ig.ini
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m1s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 10:36:26 +00:00
56353fb6f0 Prepare v0.2.0 release: Fixed ig.ini
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 16m6s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 10s
2025-10-02 10:16:38 +00:00
7bfa246e8e Prepare v0.2.0 release: Fixed package-list.json
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m53s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 08:26:26 +00:00
575386df1b Update package-feed.xml
Some checks failed
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m55s
FHIR IG CI/CD Pipeline / deploy (push) Has been cancelled
2025-10-02 14:19:51 +06:00
96448cd6f6 Update package-feed.xml
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 6m54s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 13:59:19 +06:00
1c19dd476c Prepare v0.2.0 release: Fixed package-list.json and added package-feed.xml
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m3s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 10s
2025-10-02 07:33:33 +00:00
334dc16c70 Update CHANGELOG.md
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m7s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 11:56:50 +06:00
41ba52b5e8 Prepare v0.2.0 release: initial draft
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m4s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 11s
2025-10-02 05:45:11 +00:00
a5fbd82834 updated cardinality of encounter profile
All checks were successful
FHIR IG CI/CD Pipeline / build-ig (push) Successful in 7m17s
FHIR IG CI/CD Pipeline / deploy (push) Successful in 12s
2025-10-01 10:55:47 +06:00
8137b9d6f1 Merge branch 'main' of https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG 2025-10-01 10:07:21 +06:00
def389e7fc Merge branch 'main' of https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG 2025-09-30 11:46:13 +06:00
03e2f6d659 Merge branch 'main' of https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG 2025-09-30 11:33:27 +06:00
cc8b5fb0d0 Merge branch 'main' of https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG 2025-09-30 10:14:25 +06:00
5bd5bdced4 updated encounter profile- add dischargedisposition-add 2025-09-30 10:11:27 +06:00
f3a7939168 Merge branch 'main' of https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG
Some checks failed
Deploy on production / deploy (push) Failing after 30s
2025-09-29 16:07:33 +06:00
95f596780c updated encounter profile 2025-09-29 16:05:31 +06:00
39 changed files with 619 additions and 386 deletions

View File

@@ -1,14 +1,16 @@
name: FHIR IG CI/CD Pipeline name: FHIR IG CI/CD Pipeline with Version Persistence
on: on:
push: push:
branches: [ main, develop ] branches: [ main, develop ]
tags:
- 'v*.*.*' # Trigger on version tags like v0.3.0
pull_request: pull_request:
branches: [ main ] branches: [ main ]
env: env:
REGISTRY: git.dghs.gov.bd # Replace with your Gitea instance REGISTRY: git.dghs.gov.bd
IMAGE_NAME: gitadmin/bd-core-fhir-ig # Replace with your image name IMAGE_NAME: gitadmin/bd-core-fhir-ig
jobs: jobs:
build-ig: build-ig:
@@ -18,7 +20,113 @@ jobs:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v3 uses: actions/checkout@v3
with: with:
fetch-depth: 0 # Full history for proper IG building fetch-depth: 0
- name: Extract version from IG
id: version
run: |
# Extract version from ImplementationGuide resource
VERSION=$(grep -oP '<version value="\K[^"]+' input/bd.fhir.core.xml | head -1)
if [ -z "$VERSION" ]; then
echo "ERROR: Could not extract version from ImplementationGuide XML"
exit 1
fi
echo "Extracted version: $VERSION"
echo "version=$VERSION" >> $GITHUB_OUTPUT
# Determine if this is a release build (git tag) or dev build
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
BUILD_TYPE="release"
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
# Verify tag matches IG version
if [ "$TAG_VERSION" != "$VERSION" ]; then
echo "ERROR: Git tag version ($TAG_VERSION) doesn't match IG version ($VERSION)"
exit 1
fi
else
BUILD_TYPE="dev"
fi
echo "build_type=$BUILD_TYPE" >> $GITHUB_OUTPUT
echo "Build type: $BUILD_TYPE"
# NEW STEP: Update package-list.json BEFORE build so IG Publisher can use it
- name: Pre-build package-list.json update
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
DATE=$(date +%Y-%m-%d)
# Only update for release builds
if [ "$BUILD_TYPE" != "release" ]; then
echo " Dev build - skipping package-list.json pre-build update"
exit 0
fi
echo "📋 Updating package-list.json before build..."
# Check if package-list.json exists
if [ ! -f "package-list.json" ]; then
echo "⚠️ package-list.json not found in repo - history.html won't be generated"
echo "Creating minimal package-list.json for this build..."
cat > package-list.json << EOF
{
"package-id": "bd.fhir.core",
"title": "Bangladesh Core FHIR Implementation Guide",
"canonical": "https://fhir.dghs.gov.bd/core",
"introduction": "Core FHIR profiles and extensions for Bangladesh healthcare",
"list": [
{
"version": "current",
"desc": "Continuous Integration Build (latest in version control)",
"path": "https://fhir.dghs.gov.bd/core/",
"status": "ci-build",
"current": true
}
]
}
EOF
fi
# Update package-list.json with new version
python3 << 'PYEOF'
import json
import sys
version = "$VERSION"
date = "$DATE"
with open('package-list.json', 'r') as f:
pkg_list = json.load(f)
# Check if this version already exists
version_exists = any(e['version'] == version for e in pkg_list['list'])
if not version_exists:
new_entry = {
"version": version,
"date": date,
"desc": f"Release {version}",
"path": f"https://fhir.dghs.gov.bd/core/{version}/",
"status": "trial-use",
"sequence": "STU 1"
}
# Insert after 'current' entry
pkg_list['list'].insert(1, new_entry)
with open('package-list.json', 'w') as f:
json.dump(pkg_list, f, indent=2)
print(f"✅ Added version {version} to package-list.json")
else:
print(f" Version {version} already exists in package-list.json")
PYEOF
echo "📋 package-list.json is ready for IG Publisher"
cat package-list.json
- name: Install Docker CLI - name: Install Docker CLI
run: | run: |
@@ -26,258 +134,274 @@ jobs:
apt-get install -y docker.io apt-get install -y docker.io
docker --version docker --version
- name: Setup Docker Buildx - name: Build FHIR IG
uses: docker/setup-buildx-action@v3
with:
install: true
- name: Build FHIR IG (Copy In/Out)
run: | run: |
echo "Building FHIR IG using copy approach..." echo "Building FHIR IG version ${{ steps.version.outputs.version }}..."
# Create a container (don't start yet)
CONTAINER_ID=$(docker create \ CONTAINER_ID=$(docker create \
hl7fhir/ig-publisher-base:latest \ hl7fhir/ig-publisher-base:latest \
/bin/bash -c "cp -r /home/publisher/ig /tmp/build && cd /tmp/build && _updatePublisher.sh -y && _genonce.sh") /bin/bash -c "cp -r /home/publisher/ig /tmp/build && cd /tmp/build && _updatePublisher.sh -y && _genonce.sh")
echo "Container ID: $CONTAINER_ID" echo "Container ID: $CONTAINER_ID"
# Copy all source files into the container
docker cp $(pwd)/. $CONTAINER_ID:/home/publisher/ig/ docker cp $(pwd)/. $CONTAINER_ID:/home/publisher/ig/
# Start and wait for completion
docker start -a $CONTAINER_ID docker start -a $CONTAINER_ID
EXIT_CODE=$? EXIT_CODE=$?
# Copy outputs back # Copy outputs
echo "Copying outputs from container..." echo "Copying outputs from container..."
docker cp $CONTAINER_ID:/tmp/build/output ./output || echo "Warning: No output directory" docker cp $CONTAINER_ID:/tmp/build/output ./output || echo "Warning: No output directory"
docker cp $CONTAINER_ID:/tmp/build/fsh-generated ./fsh-generated || echo "No FSH generated files" docker cp $CONTAINER_ID:/tmp/build/fsh-generated ./fsh-generated || echo "No FSH generated"
docker cp $CONTAINER_ID:/tmp/build/input-cache ./input-cache || echo "No input-cache" docker cp $CONTAINER_ID:/tmp/build/input-cache ./input-cache || echo "No input-cache"
docker cp $CONTAINER_ID:/tmp/build/temp ./temp || echo "No temp directory" docker cp $CONTAINER_ID:/tmp/build/temp ./temp || echo "No temp directory"
# Show container logs if failed
if [ $EXIT_CODE -ne 0 ]; then if [ $EXIT_CODE -ne 0 ]; then
echo "Build failed, showing container logs:" echo "Build failed, showing logs:"
docker logs $CONTAINER_ID docker logs $CONTAINER_ID
docker rm $CONTAINER_ID
exit 1
fi fi
# Cleanup
docker rm $CONTAINER_ID docker rm $CONTAINER_ID
# Verify
if [ ! -f "output/index.html" ]; then if [ ! -f "output/index.html" ]; then
echo "ERROR: Build failed - no index.html" echo "ERROR: Build failed - no index.html"
exit 1 exit 1
fi fi
# Check if history.html was generated
if [ -f "output/history.html" ]; then
echo "✅ history.html generated successfully"
else
echo "⚠️ WARNING: history.html was not generated"
echo "This usually means package-list.json was missing or invalid"
fi
echo "✅ Build successful!" echo "✅ Build successful!"
- name: Verify IG Output - name: Update package-feed.xml for releases
if: steps.version.outputs.build_type == 'release'
run: | run: |
ls -la output/ VERSION="${{ steps.version.outputs.version }}"
if [ ! -f "output/index.html" ]; then DATETIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
echo "ERROR: IG build failed - no index.html found"
exit 1
fi
echo "IG build successful!"
- name: Login to Gitea Container Registry cat > update-feed.py << 'EOF'
if: github.ref == 'refs/heads/main' import sys
uses: docker/login-action@v3 import xml.etree.ElementTree as ET
with:
registry: ${{ env.REGISTRY }}
username: ${{ gitea.actor }}
password: ${{ secrets.ACCESS_TOKEN_GITEA }}
- name: Extract metadata version = sys.argv[1]
if: github.ref == 'refs/heads/main' datetime_iso = sys.argv[2]
id: meta
uses: docker/metadata-action@v4
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=ref,event=branch
type=ref,event=pr
type=sha,prefix={{branch}}-
type=raw,value=latest,enable={{is_default_branch}}
- name: Build and push Docker image ET.register_namespace('', 'http://www.w3.org/2005/Atom')
if: github.ref == 'refs/heads/main'
uses: docker/build-push-action@v6 tree = ET.parse('package-feed.xml')
root = tree.getroot()
ns = {'atom': 'http://www.w3.org/2005/Atom'}
updated_elem = root.find('atom:updated', ns)
if updated_elem is not None:
updated_elem.text = datetime_iso
entry_exists = False
for entry in root.findall('atom:entry', ns):
title = entry.find('atom:title', ns)
if title is not None and version in title.text:
entry_exists = True
entry_updated = entry.find('atom:updated', ns)
if entry_updated is not None:
entry_updated.text = datetime_iso
break
if not entry_exists:
new_entry = ET.Element('{http://www.w3.org/2005/Atom}entry')
title = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}title')
title.text = f"bd.fhir.core version {version}"
link = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}link')
link.set('rel', 'alternate')
link.set('href', f"https://fhir.dghs.gov.bd/core/{version}/")
entry_id = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}id')
entry_id.text = f"https://fhir.dghs.gov.bd/core/{version}/"
entry_updated = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}updated')
entry_updated.text = datetime_iso
summary = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}summary')
summary.text = f"Release {version} of Bangladesh Core FHIR Implementation Guide"
insert_pos = 0
for i, child in enumerate(root):
if child.tag.endswith('entry'):
insert_pos = i
break
insert_pos = i + 1
root.insert(insert_pos, new_entry)
tree.write('output/package-feed.xml', encoding='utf-8', xml_declaration=True)
print(f"✅ Updated package-feed.xml")
EOF
python3 update-feed.py "$VERSION" "$DATETIME"
# Also copy the updated package-list.json to output
cp package-list.json output/package-list.json
echo "📋 Updated registry files"
- name: Prepare deployment artifact
run: |
VERSION="${{ steps.version.outputs.version }}"
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
tar -czf ig-output.tar.gz -C output .
echo "version=$VERSION" > deployment.env
echo "build_type=$BUILD_TYPE" >> deployment.env
echo "build_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> deployment.env
# List what's in the output
echo "📦 Output contents:"
ls -lh output/ | grep -E "(history\.html|package-list\.json|package-feed\.xml|index\.html)"
ls -lh ig-output.tar.gz
- name: Upload artifact
uses: actions/upload-artifact@v3
with: with:
context: . name: ig-output
file: ./Dockerfile.serve path: |
push: true ig-output.tar.gz
tags: ${{ steps.meta.outputs.tags }} deployment.env
labels: ${{ steps.meta.outputs.labels }} package-list.json
# cache-from: type=gha package-feed.xml
# cache-to: type=gha,mode=max retention-days: 30
deploy: deploy:
needs: build-ig needs: build-ig
runs-on: ubuntu-latest runs-on: ubuntu-latest
if: github.ref == 'refs/heads/main' if: (github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v'))
steps: steps:
- name: Checkout repository - name: Download artifact
uses: actions/checkout@v3 uses: actions/download-artifact@v3
with:
name: ig-output
- name: Load deployment env
id: deploy_info
run: |
source deployment.env
echo "version=$version" >> $GITHUB_OUTPUT
echo "build_type=$build_type" >> $GITHUB_OUTPUT
echo "build_date=$build_date" >> $GITHUB_OUTPUT
echo "Deploying version: $version"
echo "Build type: $build_type"
- name: Deploy to server - name: Deploy to server
uses: appleboy/ssh-action@v1.0.3 uses: appleboy/scp-action@v0.1.7
env: with:
REGISTRY: ${{ env.REGISTRY }} host: ${{ secrets.DEPLOY_HOST }}
IMAGE_NAME: ${{ env.IMAGE_NAME }} username: ${{ secrets.DEPLOY_USER }}
IMAGE_TAG: latest password: ${{ secrets.DEPLOY_PASSWORD }}
port: ${{ secrets.DEPLOY_PORT || 22 }}
source: "ig-output.tar.gz,deployment.env,package-list.json,package-feed.xml"
target: "/tmp/fhir-ig-deploy/"
- name: Execute deployment on server
uses: appleboy/ssh-action@v1.0.3
with: with:
host: ${{ secrets.DEPLOY_HOST }} host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USER }} username: ${{ secrets.DEPLOY_USER }}
password: ${{ secrets.DEPLOY_PASSWORD }} password: ${{ secrets.DEPLOY_PASSWORD }}
port: ${{ secrets.DEPLOY_PORT || 22 }} port: ${{ secrets.DEPLOY_PORT || 22 }}
envs: REGISTRY,IMAGE_NAME,IMAGE_TAG
script: | script: |
# Create deployment directory if it doesn't exist
mkdir -p /opt/fhir-ig
cd /opt/fhir-ig
# Create docker-compose.prod.yml
cat > docker-compose.prod.yml << EOF
services:
fhir-ig:
image: \${REGISTRY}/\${IMAGE_NAME}:\${IMAGE_TAG:-latest}
container_name: fhir-ig-app
restart: unless-stopped
ports:
- "80:80"
environment:
- NODE_ENV=production
networks:
- fhir-ig-network
healthcheck:
test: ["CMD", "wget", "--no-verbose", "--tries=1", "--spider", "http://127.0.0.1/health"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
volumes:
- fhir-ig-logs:/var/log/nginx
networks:
fhir-ig-network:
driver: bridge
volumes:
fhir-ig-logs:
driver: local
EOF
# Create deployment script
cat > deploy.sh << 'DEPLOY_SCRIPT'
#!/bin/bash
set -e set -e
# Configuration # Load deployment info
COMPOSE_FILE="docker-compose.prod.yml" source /tmp/fhir-ig-deploy/deployment.env
SERVICE_NAME="fhir-ig"
BACKUP_DIR="/opt/backups/fhir-ig"
LOG_FILE="/var/log/fhir-ig-deploy.log"
# Create directories echo "=========================================="
mkdir -p "$BACKUP_DIR" echo "Deploying FHIR IG"
mkdir -p "$(dirname "$LOG_FILE")" echo "Version: $version"
echo "Build Type: $build_type"
echo "Build Date: $build_date"
echo "=========================================="
# Logging function # Create version directory structure
log() { VERSIONS_DIR="/opt/fhir-ig/versions"
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE" mkdir -p "$VERSIONS_DIR"
}
log "Starting deployment of BD Core FHIR IG..." # Determine target directory
log "Registry: $REGISTRY" if [ "$build_type" == "release" ]; then
log "Image: $IMAGE_NAME" TARGET_DIR="$VERSIONS_DIR/$version"
log "Tag: $IMAGE_TAG" echo "📦 Deploying release version to: $TARGET_DIR"
else
TARGET_DIR="$VERSIONS_DIR/dev"
echo "🔧 Deploying dev build to: $TARGET_DIR"
# Login to registry echo "Cleaning old dev files..."
echo "$GITEA_PASSWORD" | docker login $REGISTRY -u "$GITEA_USERNAME" --password-stdin rm -rf "$TARGET_DIR"/*
# Backup current container if it exists
if docker compose -f "$COMPOSE_FILE" ps --services --filter "status=running" | grep -q "$SERVICE_NAME"; then
log "Creating backup of current deployment..."
BACKUP_FILE="$BACKUP_DIR/backup-$(date +%Y%m%d-%H%M%S).tar.gz"
docker compose -f "$COMPOSE_FILE" exec -T "$SERVICE_NAME" tar -czf - -C /usr/share/nginx/html . > "$BACKUP_FILE" 2>/dev/null || log "Backup failed, continuing..."
fi fi
# Set environment variables for docker compose # Create target directory
export REGISTRY="$REGISTRY" mkdir -p "$TARGET_DIR"
export IMAGE_NAME="$IMAGE_NAME"
export IMAGE_TAG="$IMAGE_TAG"
# Pull the latest image # Extract IG output
log "Pulling latest image: $REGISTRY/$IMAGE_NAME:$IMAGE_TAG..." echo "Extracting IG output..."
docker pull "$REGISTRY/$IMAGE_NAME:$IMAGE_TAG" tar -xzf /tmp/fhir-ig-deploy/ig-output.tar.gz -C "$TARGET_DIR"
# docker pull "\${REGISTRY}/\${IMAGE_NAME}:\${IMAGE_TAG}" # Verify history.html was deployed
if [ -f "$TARGET_DIR/history.html" ]; then
echo "✅ history.html deployed successfully"
else
echo "⚠️ WARNING: history.html not found in deployment"
fi
# Stop and remove old container cp /tmp/fhir-ig-deploy/package-list.json "$VERSIONS_DIR/package-list.json"
log "Stopping old container..."
docker compose -f "$COMPOSE_FILE" down || log "No existing container to stop"
# Start new container # Copy package-feed.xml to root
log "Starting new container..." cp /tmp/fhir-ig-deploy/package-feed.xml "$VERSIONS_DIR/package-feed.xml"
docker compose -f "$COMPOSE_FILE" up -d
# Wait for container to be healthy # Update 'current' symlink for releases
# log "Waiting for container to become healthy..." if [ "$build_type" == "release" ]; then
# timeout=120 echo "Updating 'current' symlink to point to $version"
# elapsed=0 rm -f "$VERSIONS_DIR/current"
# healthy=false ln -sf "$version" "$VERSIONS_DIR/current"
fi
# while [ $elapsed -lt $timeout ]; do # Ensure nginx container is running with correct config
# if docker compose -f "$COMPOSE_FILE" ps --format json | grep -q '"Health":"healthy"'; then cd /opt/fhir-ig
# log "Container is healthy!"
# healthy=true
# break
# fi
# sleep 5
# elapsed=$((elapsed + 5))
# log "Waiting... ($elapsed/$timeout seconds)"
# done
# if [ "$healthy" = false ]; then # Download deployment files if they don't exist
# log "ERROR: Container failed to become healthy within $timeout seconds" if [ ! -f "docker-compose.prod.yml" ]; then
# docker compose -f "$COMPOSE_FILE" logs --tail=50 echo "ERROR: docker-compose.prod.yml not found!"
# log "Rolling back..." echo "Please deploy the updated docker-compose.prod.yml and nginx.conf first"
# docker compose -f "$COMPOSE_FILE" down exit 1
# exit 1 fi
# fi
# Cleanup old images (keep last 3 versions) # Force recreate container to ensure new config/mounts are applied
log "Cleaning up old images..." # This handles "stuck" states better than a simple restart
docker images "\${REGISTRY}/\${IMAGE_NAME}" --format "table {{.Repository}}:{{.Tag}}\t{{.CreatedAt}}" | tail -n +2 | sort -k2 -r | tail -n +4 | awk '{print $1}' | xargs -r docker rmi || log "No old images to clean" docker compose -f docker-compose.prod.yml up -d --force-recreate fhir-ig
# Cleanup old backups (keep only last 5) # Cleanup
log "Cleaning up old backups..." rm -rf /tmp/fhir-ig-deploy
ls -t "$BACKUP_DIR"/backup-*.tar.gz 2>/dev/null | tail -n +6 | xargs -r rm || log "No old backups to clean"
log "Deployment completed successfully!" echo "=========================================="
log "🌐 Service available at: http://$(hostname -I | awk '{print $1}')" echo "✅ Deployment completed successfully!"
echo "Version $version is now available at:"
if [ "$build_type" == "release" ]; then
echo " - https://fhir.dghs.gov.bd/core/$version/"
echo " - https://fhir.dghs.gov.bd/core/$version/history.html"
echo " - https://fhir.dghs.gov.bd/core/ (current)"
else
echo " - https://fhir.dghs.gov.bd/core/dev/"
fi
echo "=========================================="
# Display final status # List all versions
docker compose -f "$COMPOSE_FILE" ps echo "Available versions:"
DEPLOY_SCRIPT ls -lh "$VERSIONS_DIR" | grep -v total
# Make deploy script executable
chmod +x deploy.sh
# Set registry credentials
export GITEA_USERNAME="${{ gitea.actor }}"
export GITEA_PASSWORD="${{ secrets.ACCESS_TOKEN_GITEA }}"
# Execute deployment
./deploy.sh

23
CHANGELOG.md Normal file
View File

@@ -0,0 +1,23 @@
# Changelog
## [0.2.0] 2025-10-02
**First official draft release of BD-Core-FHIR-IG**
### Added
- **BDPatientProfile** with Bangladesh-specific identifier and address extensions.
- **BDPractitionerProfile** to capture practitioner details.
- **Identifier CodeSystem and ValueSet** including:
- National ID (NID)
- Birth Registration Number (BRN)
- Unique Health ID (UHID)
- **Bangladesh Address profile** with Division, District, Upazila, and Union levels.
- Initial **examples** for Patient and Practitioner resources.
- Configured **bd.fhir.core.xml** with canonical URL `https://fhir.dghs.gov.bd/core`.
### Notes
- This is a **pre-release draft**.
- Backward compatibility is **not guaranteed** until `1.0.0`.
- Future drafts may adjust slicing rules, bindings, and extensions.
---

View File

@@ -1,42 +0,0 @@
# Multi-stage build for serving FHIR IG output
FROM nginx:alpine
# Copy the built IG output to nginx html directory
# (Uncomment and adjust the path if needed)
COPY output/ /usr/share/nginx/html/
# Copy custom nginx configuration
COPY nginx.conf /etc/nginx/nginx.conf
# Create a non-root user for security
RUN addgroup -g 1001 -S nginx-user && \
adduser -S -D -H -u 1001 -h /var/cache/nginx -s /sbin/nologin -G nginx-user -g nginx-user nginx-user
# Set proper permissions for Nginx directories
RUN chown -R nginx-user:nginx-user /usr/share/nginx/html && \
chown -R nginx-user:nginx-user /var/cache/nginx && \
chown -R nginx-user:nginx-user /var/log/nginx && \
chown -R nginx-user:nginx-user /etc/nginx/conf.d
# Fix Nginx PID permission issue
RUN mkdir -p /var/cache/nginx/run && \
chown -R nginx-user:nginx-user /var/cache/nginx/run
# Update nginx.conf to point PID to writable location
# Ensure your nginx.conf has:
# pid /var/cache/nginx/run/nginx.pid;
# Switch to non-root user
USER nginx-user
# Health check
# HEALTHCHECK --interval=30s --timeout=3s --start-period=5s --retries=3 \
# CMD curl -f http://localhost/ || exit 1
EXPOSE 80
# Start Nginx in foreground
# CMD ["nginx", "-g", "daemon off;"]
CMD ["nginx", "-g", "daemon off;", "-c", "/etc/nginx/nginx.conf"]

2
ig.ini
View File

@@ -1,7 +1,7 @@
[IG] [IG]
# ini file for the Implementation Guide publisher # ini file for the Implementation Guide publisher
# see comments below for instructions # see comments below for instructions
ig = input/myig.xml ig = input/bd.fhir.core.xml
#template = fhir.base.template#current #template = fhir.base.template#current
template = #bd-national-template template = #bd-national-template
#template = D:\Git\templates\ig-template-base #template = D:\Git\templates\ig-template-base

View File

@@ -13,7 +13,7 @@
</extension>--> </extension>-->
<url value="https://fhir.dghs.gov.bd/core/ImplementationGuide/bd.fhir.core"/> <url value="https://fhir.dghs.gov.bd/core/ImplementationGuide/bd.fhir.core"/>
<!-- This version will propagate to all artifacts unless the "propagate-version" extension is overridden --> <!-- This version will propagate to all artifacts unless the "propagate-version" extension is overridden -->
<version value="0.2.0"/> <version value="0.2.1"/>
<name value="BangladeshCoreFHIRIG"/> <name value="BangladeshCoreFHIRIG"/>
<title value="Bangladesh Core FHIR Implementation Guide"/> <title value="Bangladesh Core FHIR Implementation Guide"/>
<status value="active"/> <status value="active"/>
@@ -78,9 +78,6 @@
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status"> <extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status">
<valueCode value="trial-use"/> <valueCode value="trial-use"/>
</extension> </extension>
<extension url="http://hl7.org/fhir/StructureDefinition/structuredefinition-fmm">
<valueInteger value="3"/>
</extension>
<nameUrl value="spec.html"/> <nameUrl value="spec.html"/>
<title value="Detailed BD-Core-FHIR Specification"/> <title value="Detailed BD-Core-FHIR Specification"/>
<generation value="markdown"/> <generation value="markdown"/>
@@ -114,7 +111,7 @@
<!-- releaselabel should be the ballot status for HL7-published IGs. --> <!-- releaselabel should be the ballot status for HL7-published IGs. -->
<parameter> <parameter>
<code value="releaselabel"/> <code value="releaselabel"/>
<value value="Published by MoHFW"/> <value value="Published by DGHS, MoHFW"/>
</parameter> </parameter>
<parameter> <parameter>
<code value="find-other-resources"/> <code value="find-other-resources"/>
@@ -153,10 +150,6 @@
<code value="excludemap"/> <code value="excludemap"/>
<value value="true"/> <value value="true"/>
</parameter>--> </parameter>-->
<parameter>
<code value="showsource"/>
<value value="true"/>
</parameter>
<parameter> <parameter>
<code value="i18n-default-lang"/> <code value="i18n-default-lang"/>
<value value="en"/> <value value="en"/>
@@ -177,9 +170,5 @@
<code value="translation-sources"/> <code value="translation-sources"/>
<value value="input/translations-fr"/> <value value="input/translations-fr"/>
</parameter> </parameter>
<parameter>
<code value="fcp-approved-specification"/>
<value value="false"/>
</parameter>
</definition> </definition>
</ImplementationGuide> </ImplementationGuide>

View File

@@ -5,4 +5,4 @@ Title: "ICD 11"
Description: "Condition coded with ICD-11" Description: "Condition coded with ICD-11"
* code 1..1 MS * code 1..1 MS
* code from http://id.who.int/icd/release/11/mms (preferred) * code from BDConditionICD11VS (preferred)

View File

@@ -4,6 +4,8 @@ Title: "Bangladesh Immunization Reaction Code System"
Description: "Codes for adverse reactions after vaccination in Bangladesh." Description: "Codes for adverse reactions after vaccination in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-reaction" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-reaction"
* ^status = #active * ^status = #active
* ^caseSensitive = true
* ^experimental = false
* ^content = #complete * ^content = #complete
* #NONE "No Reaction" * #NONE "No Reaction"

View File

@@ -6,6 +6,8 @@ Id: bd-blood-groups
Title: "Bangladesh Blood Group CodeSystem" Title: "Bangladesh Blood Group CodeSystem"
Description: "Blood group codes according to CCDS guideline" Description: "Blood group codes according to CCDS guideline"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-blood-groups" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-blood-groups"
* ^caseSensitive = true
* ^experimental = false
* ^content = #complete * ^content = #complete
* #1 "O Positive" * #1 "O Positive"
* #2 "O Negative" * #2 "O Negative"
@@ -20,7 +22,7 @@ Description: "Blood group codes according to CCDS guideline"
// ValueSet for BD Blood Groups // ValueSet for BD Blood Groups
// --------------------------- // ---------------------------
ValueSet: BDBloodGroupVS ValueSet: BDBloodGroupVS
Id: bd-blood-group-vs Id: bd-blood-group-valueset
Title: "Bangladesh Blood Group ValueSet" Title: "Bangladesh Blood Group ValueSet"
Description: "Blood group value set according to CCDS guideline" Description: "Blood group value set according to CCDS guideline"
* include codes from system BDBloodGroupCS * include codes from system BDBloodGroupCS

View File

@@ -1,7 +1,9 @@
CodeSystem: BDCountryListCS CodeSystem: BDCountryListCS
Id: bd-country-list-cs Id: bd-country-list
Title: "Nationality List" Title: "Nationality List"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-country-list" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-country-list"
* ^caseSensitive = true
* ^experimental = false
* #4 "Afghan" * #4 "Afghan"
* #8 "Albanian" * #8 "Albanian"
@@ -194,8 +196,8 @@ Title: "Nationality List"
ValueSet: BDCountryListVS ValueSet: BDCountryListVS
Id: bd-country-list-vs Id: bd-country-list-valueset
Title: "Nationality ValueSet" Title: "Nationality ValueSet"
Description: "Nationality value set" Description: "Nationality value set"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-country-list" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-country-list-valueset"
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-country-list * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-country-list

View File

@@ -1,8 +1,10 @@
CodeSystem: BDGeoCodesCS CodeSystem: BDGeoCodesCS
Id: bd-geocodes-cs Id: bd-geocodes
Title: "Bangladesh GeoCodes CodeSystem" Title: "Bangladesh GeoCodes CodeSystem"
Description: "Bangladesh GeoCodes" Description: "Bangladesh GeoCodes"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes"
* ^caseSensitive = true
* ^experimental = false
// DIvisions // DIvisions
* #30 "Dhaka" * #30 "Dhaka"
* #20 "Chattogram" * #20 "Chattogram"
@@ -1601,10 +1603,10 @@ Description: "Bangladesh GeoCodes"
* #4589009077 "Sreebardi Pourasabha" * #4589009077 "Sreebardi Pourasabha"
ValueSet: BDDivisionsVS ValueSet: BDDivisionsVS
Id: bd-division-code-vs Id: bd-division-code-valueset
Title: "Bangladesh Division ValueSet" Title: "Bangladesh Division ValueSet"
Description: "Bangladesh Division Codes (only two-digit codes)" Description: "Bangladesh Division Codes (only two-digit codes)"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-divisions" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-division-code-valueset"
// include only codes that are exactly 2 digits // include only codes that are exactly 2 digits
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes
@@ -1612,10 +1614,10 @@ Description: "Bangladesh Division Codes (only two-digit codes)"
ValueSet: BDDistrictsVS ValueSet: BDDistrictsVS
Id: bd-district-code-vs Id: bd-district-code-valueset
Title: "Bangladesh district ValueSet" Title: "Bangladesh district ValueSet"
Description: "Bangladesh district Codes (only two-digit codes)" Description: "Bangladesh district Codes (only two-digit codes)"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-districts" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-district-code-valueset"
// include only codes that are exactly 4 digits // include only codes that are exactly 4 digits
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes
@@ -1623,10 +1625,10 @@ Description: "Bangladesh district Codes (only two-digit codes)"
ValueSet: BDCityCorporationsVS ValueSet: BDCityCorporationsVS
Id: bd-city-corporations-code-vs Id: bd-city-corporation-code-valueset
Title: "Bangladesh City Corperation ValueSet" Title: "Bangladesh City Corperation ValueSet"
Description: "Bangladesh City Corperation Codes (only two-digit codes)" Description: "Bangladesh City Corperation Codes (only two-digit codes)"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-city-corporations" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-city-corporation-code-valueset"
// include only codes that are exactly 6 digits // include only codes that are exactly 6 digits
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes
@@ -1634,20 +1636,20 @@ Description: "Bangladesh City Corperation Codes (only two-digit codes)"
ValueSet: BDUpazillasVS ValueSet: BDUpazillasVS
Id: bd-upazillas-code-vs Id: bd-upazilla-code-valueset
Title: "Bangladesh Upazila ValueSet" Title: "Bangladesh Upazila ValueSet"
Description: "Bangladesh Upazila Codes (only two-digit codes)" Description: "Bangladesh Upazila Codes (only two-digit codes)"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-upazillas" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-upazilla-code-valueset"
// include only codes that are exactly 8 digits // include only codes that are exactly 8 digits
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes
where code regex "^[0-9]{8}$" where code regex "^[0-9]{8}$"
ValueSet: BDMunicipalitiesVS ValueSet: BDMunicipalitiesVS
Id: bd-municipalities-code-vs Id: bd-municipalities-code-valueset
Title: "Bangladesh Municipalities ValueSet" Title: "Bangladesh Municipalities ValueSet"
Description: "Bangladesh Municipalities Codes (only two-digit codes)" Description: "Bangladesh Municipalities Codes (only two-digit codes)"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-municipalities" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-municipalities-code-valueset"
// include only codes that are exactly 10 digits // include only codes that are exactly 10 digits
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes

View File

@@ -1,9 +1,12 @@
//// this code systems for Identifier types //// this code systems for Identifier types
CodeSystem: BangladeshIdentifierType CodeSystem: BangladeshIdentifierType
Id: bangladesh-identifier-type-cs Id: bd-identifier-type
Title: "Bangladesh Identifier Types" Title: "Bangladesh Identifier Types"
Description: "Codes identifying the type of identifiers used in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type"
* ^caseSensitive = true
* ^experimental = false
* #NID "National ID" * #NID "National ID"
* #BRN "Birth Registration Number" * #BRN "Birth Registration Number"
@@ -11,10 +14,10 @@ Title: "Bangladesh Identifier Types"
ValueSet: BangladeshIdentifierTypeVS ValueSet: BangladeshIdentifierTypeVS
Id: bangladesh-identifier-type-vs Id: bd-identifier-type-valueset
Title: "Bangladesh Identifier Type" Title: "Bangladesh Identifier Type"
Description: "Bangladesh Standard Identifier type" Description: "Bangladesh Standard Identifier type"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type-valueset"
// * include codes from valueset http://hl7.org/fhir/ValueSet/identifier-type /// use name or uri // * include codes from valueset http://hl7.org/fhir/ValueSet/identifier-type /// use name or uri
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type

View File

@@ -4,6 +4,8 @@ Title: "Bangladesh Immunization Site Code System"
Description: "Codes for anatomical site of vaccine administration in Bangladesh." Description: "Codes for anatomical site of vaccine administration in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-site" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-site"
* ^status = #active * ^status = #active
* ^caseSensitive = true
* ^experimental = false
* ^content = #complete * ^content = #complete
* #LA "Left Arm" * #LA "Left Arm"

View File

@@ -1,8 +1,10 @@
CodeSystem: BDMedicationCodeSystem CodeSystem: BDMedicationCodeSystem
Id: bd-medication-cs Id: bd-medication-code
Title: "Bangladesh Medication Codes" Title: "Bangladesh Medication Codes"
Description: "Bangladesh Medication Codes" Description: "Bangladesh Medication Codes"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-medication-code" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-medication-code"
* ^caseSensitive = true
* ^experimental = false
// DGDA DAR Code "Brand Name" // DGDA DAR Code "Brand Name"
* #394-0010-030 "Tubutol" "Ethambutol" * #394-0010-030 "Tubutol" "Ethambutol"
* #394-0011-030 "AFDCDT-2" "Isoniazid + Rifampicin" * #394-0011-030 "AFDCDT-2" "Isoniazid + Rifampicin"
@@ -16,7 +18,7 @@ Description: "Bangladesh Medication Codes"
// ValueSet for BD Medication // ValueSet for BD Medication
// --------------------------- // ---------------------------
ValueSet: BDMedicationVS ValueSet: BDMedicationVS
Id: bd-medication-vs Id: bd-medication-valueset
Title: "Bangladesh Medication ValueSet" Title: "Bangladesh Medication ValueSet"
Description: "Bangladesh Medication ValueSet" Description: "Bangladesh Medication ValueSet"
* include codes from system BDMedicationCodeSystem * include codes from system BDMedicationCodeSystem

View File

@@ -34,8 +34,8 @@ Description: "Medication dose form codes according to CCDS guideline"
// ValueSet for BD Medication Dose Forms // ValueSet for BD Medication Dose Forms
// --------------------------- // ---------------------------
ValueSet: BDMedicationDoseFormVS ValueSet: BDMedicationDoseFormVS
Id: bd-dose-form-vs Id: bd-dose-form-valueset
Title: "Bangladesh Medication Dose Form ValueSet" Title: "Bangladesh Medication Dose Form ValueSet"
Description: "Medication dose form value set according to CCDS guideline" Description: "Medication dose form value set according to CCDS guideline"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-dose-form-vs" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-dose-form-valueset"
* include codes from system BDMedicationDoseForm * include codes from system BDMedicationDoseForm

View File

@@ -1,6 +1,7 @@
CodeSystem: BDOccupationsCS CodeSystem: BDOccupationsCS
Id: bangladesh-occupations-cs Id: bd-occupations
Title: "Bangladesh Occupations" Title: "Bangladesh Occupations"
Description: "Occupations code system according to CCDS guideline"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-occupations" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-occupations"
* #1 "Physical Scientists & Related Technicians" "ভৌত বিজ্ঞানী ও এতদসংক্রান্ত টেকনিশিয়ান" * #1 "Physical Scientists & Related Technicians" "ভৌত বিজ্ঞানী ও এতদসংক্রান্ত টেকনিশিয়ান"
@@ -76,8 +77,8 @@ Title: "Bangladesh Occupations"
* #92 "Printers and Related Workers" "মুদ্রণকাজ" * #92 "Printers and Related Workers" "মুদ্রণকাজ"
ValueSet: BDOccupationsVS ValueSet: BDOccupationsVS
Id: bd-occupations-vs Id: bd-occupations-valueset
Title: "Bangladesh Occupations ValueSet" Title: "Bangladesh Occupations ValueSet"
Description: "Occupations value set according to CCDS guideline" Description: "Occupations value set according to CCDS guideline"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-occupations" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-occupations-valueset"
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-occupations * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-occupations

View File

@@ -1,6 +1,6 @@
//codeSystems/bd-regions.fsh //codeSystems/bd-regions.fsh
CodeSystem: BDReligionsCS CodeSystem: BDReligionsCS
Id: bangladesh-religions-cs Id: bd-religions
Title: "Bangladesh Religions" Title: "Bangladesh Religions"
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-religions" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-religions"
@@ -13,8 +13,8 @@ Title: "Bangladesh Religions"
* #0 "Other (specify)" "Other religion (to be specified in free text)" * #0 "Other (specify)" "Other religion (to be specified in free text)"
ValueSet: BDReligionsVS ValueSet: BDReligionsVS
Id: bd-religions-vs Id: bd-religions-valueset
Title: "Bangladesh Religions ValueSet" Title: "Bangladesh Religions ValueSet"
Description: "Religions value set according to CCDS guideline" Description: "Religions value set according to CCDS guideline"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-religions" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-religions-valueset"
* include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-religions * include codes from system https://fhir.dghs.gov.bd/core/CodeSystem/bd-religions

View File

@@ -4,6 +4,8 @@ Title: "Bangladesh Vaccine Code System"
Description: "Vaccine codes used in Bangladesh EPI and immunization program." Description: "Vaccine codes used in Bangladesh EPI and immunization program."
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-vaccine-code" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-vaccine-code"
* ^status = #active * ^status = #active
* ^caseSensitive = true
* ^experimental = false
* ^content = #complete * ^content = #complete
* #BCG "BCG Vaccine" * #BCG "BCG Vaccine"

View File

@@ -4,6 +4,8 @@ Title: "Bangladesh Immunization Route Code System"
Description: "Codes for routes of vaccine administration in Bangladesh." Description: "Codes for routes of vaccine administration in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-route" * ^url = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-immunization-route"
* ^status = #active * ^status = #active
* ^caseSensitive = true
* ^experimental = false
* ^content = #complete * ^content = #complete
* #IM "Intramuscular" * #IM "Intramuscular"

View File

@@ -10,4 +10,4 @@ Description: "Nationality of the patient based on Bangladesh country list."
// Only one value, bound to your ValueSet // Only one value, bound to your ValueSet
* value[x] only CodeableConcept * value[x] only CodeableConcept
* valueCodeableConcept from https://fhir.dghs.gov.bd/core/ValueSet/bd-country-list (required) * valueCodeableConcept from https://fhir.dghs.gov.bd/core/ValueSet/bd-country-list-valueset (required)

View File

@@ -7,5 +7,5 @@ Context: Patient
// occupation using standard HL7 extension // occupation using standard HL7 extension
* value[x] only string * value[x] only string
* value[x] from https://fhir.dghs.gov.bd/core/ValueSet/bd-occupations (required) * value[x] from https://fhir.dghs.gov.bd/core/ValueSet/bd-occupations-valueset (required)

View File

@@ -7,28 +7,31 @@ Description: "Profile of Encounter Bangladesh Standard"
* identifier 1..* * identifier 1..*
* status 1..1 MS * status 1..1
* status from BDEncounterStatusSubsetVS * status from BDEncounterStatusSubsetVS
* status ^short = "Encounter status in BD"
* status ^definition = "Status of patient encounter (planned, in-progress, finished, cancelled)"
* class 1..1 MS * class 1..1
* class from BDEncounterClassSubsetVS * class from BDEncounterClassSubsetVS
* subject 1..1 MS * subject 1..1
//* subject from https://fhir.dghs.gov.bd/core/StructureDefinition/bd-patient //* subject from https://fhir.dghs.gov.bd/core/StructureDefinition/bd-patient
* basedOn 0..1 MS * basedOn 0..1 MS
//* basedOn only Reference (CarePlan or DeviceRequest or MedicationRequest or ServiceRequest)
* partOf 0..1 MS * partOf 0..1 MS
* serviceProvider 1..1 MS * serviceProvider 1..1
* participant 1..* MS * participant 1..*
* participant.period 1..1 MS * participant.period 1..1
* diagnosis 0..* MS * diagnosis 0..* MS
* diagnosis.condition only Reference(BDConditionProfile) * diagnosis.condition only Reference(BDConditionProfile)
//* admission 0..* MS
//* admission.dischargeDisposition 0..1 MS
//* encounter.admission.dischargeDisposition 0..1 * hospitalization.dischargeDisposition 0..1 MS

View File

@@ -1,5 +1,3 @@
// @Name: Profile // @Name: Profile
// @Description: Immunization Profile of the Bangladeshi Patient. // @Description: Immunization Profile of the Bangladeshi Patient.
Profile: BDImmunizationProfile Profile: BDImmunizationProfile
@@ -13,7 +11,6 @@ Description: "Bangladesh Immunization Profile"
* identifier 1..* * identifier 1..*
* identifier ^short = "Unique identifier" * identifier ^short = "Unique identifier"
* identifier ^definition = "Unique identifier for the vaccination event" * identifier ^definition = "Unique identifier for the vaccination event"
* ^url = "https://fhir.dghs.gov.bd/core/identifier/bd-immunization"
* reasonReference 0..* * reasonReference 0..*
* reasonReference only Reference(Condition or Observation or DiagnosticReport) * reasonReference only Reference(Condition or Observation or DiagnosticReport)
@@ -26,7 +23,7 @@ Description: "Bangladesh Immunization Profile"
* manufacturer 0..1 * manufacturer 0..1
* manufacturer ^short = "Manufacturer" * manufacturer ^short = "Manufacturer"
* manufacturer ^definition = "Vaccine manufacturer" * manufacturer ^definition = "Vaccine manufacturer"
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-organization" * manufacturer only Reference(BDOrganization)
* lotNumber 0..1 * lotNumber 0..1
* lotNumber ^short = "Vaccine Lot Number" * lotNumber ^short = "Vaccine Lot Number"

View File

@@ -51,7 +51,7 @@ Patient profile for Bangladesh.
* identifier[NID].system = "http://dghs.gov.bd/identifier/nid" * identifier[NID].system = "http://dghs.gov.bd/identifier/nid"
* identifier[NID].type.coding.code = #NID * identifier[NID].type.coding.code = #NID
// * identifier[NID].type.coding.system = "http://terminology.hl7.org/CodeSystem/v2-0203" // * identifier[NID].type.coding.system = "http://terminology.hl7.org/CodeSystem/v2-0203"
* identifier[NID].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type" * identifier[NID].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type-valueset"
* identifier[NID].type from BangladeshIdentifierTypeVS (extensible) * identifier[NID].type from BangladeshIdentifierTypeVS (extensible)
* identifier[NID].type.text = "Organization identifier" * identifier[NID].type.text = "Organization identifier"
// * identifier[NID].value = "Personal identifier National ID" // * identifier[NID].value = "Personal identifier National ID"
@@ -61,7 +61,7 @@ Patient profile for Bangladesh.
* identifier[BRN].system = "http://dghs.gov.bd/identifier/brn" * identifier[BRN].system = "http://dghs.gov.bd/identifier/brn"
* identifier[BRN].type.coding.code = #BRN * identifier[BRN].type.coding.code = #BRN
* identifier[BRN].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type" * identifier[BRN].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type-valueset"
* identifier[BRN].type from BangladeshIdentifierTypeVS (extensible) * identifier[BRN].type from BangladeshIdentifierTypeVS (extensible)
* identifier[BRN].type.text = "Organization identifier" * identifier[BRN].type.text = "Organization identifier"
// * identifier[BRN].value = "Personal identifier Birth Registration" // * identifier[BRN].value = "Personal identifier Birth Registration"
@@ -69,7 +69,7 @@ Patient profile for Bangladesh.
* identifier[UHID].system = "http://dghs.gov.bd/identifier/uhid" * identifier[UHID].system = "http://dghs.gov.bd/identifier/uhid"
* identifier[UHID].type.coding.code = #UHID * identifier[UHID].type.coding.code = #UHID
* identifier[UHID].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type" * identifier[UHID].type.coding.system = "https://fhir.dghs.gov.bd/core/ValueSet/bd-identifier-type-valueset"
* identifier[UHID].type from BangladeshIdentifierTypeVS (extensible) * identifier[UHID].type from BangladeshIdentifierTypeVS (extensible)
* identifier[UHID].type.text = "Organization identifier" * identifier[UHID].type.text = "Organization identifier"
@@ -96,7 +96,7 @@ Patient profile for Bangladesh.
// Religion using standard HL7 extension // Religion using standard HL7 extension
* extension contains http://hl7.org/fhir/StructureDefinition/patient-religion named religion 0..1 * extension contains http://hl7.org/fhir/StructureDefinition/patient-religion named religion 0..1
* extension[religion].valueCodeableConcept from https://fhir.dghs.gov.bd/core/ValueSet/bd-religions * extension[religion].valueCodeableConcept from https://fhir.dghs.gov.bd/core/ValueSet/bd-religions-valueset
* address 1..* MS * address 1..* MS
* address only BDAddress * address only BDAddress

View File

@@ -0,0 +1,6 @@
ValueSet: BDConditionICD11VS
Id: bd-condition-icd11-valueset
Title: "Bangladesh ICD-11 MMS ValueSet"
Description: "ValueSet that includes the ICD-11 MMS CodeSystem for Condition.code"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-condition-icd11-valueset"
* include codes from system http://id.who.int/icd/release/11/mms

View File

@@ -1,6 +1,6 @@
// ---------- ValueSet ---------- // ---------- ValueSet ----------
ValueSet: BDEncounterClassSubsetVS ValueSet: BDEncounterClassSubsetVS
Id: bd-encounter-class-subset-vs Id: bd-encounter-class-subset
Title: "BD Encounter Class Subset" Title: "BD Encounter Class Subset"
Description: "Subset of EncounterClass limited to inpatient, ambulatory, and emergency." Description: "Subset of EncounterClass limited to inpatient, ambulatory, and emergency."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-encounter-class-subset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-encounter-class-subset"

View File

@@ -1,6 +1,6 @@
// ---------- ValueSet ---------- // ---------- ValueSet ----------
ValueSet: BDEncounterStatusSubsetVS ValueSet: BDEncounterStatusSubsetVS
Id: bd-encounter-status-subset-vs Id: bd-encounter-status-subset
Title: "BD Encounter Status Subset" Title: "BD Encounter Status Subset"
Description: "Subset of EncounterStatus limited to planned, in-progress, finished, and cancelled." Description: "Subset of EncounterStatus limited to planned, in-progress, finished, and cancelled."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-encounter-status-subset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-encounter-status-subset"

View File

@@ -1,5 +1,5 @@
ValueSet: BDImmunizationReactionValueSet ValueSet: BDImmunizationReactionValueSet
Id: bd-immunization-reaction-vs Id: bd-immunization-reaction-valueset
Title: "Bangladesh Immunization Reaction Value Set" Title: "Bangladesh Immunization Reaction Value Set"
Description: "Allowed vaccine reactions for immunization in Bangladesh." Description: "Allowed vaccine reactions for immunization in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-reaction-valueset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-reaction-valueset"

View File

@@ -1,5 +1,5 @@
ValueSet: BDImmunizationRouteVS ValueSet: BDImmunizationRouteVS
Id: bd-immunization-route-vs Id: bd-immunization-route-valueset
Title: "Bangladesh Immunization Route Value Set" Title: "Bangladesh Immunization Route Value Set"
Description: "Allowed administration routes for vaccines in Bangladesh." Description: "Allowed administration routes for vaccines in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-route-valueset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-route-valueset"

View File

@@ -1,5 +1,5 @@
ValueSet: BDImmunizationSiteVS ValueSet: BDImmunizationSiteVS
Id: bd-immunization-site-vs Id: bd-immunization-site-valueset
Title: "Bangladesh Immunization Site Value Set" Title: "Bangladesh Immunization Site Value Set"
Description: "Allowed administration sites for vaccines in Bangladesh." Description: "Allowed administration sites for vaccines in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-site-valueset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-immunization-site-valueset"

View File

@@ -1,6 +1,8 @@
ValueSet: BDLanguageVS ValueSet: BDLanguageVS
Id: bd-language-vs Id: bd-language-valueset
Title: "Allowed Languages" Title: "Allowed Languages"
Description: "Only English and Bengali are allowed" Description: "Only English and Bengali are allowed"
* http://hl7.org/fhir/ValueSet/languages#en "English" * urn:ietf:bcp:47#en "English"
* http://hl7.org/fhir/ValueSet/languages#bn "Bengali" * urn:ietf:bcp:47#bn "Bengali"
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-language-valueset"

View File

@@ -1,5 +1,5 @@
ValueSet: BDVaccineVS ValueSet: BDVaccineVS
Id: bd-vaccine-vs Id: bd-vaccine-valueset
Title: "Bangladesh Vaccine Value Set" Title: "Bangladesh Vaccine Value Set"
Description: "Allowed vaccines for immunization in Bangladesh." Description: "Allowed vaccines for immunization in Bangladesh."
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-vaccine-valueset" * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-vaccine-valueset"

Binary file not shown.

After

Width:  |  Height:  |  Size: 347 KiB

View File

@@ -38,4 +38,6 @@
</li> </li>
</ul> </ul>
</li> </li>
<li><a href="https://pdb.shrlive.dghs.gov.bd">SHR Dashboard</a></li>
<li><a href="https://en.info.shr.dghs.gov.bd">Learn More</a></li>
</ul> </ul>

View File

@@ -1,10 +1,34 @@
<div xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../input-cache/schemas/R5/fhir-single.xsd"> <div xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://hl7.org/fhir ../../input-cache/schemas/R5/fhir-single.xsd">
<h3>Heading 1</h3>
<p> <p>
Some text The Bangladesh Core FHIR Implementation Guide defines national base
profiles, code systems, and value sets to ensure interoperability across
digital health systems under DGHS and MoHFW.
</p> </p>
<h3>Heading 2</h3>
<h3>Motivation</h3>
<p> <p>
<img height="600" src="anImage.png" alt="A sample image"/> Bangladesh has multiple health information systems developed over the
years, including DHIS2, multiple hospital automation systems, field automation systems, and HRIS. These systems use different data
standards, which makes interoperability difficult. This guide aligns
national systems with HL7® FHIR® R4 to ensure semantic consistency and
facilitate integration with global initiatives.
</p>
<h3>Scope</h3>
<ul>
<li>Patient identity management (UHID, NID, BRN)</li>
<li>Health facility and organization registry</li>
<li>Immunization, laboratory, and condition profiles</li>
<li>Terminology services (ICD-11, SNOMED subsets, local CodeSystems)</li>
</ul>
<h3>National Digital Health Architecture</h3>
<p>
The following diagram shows how FHIR-based services are integrated into
Bangladesh's national digital health architecture:
</p>
<p>
<img src="bd-core-architecture.png" alt="Bangladesh Digital Health Architecture" style="max-width:100%; height:auto"/>
</p> </p>
</div> </div>

View File

@@ -0,0 +1,14 @@
{
"package-id": "bd.fhir.core",
"version": "0.2.0",
"path": "https://fhir.dghs.gov.bd/core/0.2.0",
"mode": "working",
"status": "trial-use",
"sequence": "STU1",
"desc": "First draft release of the Bangladesh Core FHIR Implementation Guide",
"descmd": "# Bangladesh Core FHIR IG - Release 0.2.0\n\nThis is the first draft release of the Bangladesh Core FHIR Implementation Guide. It defines national base profiles, value sets, and extensions for health data interoperability in Bangladesh.\n\n## Key Features\n- Base profiles for common FHIR resources\n- National value sets and code systems\n- Extensions for Bangladesh-specific requirements\n\n## Status\nThis is a trial-use release. Implementers are encouraged to provide feedback.",
"first": true,
"category": "National Base",
"ci-build": "https://fhir.dghs.gov.bd/core/",
"package-list": "https://fhir.dghs.gov.bd/core/package-list.json"
}

33
package-feed.xml Normal file
View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
<id>https://fhir.dghs.gov.bd/core/package-feed.xml</id>
<title>Bangladesh Core FHIR IG Package Feed</title>
<subtitle>FHIR Package Feed for bd.fhir.core</subtitle>
<link rel="self" href="https://fhir.dghs.gov.bd/core/package-feed.xml"/>
<link rel="alternate" href="https://fhir.dghs.gov.bd/core/"/>
<updated>2025-10-02T00:00:00Z</updated>
<author>
<name>MIS, Directorate General of Health Services (DGHS), Bangladesh</name>
<uri>https://dghs.gov.bd</uri>
</author>
<!-- Entries will be automatically added by the CI/CD pipeline -->
<!-- Example entry structure (will be generated): -->
<!--
<entry>
<title>bd.fhir.core version 0.2.0</title>
<link rel="alternate" href="https://fhir.dghs.gov.bd/core/0.2.0/"/>
<id>https://fhir.dghs.gov.bd/core/0.2.0/</id>
<updated>2025-10-02T00:00:00Z</updated>
<summary>Release 0.2.0 of Bangladesh Core FHIR Implementation Guide</summary>
</entry>
-->
<entry>
<title>bd.fhir.core version 0.2.0</title>
<link rel="alternate" href="https://fhir.dghs.gov.bd/core/0.2.0/"/>
<id>https://fhir.dghs.gov.bd/core/0.2.0/</id>
<updated>2025-10-02T00:00:00Z</updated>
<summary>First draft release of Bangladesh Core FHIR Implementation Guide</summary>
</entry>
</feed>

23
package-list.backup Normal file
View File

@@ -0,0 +1,23 @@
{
"package-id": "bd.fhir.core",
"title": "Bangladesh Core FHIR Implementation Guide",
"canonical": "https://fhir.dghs.gov.bd",
"introduction": "The Bangladesh Core FHIR IG defines national base profiles, value sets, and extensions for health data interoperability.",
"list": [
{
"version": "current",
"desc": "Continuous Integration Build (latest development version)",
"path": "https://fhir.dghs.gov.bd/build",
"status": "ci-build",
"current": true
},
{
"version": "v0.2.0",
"date": "2025-10-02",
"desc": "First draft release of the Bangladesh Core FHIR IG.",
"path": "https://fhir.dghs.gov.bd/v0.2.0",
"status": "trial-use",
"sequence": "STU 1"
}
]
}

View File

@@ -1,20 +1,23 @@
{ {
"package-id" : "hl7.fhir.uv.myig", "package-id": "bd.fhir.core",
"title" : "Your User Friendly Name for MyIG Here", "title": "Bangladesh Core FHIR Implementation Guide",
"canonical" : "http://hl7.org/fhir/uv/myig", "canonical": "https://fhir.dghs.gov.bd/core/",
"introduction" : "The introduction that should appear in the FHIR IG registry", "introduction": "The Bangladesh Core FHIR IG defines national base profiles, value sets, and extensions for health data interoperability.",
"list" : [{ "list": [
{
"version": "current", "version": "current",
"desc" : "Continuous Integration Build (latest in version control)", "desc": "Continuous Integration Build (latest in development)",
"path" : "http://hl7.org/fhir/ig/HL7/myig", "path": "https://fhir.dghs.gov.bd/core/",
"status": "ci-build", "status": "ci-build",
"current": true "current": true
},{ },
"version" : "0.1.0", {
"date" : "2099-01-01", "version": "0.2.0",
"desc" : "Initial STU ballot (Mmm yyyy Ballot)", "date": "2025-10-02",
"path" : "http://hl7.org/fhir/yyyyMmm/myig.html", "desc": "First draft release of the Bangladesh Core FHIR IG",
"status" : "ballot", "path": "https://fhir.dghs.gov.bd/core/0.2.0/",
"sequence" : "DSTU 1" "status": "trial-use",
}] "sequence": "STU 1"
}
]
} }

View File

@@ -0,0 +1,12 @@
{
"package-id": "bd.fhir.core",
"title": "Bangladesh Core FHIR Implementation Guide",
"canonical": "https://fhir.dghs.gov.bd",
"version": "0.2.0",
"path": "https://fhir.dghs.gov.bd",
"status": "trial-use",
"sequence": "STU 1",
"mode": "milestone",
"desc": "First draft release of the Bangladesh Core FHIR IG.",
"first": true
}