Compare commits
86 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| e9561f15b3 | |||
| 35c504e842 | |||
| 89fe6688b7 | |||
| 870747d14a | |||
| 65758559cd | |||
| 677de56269 | |||
| 7fb7e5f73e | |||
| 15247c1170 | |||
| 3d3e0c580d | |||
| 54704c7404 | |||
| 7cffa7f5d9 | |||
| a8ada6f73b | |||
| 278864ac6d | |||
| 5619336d09 | |||
| a0f0719f9c | |||
| 49b3d72cb2 | |||
| 4813f63da5 | |||
| 04ef3b0b55 | |||
| 25f0017595 | |||
| a5e39b94d3 | |||
| 9968c28e5c | |||
| 7125b57aa2 | |||
| 958eba6c44 | |||
| fcb5002641 | |||
| b7c824b34a | |||
| e8cf5ab9be | |||
| c35bc8e8a4 | |||
| c2e7119335 | |||
| c6903044aa | |||
| aca893377c | |||
| ccf6fef643 | |||
| c80f2f3a40 | |||
| 804a7ff3d6 | |||
| db2f074cbe | |||
| 7731328402 | |||
| a5d41e88de | |||
| 5ca0ffdd86 | |||
| d82e428e24 | |||
| dc43651043 | |||
| 2fc782a082 | |||
| 2db03cd2cc | |||
| 323abf04dc | |||
| e3de38a794 | |||
| 9ed33227d3 | |||
| 8ddb62ab26 | |||
| c2be28e714 | |||
| dee47229d7 | |||
| a60c2c6c21 | |||
| b759890259 | |||
| c9cf4c5157 | |||
| 45505bd4b8 | |||
| 3e1f6979b5 | |||
| c39615ff85 | |||
| 06d3a6ef13 | |||
| 8c8b8f032c | |||
| 4d24e3f30c | |||
| 57aba6ddc6 | |||
| 665ba07e37 | |||
| 18f71a6a04 | |||
| 83ad838fc4 | |||
| 63ca3fa44f | |||
| fdca2f9c3b | |||
| 3b48bd79e2 | |||
| b620db17d5 | |||
| f2201f4da8 | |||
| b3cf356b32 | |||
| 7cb360b1d2 | |||
| 6beb9318fe | |||
| 423d1c271f | |||
| 53190dddd6 | |||
| 5205c06bab | |||
| b89620b4ed | |||
| c195390fe7 | |||
| e6cb213212 | |||
| 0bce070ae2 | |||
| 9bf4b2d457 | |||
| 68c748b06e | |||
| 2b2ec21c24 | |||
| 80c870f8a0 | |||
| 5da54fa665 | |||
| 39717d3c1d | |||
|
|
777f2b3a0d | ||
|
|
791dda3931 | ||
|
|
205f3e58a1 | ||
|
|
c5e0a7d039 | ||
|
|
3297b88035 |
@@ -1,24 +1,315 @@
|
|||||||
name: FHIR IG CI/CD Pipeline
|
name: FHIR IG CI/CD Pipeline with Version Persistence
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, develop ]
|
tags:
|
||||||
|
- 'v*.*.*'
|
||||||
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:
|
||||||
runs-on: ubuntu-latest
|
runs-on: fhir-runner
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- 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: |
|
||||||
|
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
|
||||||
|
|
||||||
|
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||||
|
BUILD_TYPE="release"
|
||||||
|
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
|
|
||||||
|
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"
|
||||||
|
|
||||||
|
- name: Prepare package-list.json and history.xml for IG Publisher
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
|
||||||
|
DATE=$(date +%Y-%m-%d)
|
||||||
|
|
||||||
|
export VERSION DATE BUILD_TYPE
|
||||||
|
|
||||||
|
echo "📋 Preparing package-list.json and history.xml for IG Publisher..."
|
||||||
|
|
||||||
|
if [ ! -f "package-list.json" ]; then
|
||||||
|
echo "⚠️ package-list.json not found in repo root"
|
||||||
|
echo "Creating initial package-list.json..."
|
||||||
|
cat > package-list.json << 'PKGEOF'
|
||||||
|
{
|
||||||
|
"package-id": "bd.fhir.core",
|
||||||
|
"title": "Bangladesh Core FHIR Implementation Guide",
|
||||||
|
"canonical": "https://fhir.dghs.gov.bd/core",
|
||||||
|
"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 in version control)",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/",
|
||||||
|
"status": "ci-build",
|
||||||
|
"current": true
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
PKGEOF
|
||||||
|
fi
|
||||||
|
|
||||||
|
python3 << 'PYEOF'
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
|
||||||
|
version = os.environ.get('VERSION', '')
|
||||||
|
date = os.environ.get('DATE', '')
|
||||||
|
build_type = os.environ.get('BUILD_TYPE', '')
|
||||||
|
|
||||||
|
with open('package-list.json', 'r', encoding='utf-8') as f:
|
||||||
|
pkg_list = json.load(f)
|
||||||
|
|
||||||
|
if 'list' not in pkg_list or not isinstance(pkg_list['list'], list):
|
||||||
|
print("ERROR: package-list.json does not contain a valid 'list' array")
|
||||||
|
sys.exit(1)
|
||||||
|
|
||||||
|
current_entries = [e for e in pkg_list['list'] if e.get('version') == 'current']
|
||||||
|
if not current_entries:
|
||||||
|
pkg_list['list'].insert(0, {
|
||||||
|
"version": "current",
|
||||||
|
"desc": "Continuous Integration Build (latest in version control)",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/",
|
||||||
|
"status": "ci-build",
|
||||||
|
"current": True
|
||||||
|
})
|
||||||
|
|
||||||
|
if build_type == 'release':
|
||||||
|
version_entry = None
|
||||||
|
for e in pkg_list['list']:
|
||||||
|
if e.get('version') == version:
|
||||||
|
version_entry = e
|
||||||
|
break
|
||||||
|
if version_entry is None:
|
||||||
|
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_index = 1
|
||||||
|
for i, entry in enumerate(pkg_list['list']):
|
||||||
|
if entry.get('version') == 'current':
|
||||||
|
insert_index = i + 1
|
||||||
|
break
|
||||||
|
|
||||||
|
pkg_list['list'].insert(insert_index, new_entry)
|
||||||
|
print(f"✅ Added version {version} to package-list.json")
|
||||||
|
else:
|
||||||
|
print(f"ℹ️ Version {version} already exists in package-list.json")
|
||||||
|
else:
|
||||||
|
print("ℹ️ Dev build - using existing package-list.json without release modification")
|
||||||
|
|
||||||
|
with open('package-list.json', 'w', encoding='utf-8') as f:
|
||||||
|
json.dump(pkg_list, f, indent=2, ensure_ascii=False)
|
||||||
|
PYEOF
|
||||||
|
|
||||||
|
echo "🔍 Validating package-list.json..."
|
||||||
|
python3 -m json.tool package-list.json > /dev/null && echo "✅ Valid JSON" || (echo "❌ Invalid JSON!" && exit 1)
|
||||||
|
|
||||||
|
echo "📂 Ensuring package-list.json is in required locations..."
|
||||||
|
mkdir -p input
|
||||||
|
cp package-list.json input/package-list.json
|
||||||
|
|
||||||
|
echo "📝 Generating static history.xml from package-list.json..."
|
||||||
|
mkdir -p input/pagecontent
|
||||||
|
|
||||||
|
python3 << 'PYEOF'
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
from html import escape
|
||||||
|
|
||||||
|
os.makedirs('input/pagecontent', exist_ok=True)
|
||||||
|
|
||||||
|
with open('package-list.json', 'r', encoding='utf-8') as f:
|
||||||
|
pkg_list = json.load(f)
|
||||||
|
|
||||||
|
xml = '''<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<div xmlns="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
|
<p>This page provides the version history for the Bangladesh Core FHIR Implementation Guide.</p>
|
||||||
|
|
||||||
|
<p>For a machine-readable version history see <a href="package-list.json">package-list.json</a>.</p>
|
||||||
|
|
||||||
|
<p><b>Published Versions</b></p>
|
||||||
|
|
||||||
|
<table class="grid table table-striped table-bordered table-hover">
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th>Version</th>
|
||||||
|
<th>Date</th>
|
||||||
|
<th>Status</th>
|
||||||
|
<th>Description</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
'''
|
||||||
|
|
||||||
|
def version_key(v):
|
||||||
|
try:
|
||||||
|
return tuple(int(x) for x in v.split('.'))
|
||||||
|
except:
|
||||||
|
return (0,)
|
||||||
|
|
||||||
|
published = [
|
||||||
|
e for e in pkg_list['list']
|
||||||
|
if e.get('version') and e.get('version') != "current"
|
||||||
|
]
|
||||||
|
|
||||||
|
# Sort newest version first
|
||||||
|
published.sort(
|
||||||
|
key=lambda e: version_key(e.get("version", "0.0.0")),
|
||||||
|
reverse=True
|
||||||
|
)
|
||||||
|
|
||||||
|
published_found = False
|
||||||
|
first_row = True
|
||||||
|
|
||||||
|
for entry in published:
|
||||||
|
published_found = True
|
||||||
|
|
||||||
|
version = escape(entry.get('version', 'Unknown'))
|
||||||
|
date = escape(entry.get('date', 'N/A'))
|
||||||
|
desc = escape(entry.get('desc', ''))
|
||||||
|
path = escape(entry.get('path', '#'))
|
||||||
|
|
||||||
|
status_val = entry.get('status', 'unknown')
|
||||||
|
|
||||||
|
if status_val == "trial-use":
|
||||||
|
status = '<span class="badge bg-info">Trial Use</span>'
|
||||||
|
elif status_val == "normative":
|
||||||
|
status = '<span class="badge bg-success">Normative</span>'
|
||||||
|
else:
|
||||||
|
status = f'<span class="badge bg-secondary">{escape(status_val)}</span>'
|
||||||
|
|
||||||
|
badge = '<span class="badge bg-success">Latest</span> ' if first_row else ''
|
||||||
|
|
||||||
|
xml += f'''
|
||||||
|
<tr>
|
||||||
|
<td><a href="{path}">{badge}{version}</a></td>
|
||||||
|
<td>{date}</td>
|
||||||
|
<td>{status}</td>
|
||||||
|
<td>{desc}</td>
|
||||||
|
</tr>
|
||||||
|
'''
|
||||||
|
|
||||||
|
first_row = False
|
||||||
|
|
||||||
|
if not published_found:
|
||||||
|
xml += '''
|
||||||
|
<tr>
|
||||||
|
<td colspan="4">No published versions available yet.</td>
|
||||||
|
</tr>
|
||||||
|
'''
|
||||||
|
|
||||||
|
xml += '''
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
|
||||||
|
<p class="lead"><b>Continuous Integration Build</b></p>
|
||||||
|
'''
|
||||||
|
|
||||||
|
current_entry = None
|
||||||
|
for entry in pkg_list['list']:
|
||||||
|
if entry.get('version') == 'current':
|
||||||
|
current_entry = entry
|
||||||
|
break
|
||||||
|
|
||||||
|
if current_entry:
|
||||||
|
path = escape(current_entry.get('path', pkg_list.get('canonical', '') + '/'))
|
||||||
|
xml += f'''
|
||||||
|
<p>The latest development build is available at:
|
||||||
|
<a href="{path}">{path}</a></p>
|
||||||
|
'''
|
||||||
|
else:
|
||||||
|
xml += '''
|
||||||
|
<p><i>No CI build entry found in package-list.json.</i></p>
|
||||||
|
'''
|
||||||
|
|
||||||
|
xml += '''
|
||||||
|
</div>
|
||||||
|
'''
|
||||||
|
|
||||||
|
with open('input/pagecontent/history.xml', 'w', encoding='utf-8') as f:
|
||||||
|
f.write(xml)
|
||||||
|
|
||||||
|
print("✅ Generated static history.xml")
|
||||||
|
print(f" File location: {os.path.abspath('input/pagecontent/history.xml')}")
|
||||||
|
print(f" File size: {os.path.getsize('input/pagecontent/history.xml')} bytes")
|
||||||
|
PYEOF
|
||||||
|
|
||||||
|
if [ -f "input/pagecontent/history.xml" ]; then
|
||||||
|
echo "✅ Verified: history.xml exists"
|
||||||
|
echo " First 20 lines:"
|
||||||
|
head -20 input/pagecontent/history.xml
|
||||||
|
else
|
||||||
|
echo "❌ ERROR: history.xml was not created!"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "✅ Pre-build preparation complete:"
|
||||||
|
echo " - Root: $(pwd)/package-list.json"
|
||||||
|
echo " - Input: $(pwd)/input/package-list.json"
|
||||||
|
echo " - History: $(pwd)/input/pagecontent/history.xml"
|
||||||
|
echo "==============================="
|
||||||
|
echo "PACKAGE LIST USED FOR BUILD:"
|
||||||
|
cat package-list.json
|
||||||
|
echo "-------------------------------"
|
||||||
|
echo "INPUT COPY:"
|
||||||
|
cat input/package-list.json
|
||||||
|
echo "==============================="
|
||||||
|
|
||||||
|
- name: Emergency Disk Cleanup
|
||||||
|
run: |
|
||||||
|
echo "Disk usage before:"
|
||||||
|
df -h
|
||||||
|
|
||||||
|
echo "Clearing tool cache..."
|
||||||
|
rm -rf /opt/hostedtoolcache/* || true
|
||||||
|
|
||||||
|
rm -rf /usr/share/dotnet || true
|
||||||
|
rm -rf /usr/local/lib/android || true
|
||||||
|
rm -rf /opt/ghc || true
|
||||||
|
rm -rf ~/.fhir/packages || true
|
||||||
|
|
||||||
|
echo "Disk usage after:"
|
||||||
|
df -h
|
||||||
|
|
||||||
- name: Install Docker CLI
|
- name: Install Docker CLI
|
||||||
run: |
|
run: |
|
||||||
@@ -26,258 +317,343 @@ jobs:
|
|||||||
apt-get install -y docker.io
|
apt-get install -y docker.io
|
||||||
docker --version
|
docker --version
|
||||||
|
|
||||||
- name: Setup Docker Buildx
|
- name: Preload previous IG package for comparison
|
||||||
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 "Detecting previous version..."
|
||||||
|
export VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
PREV_VERSION=$(python3 <<'PY'
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
|
current_build = os.environ.get("VERSION")
|
||||||
|
|
||||||
|
with open("package-list.json") as f:
|
||||||
|
data = json.load(f)
|
||||||
|
|
||||||
|
def parse(v):
|
||||||
|
try:
|
||||||
|
return tuple(int(x) for x in v.split("."))
|
||||||
|
except:
|
||||||
|
return (0,)
|
||||||
|
|
||||||
|
versions = [
|
||||||
|
v["version"]
|
||||||
|
for v in data["list"]
|
||||||
|
if v.get("version") not in ("current", current_build)
|
||||||
|
]
|
||||||
|
|
||||||
|
versions.sort(key=parse, reverse=True)
|
||||||
|
|
||||||
|
print(versions[0] if versions else "")
|
||||||
|
PY
|
||||||
|
)
|
||||||
|
|
||||||
|
if [ -z "$PREV_VERSION" ]; then
|
||||||
|
echo "No previous version found. Skipping preload."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo "Previous version detected: $PREV_VERSION"
|
||||||
|
|
||||||
|
mkdir -p previous-packages
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
|
URL="https://fhir.dghs.gov.bd/core/$PREV_VERSION/package.tgz"
|
||||||
|
|
||||||
|
echo "Downloading $URL"
|
||||||
|
curl -fL "$URL" -o "$TMPDIR/package.tgz"
|
||||||
|
|
||||||
|
mkdir -p "previous-packages/bd.fhir.core#$PREV_VERSION"
|
||||||
|
tar -xzf "$TMPDIR/package.tgz" -C "previous-packages/bd.fhir.core#$PREV_VERSION"
|
||||||
|
|
||||||
|
echo "Previous package cached:"
|
||||||
|
ls previous-packages
|
||||||
|
|
||||||
|
- name: Build FHIR IG
|
||||||
|
run: |
|
||||||
|
echo "Building FHIR IG version ${{ steps.version.outputs.version }}..."
|
||||||
|
|
||||||
# Create a container (don't start yet)
|
|
||||||
CONTAINER_ID=$(docker create \
|
CONTAINER_ID=$(docker create \
|
||||||
|
-v $(pwd)/previous-packages:/previous-packages \
|
||||||
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 "
|
||||||
|
|
||||||
|
mkdir -p /tmp/build
|
||||||
|
cp -r /home/publisher/ig /tmp/build/ig
|
||||||
|
|
||||||
|
cd /tmp/build/ig
|
||||||
|
|
||||||
|
rm -f package-list.json
|
||||||
|
|
||||||
|
_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/
|
echo "Mounted FHIR packages:"
|
||||||
|
ls -R previous-packages || echo "No previous packages directory"
|
||||||
# Start and wait for completion
|
docker start -a "$CONTAINER_ID"
|
||||||
docker start -a $CONTAINER_ID
|
|
||||||
EXIT_CODE=$?
|
EXIT_CODE=$?
|
||||||
|
|
||||||
# Copy outputs back
|
|
||||||
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/ig/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/ig/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/ig/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/ig/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
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "🔍 Checking for history.html..."
|
||||||
|
if [ -f "output/history.html" ]; then
|
||||||
|
echo "✅ history.html generated successfully!"
|
||||||
|
echo "📄 history.html size: $(ls -lh output/history.html | awk '{print $5}')"
|
||||||
|
else
|
||||||
|
echo "⚠️ WARNING: history.html was NOT generated"
|
||||||
|
echo "This might indicate an issue with the template or history.xml/package-list.json"
|
||||||
|
fi
|
||||||
|
echo "================================"
|
||||||
|
echo "IG Publisher comparison log:"
|
||||||
|
cat output/qa.compare.txt || echo "qa.compare.txt not found"
|
||||||
|
echo "================================"
|
||||||
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
|
if [ ! -f "package-feed.xml" ]; then
|
||||||
|
echo "⚠️ package-feed.xml not found, creating initial feed..."
|
||||||
|
|
||||||
|
cat > package-feed.xml <<EOF
|
||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<feed xmlns="http://www.w3.org/2005/Atom">
|
||||||
|
<title>bd.fhir.core</title>
|
||||||
|
<id>https://fhir.dghs.gov.bd/core/package-feed.xml</id>
|
||||||
|
<updated>$DATETIME</updated>
|
||||||
|
</feed>
|
||||||
|
EOF
|
||||||
fi
|
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 or ''):
|
||||||
|
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("✅ Updated package-feed.xml")
|
||||||
|
EOF
|
||||||
|
|
||||||
|
python3 update-feed.py "$VERSION" "$DATETIME"
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
echo "📦 Output contents:"
|
||||||
|
ls -lh output/ | grep -E "(history\.html|package-list\.json|package-feed\.xml|index\.html)" || echo "Some files may be missing"
|
||||||
|
|
||||||
|
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
|
source /tmp/fhir-ig-deploy/deployment.env
|
||||||
COMPOSE_FILE="docker-compose.prod.yml"
|
|
||||||
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
|
VERSIONS_DIR="/opt/fhir-ig/versions"
|
||||||
log() {
|
mkdir -p "$VERSIONS_DIR"
|
||||||
echo "$(date '+%Y-%m-%d %H:%M:%S') - $1" | tee -a "$LOG_FILE"
|
|
||||||
}
|
|
||||||
|
|
||||||
log "Starting deployment of BD Core FHIR IG..."
|
if [ "$build_type" = "release" ]; then
|
||||||
log "Registry: $REGISTRY"
|
TARGET_DIR="$VERSIONS_DIR/$version"
|
||||||
log "Image: $IMAGE_NAME"
|
echo "📦 Deploying release version to: $TARGET_DIR"
|
||||||
log "Tag: $IMAGE_TAG"
|
else
|
||||||
|
TARGET_DIR="$VERSIONS_DIR/dev"
|
||||||
# Login to registry
|
echo "🔧 Deploying dev build to: $TARGET_DIR"
|
||||||
echo "$GITEA_PASSWORD" | docker login $REGISTRY -u "$GITEA_USERNAME" --password-stdin
|
mkdir -p "$TARGET_DIR"
|
||||||
|
echo "Cleaning old dev files..."
|
||||||
# Backup current container if it exists
|
rm -rf "$TARGET_DIR"/*
|
||||||
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
|
mkdir -p "$TARGET_DIR"
|
||||||
export REGISTRY="$REGISTRY"
|
|
||||||
export IMAGE_NAME="$IMAGE_NAME"
|
|
||||||
export IMAGE_TAG="$IMAGE_TAG"
|
|
||||||
|
|
||||||
# Pull the latest image
|
echo "Extracting IG output..."
|
||||||
log "Pulling latest image: $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"
|
|
||||||
|
|
||||||
# docker pull "\${REGISTRY}/\${IMAGE_NAME}:\${IMAGE_TAG}"
|
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 "$TARGET_DIR/package-list.json" "$VERSIONS_DIR/package-list.json"
|
||||||
log "Stopping old container..."
|
cp "$TARGET_DIR/package-feed.xml" "$VERSIONS_DIR/package-feed.xml"
|
||||||
docker compose -f "$COMPOSE_FILE" down || log "No existing container to stop"
|
|
||||||
|
|
||||||
# Start new container
|
cp "$TARGET_DIR/package-list.json" "/opt/fhir-ig/package-list.json"
|
||||||
log "Starting new container..."
|
cp "$TARGET_DIR/package-feed.xml" "/opt/fhir-ig/package-feed.xml"
|
||||||
docker compose -f "$COMPOSE_FILE" up -d
|
|
||||||
|
|
||||||
# Wait for container to be healthy
|
if [ "$build_type" = "release" ]; then
|
||||||
# log "Waiting for container to become healthy..."
|
echo "Updating 'current' symlink to point to $version"
|
||||||
# timeout=120
|
rm -f "$VERSIONS_DIR/current"
|
||||||
# elapsed=0
|
ln -sf "$version" "$VERSIONS_DIR/current"
|
||||||
# healthy=false
|
fi
|
||||||
|
|
||||||
# while [ $elapsed -lt $timeout ]; do
|
cd /opt/fhir-ig
|
||||||
# if docker compose -f "$COMPOSE_FILE" ps --format json | grep -q '"Health":"healthy"'; then
|
|
||||||
# log "Container is healthy!"
|
|
||||||
# healthy=true
|
|
||||||
# break
|
|
||||||
# fi
|
|
||||||
# sleep 5
|
|
||||||
# elapsed=$((elapsed + 5))
|
|
||||||
# log "Waiting... ($elapsed/$timeout seconds)"
|
|
||||||
# done
|
|
||||||
|
|
||||||
# if [ "$healthy" = false ]; then
|
if [ ! -f "docker-compose.prod.yml" ]; then
|
||||||
# log "ERROR: Container failed to become healthy within $timeout seconds"
|
echo "ERROR: docker-compose.prod.yml not found!"
|
||||||
# docker compose -f "$COMPOSE_FILE" logs --tail=50
|
echo "Please deploy the updated docker-compose.prod.yml and nginx.conf first"
|
||||||
# log "Rolling back..."
|
exit 1
|
||||||
# docker compose -f "$COMPOSE_FILE" down
|
fi
|
||||||
# exit 1
|
|
||||||
# fi
|
|
||||||
|
|
||||||
# Cleanup old images (keep last 3 versions)
|
docker compose -f docker-compose.prod.yml up -d --force-recreate fhir-ig
|
||||||
log "Cleaning up old images..."
|
|
||||||
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"
|
|
||||||
|
|
||||||
# Cleanup old backups (keep only last 5)
|
rm -rf /tmp/fhir-ig-deploy
|
||||||
log "Cleaning up old backups..."
|
|
||||||
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
|
echo "Available versions:"
|
||||||
docker compose -f "$COMPOSE_FILE" ps
|
ls -lh "$VERSIONS_DIR" | grep -v total
|
||||||
DEPLOY_SCRIPT
|
|
||||||
|
|
||||||
# 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
|
|
||||||
@@ -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"]
|
|
||||||
|
|
||||||
1
ig.ini
1
ig.ini
@@ -6,6 +6,7 @@ ig = input/bd.fhir.core.xml
|
|||||||
template = #bd-national-template
|
template = #bd-national-template
|
||||||
#template = D:\Git\templates\ig-template-base
|
#template = D:\Git\templates\ig-template-base
|
||||||
#template = #local-template
|
#template = #local-template
|
||||||
|
historypage = true
|
||||||
|
|
||||||
##########################
|
##########################
|
||||||
### ig.ini parameters: ###
|
### ig.ini parameters: ###
|
||||||
|
|||||||
@@ -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.3.0"/>
|
||||||
<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"/>
|
||||||
@@ -102,6 +102,11 @@
|
|||||||
<title value="IG Change History"/>
|
<title value="IG Change History"/>
|
||||||
<generation value="html"/>
|
<generation value="html"/>
|
||||||
</page>
|
</page>
|
||||||
|
<page>
|
||||||
|
<nameUrl value="history.html"/>
|
||||||
|
<title value="Version History"/>
|
||||||
|
<generation value="html"/>
|
||||||
|
</page>
|
||||||
</page>
|
</page>
|
||||||
<!-- copyright year is a mandatory parameter -->
|
<!-- copyright year is a mandatory parameter -->
|
||||||
<parameter>
|
<parameter>
|
||||||
@@ -111,7 +116,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"/>
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
Profile: BDConditionProfile
|
|
||||||
Parent: Condition
|
|
||||||
Id: bd-condition
|
|
||||||
Title: "ICD 11"
|
|
||||||
Description: "Condition coded with ICD-11"
|
|
||||||
|
|
||||||
* code 1..1 MS
|
|
||||||
* code from BDConditionICD11VS (preferred)
|
|
||||||
47
input/fsh/codeSystems/ICD11MMSCS.fsh
Normal file
47
input/fsh/codeSystems/ICD11MMSCS.fsh
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
// ============================================================
|
||||||
|
// CodeSystem-icd11-mms.fsh
|
||||||
|
// ICD-11 Mortality and Morbidity Statistics (MMS) — stub only
|
||||||
|
// Content is hosted externally; canonical authority is WHO.
|
||||||
|
// Runtime resolution via OCL: https://tr.ocl.dghs.gov.bd
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
CodeSystem: ICD11MMSCS
|
||||||
|
Id: icd11-mms
|
||||||
|
Title: "ICD-11 Mortality and Morbidity Statistics (MMS)"
|
||||||
|
Description: """
|
||||||
|
WHO ICD-11 Mortality and Morbidity Statistics linearization.
|
||||||
|
Canonical system URI: http://id.who.int/icd/release/11/mms
|
||||||
|
|
||||||
|
This CodeSystem is declared as a stub (content = #not-present).
|
||||||
|
The authoritative content is maintained by the World Health Organization.
|
||||||
|
In Bangladesh, runtime code validation and lookup are delegated to the
|
||||||
|
national OCL terminology server at https://tr.ocl.dghs.gov.bd.
|
||||||
|
|
||||||
|
Supported operations (use `system=` parameter, not `url=`):
|
||||||
|
- $validate-code: https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$validate-code?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
- $lookup: https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$lookup?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
|
||||||
|
$expand is not supported — known OCL limitation. Expansion must not be
|
||||||
|
attempted at build time or by IG Publisher.
|
||||||
|
|
||||||
|
Preferred code form: short stem codes (e.g. 1A00, NC72.Z).
|
||||||
|
Linearization URIs are not used as code identifiers in this IG.
|
||||||
|
|
||||||
|
Version 2025-01 is imported into OCL with 36,941 concepts across
|
||||||
|
the following concept classes: Diagnosis, Finding, Substance, Organism,
|
||||||
|
Device, Anatomy, Misc.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "http://id.who.int/icd/release/11/mms"
|
||||||
|
* ^version = "2025-01"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "World Health Organization (WHO)"
|
||||||
|
* ^contact.name = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^copyright = "ICD-11 is copyright © World Health Organization. Used under licence."
|
||||||
|
* ^content = #not-present
|
||||||
|
* ^count = 36941
|
||||||
|
* ^caseSensitive = true
|
||||||
68
input/fsh/extensions/icd11ClusterExpression.fsh
Normal file
68
input/fsh/extensions/icd11ClusterExpression.fsh
Normal file
@@ -0,0 +1,68 @@
|
|||||||
|
// ============================================================
|
||||||
|
// icd11ClusterExpression.fsh
|
||||||
|
// Extension for ICD-11 postcoordinated cluster expressions
|
||||||
|
// Context: Coding (broad — usable across all ICD-11 coded elements)
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
Extension: ICD11ClusterExpression
|
||||||
|
Id: icd11-cluster-expression
|
||||||
|
Title: "ICD-11 Cluster Expression"
|
||||||
|
Description: """
|
||||||
|
Carries a postcoordinated ICD-11 cluster expression as a single string
|
||||||
|
on a Coding element where the stem code alone is insufficient to fully
|
||||||
|
represent the clinical concept.
|
||||||
|
|
||||||
|
A cluster expression combines a stem code with one or more satellite
|
||||||
|
codes using the & operator (combination) or / operator (specificity).
|
||||||
|
Example: NC72.Z&XK8G&XJ7ZH&XJ7YM
|
||||||
|
- NC72.Z — stem: Fracture of femur, unspecified
|
||||||
|
- XK8G — satellite: laterality
|
||||||
|
- XJ7ZH — satellite: fracture subtype
|
||||||
|
- XJ7YM — satellite: fracture open or closed
|
||||||
|
|
||||||
|
Usage rules:
|
||||||
|
- SHALL only be present when the expression contains at least one
|
||||||
|
satellite code joined by & or / operators.
|
||||||
|
- Single stem codes SHALL be represented in Coding.code only and
|
||||||
|
validated via OCL $validate-code. The cluster validator at
|
||||||
|
https://icd11.dghs.gov.bd/cluster/validate explicitly rejects
|
||||||
|
stem-only expressions.
|
||||||
|
- The stem code in Coding.code SHALL match the leading stem code
|
||||||
|
in this expression string.
|
||||||
|
- Satellite codes in the cluster expression are exempt from the
|
||||||
|
Diagnosis/Finding class restriction that applies to stem codes
|
||||||
|
in Condition.code.
|
||||||
|
- Cluster expressions SHALL be validated against the Bangladesh
|
||||||
|
ICD-11 Cluster Validator at https://icd11.dghs.gov.bd/cluster/validate
|
||||||
|
prior to submission to the HIE.
|
||||||
|
|
||||||
|
Cluster validator endpoint:
|
||||||
|
POST https://icd11.dghs.gov.bd/cluster/validate
|
||||||
|
Body: { "expression": "NC72.Z&XK8G&XJ7ZH&XJ7YM" }
|
||||||
|
|
||||||
|
This extension is not MustSupport and is not mandatory. It is present
|
||||||
|
only when postcoordination is clinically required. Cluster expressions
|
||||||
|
are typically sourced from the WHO Electronic Coding Tool (ECT) at the
|
||||||
|
point of care.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/icd11-cluster-expression"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.name = "DGHS Health Informatics Unit"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^context[+].type = #element
|
||||||
|
* ^context[=].expression = "Coding"
|
||||||
|
|
||||||
|
* value[x] only string
|
||||||
|
* valueString 1..1
|
||||||
|
* valueString ^short = "ICD-11 postcoordinated cluster expression string"
|
||||||
|
* valueString ^definition = """
|
||||||
|
The full postcoordinated cluster expression, including the stem code and
|
||||||
|
all satellite codes joined by & or / operators. Example:
|
||||||
|
NC72.Z&XK8G&XJ7ZH&XJ7YM. The stem code in this string SHALL match
|
||||||
|
Coding.code on the parent Coding element.
|
||||||
|
"""
|
||||||
@@ -1,39 +0,0 @@
|
|||||||
{
|
|
||||||
"resourceType": "StructureDefinition",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"id": "bd-Immunization",
|
|
||||||
"url": "http://example.org/StructureDefinition/bd-Immunization",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"name": "BDImmunizationProfile",
|
|
||||||
"title": "Immunization Profile for Bangladesh",
|
|
||||||
"description": "Bangladesh Immunization Profile",
|
|
||||||
=======
|
|
||||||
"id": "bd-immunization",
|
|
||||||
"url": "https://fhir.dghs.gov.bd/core/identifier/bd-immunization",
|
|
||||||
"version": "1.0.0",
|
|
||||||
"name": "BDImmunizationProfile",
|
|
||||||
"title": "Patient Immunization Profile for Bangladesh",
|
|
||||||
"description": "Patients Immunization Bangladesh Standard",
|
|
||||||
>>>>>>> 1c45affa520e64b3b9efc307d9116ff138171fa5
|
|
||||||
"fhirVersion": "4.0.1",
|
|
||||||
"kind": "resource",
|
|
||||||
"abstract": false,
|
|
||||||
"type": "Immunization",
|
|
||||||
"baseDefinition": "http://hl7.org/fhir/StructureDefinition/Immunization",
|
|
||||||
"derivation": "constraint",
|
|
||||||
"differential": {
|
|
||||||
"element": [
|
|
||||||
{
|
|
||||||
"id": "Immunization.identifier",
|
|
||||||
"path": "Immunization.identifier",
|
|
||||||
<<<<<<< HEAD
|
|
||||||
"short": "Unique identifier",
|
|
||||||
=======
|
|
||||||
"short": "Identifier",
|
|
||||||
>>>>>>> 1c45affa520e64b3b9efc307d9116ff138171fa5
|
|
||||||
"definition": "Unique identifier for the vaccination event",
|
|
||||||
"min": 1
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
}
|
|
||||||
63
input/fsh/namingSystems/ICD11MMSNamingSystem.fsh
Normal file
63
input/fsh/namingSystems/ICD11MMSNamingSystem.fsh
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
// ============================================================
|
||||||
|
// ICD11MMSNamingSystem.fsh
|
||||||
|
// NamingSystem for ICD-11 MMS in the Bangladesh national context
|
||||||
|
// Canonical authority: WHO
|
||||||
|
// National resolver: OCL at https://tr.ocl.dghs.gov.bd
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
Instance: icd11-mms-bd
|
||||||
|
InstanceOf: NamingSystem
|
||||||
|
Usage: #definition
|
||||||
|
Title: "ICD-11 MMS NamingSystem — Bangladesh"
|
||||||
|
Description: """
|
||||||
|
Declares the ICD-11 Mortality and Morbidity Statistics (MMS) coding system
|
||||||
|
as a known and supported terminology within the Bangladesh national health
|
||||||
|
information infrastructure.
|
||||||
|
|
||||||
|
Canonical system URI: http://id.who.int/icd/release/11/mms
|
||||||
|
Canonical authority: World Health Organization (WHO)
|
||||||
|
|
||||||
|
Preferred code form: short stem codes (e.g. 1A00, NC72.Z).
|
||||||
|
Linearization URIs are not used as code identifiers in this IG.
|
||||||
|
|
||||||
|
National terminology resolver (OCL):
|
||||||
|
https://tr.ocl.dghs.gov.bd
|
||||||
|
|
||||||
|
Supported OCL operations (use `system=` parameter, not `url=`):
|
||||||
|
- $validate-code: https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$validate-code
|
||||||
|
?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
- $lookup: https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$lookup
|
||||||
|
?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
|
||||||
|
$expand is not supported — known OCL limitation.
|
||||||
|
|
||||||
|
Version 2025-01 is active in the national OCL instance with 36,941
|
||||||
|
imported concepts. The OCL resolver is an internal national service;
|
||||||
|
vendors do not interact with it directly. All vendor submissions are
|
||||||
|
validated at the HIE boundary via the Bangladesh ICD-11 Cluster Validator
|
||||||
|
at https://icd11.dghs.gov.bd/cluster/validate.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* name = "ICD11MMSBangladesh"
|
||||||
|
* status = #active
|
||||||
|
* kind = #codesystem
|
||||||
|
* date = "2025-01-01"
|
||||||
|
* publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* contact.name = "DGHS Health Informatics Unit"
|
||||||
|
* contact.telecom.system = #url
|
||||||
|
* contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* responsible = "World Health Organization (WHO)"
|
||||||
|
|
||||||
|
// Primary identifier — canonical system URI (WHO authority)
|
||||||
|
* uniqueId[+].type = #uri
|
||||||
|
* uniqueId[=].value = "http://id.who.int/icd/release/11/mms"
|
||||||
|
* uniqueId[=].preferred = true
|
||||||
|
* uniqueId[=].comment = "Canonical ICD-11 MMS system URI. Canonical authority is WHO."
|
||||||
|
* uniqueId[=].period.start = "2025-01-01"
|
||||||
|
|
||||||
|
// Secondary identifier — national OCL source locator (machine-discoverable, not canonical)
|
||||||
|
* uniqueId[+].type = #uri
|
||||||
|
* uniqueId[=].value = "https://tr.ocl.dghs.gov.bd/orgs/MoHFW/sources/ICD-11-MMS/"
|
||||||
|
* uniqueId[=].preferred = false
|
||||||
|
* uniqueId[=].comment = "National terminology resolver — Bangladesh OCL instance. Not the canonical system URI."
|
||||||
65
input/fsh/profile/BDConditionProfile.fsh
Normal file
65
input/fsh/profile/BDConditionProfile.fsh
Normal file
@@ -0,0 +1,65 @@
|
|||||||
|
// ============================================================
|
||||||
|
// BDConditionProfile.fsh
|
||||||
|
// BD-Core Condition profile with mandatory ICD-11 MMS stem slice
|
||||||
|
// Binding: Diagnosis and Finding class concepts only
|
||||||
|
// Runtime enforcement via OCL ValueSet $validate-code
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
Profile: BDConditionProfile
|
||||||
|
Parent: Condition
|
||||||
|
Id: bd-condition
|
||||||
|
Title: "BD Core Condition Profile (ICD-11)"
|
||||||
|
Description: """
|
||||||
|
Condition resource coded with ICD-11 MMS, restricted to Diagnosis and
|
||||||
|
Finding class concepts. Defined in the Bangladesh Core FHIR Implementation
|
||||||
|
Guide (BD-Core-FHIR-IG) published by DGHS/MoHFW.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* code 1..1 MS
|
||||||
|
* code from bd-condition-icd11-diagnosis-valueset (preferred)
|
||||||
|
* code ^comment = """
|
||||||
|
Condition.code SHALL contain at least one coding conforming to the
|
||||||
|
coding[stem] slice with system = http://id.who.int/icd/release/11/mms.
|
||||||
|
|
||||||
|
Stem code rules:
|
||||||
|
- The stem code SHALL be a Diagnosis or Finding class ICD-11 MMS concept.
|
||||||
|
- This restriction is enforced at runtime via OCL ValueSet $validate-code
|
||||||
|
against the Bangladesh ICD-11 MMS Condition ValueSet.
|
||||||
|
- Stem-only codes SHALL be validated via OCL $validate-code.
|
||||||
|
- Substance, Organism, Device, Anatomy, and Misc class concepts SHALL NOT
|
||||||
|
appear as standalone stem codes in Condition.code.
|
||||||
|
|
||||||
|
Cluster expression rules:
|
||||||
|
- When a concept requires postcoordination, the full cluster expression
|
||||||
|
SHALL be carried in the icd11-cluster-expression extension on coding[stem].
|
||||||
|
- The icd11-cluster-expression extension SHALL only be present when the
|
||||||
|
expression contains at least one satellite code joined by & or / operators.
|
||||||
|
- Satellite codes in the cluster expression are exempt from the
|
||||||
|
Diagnosis/Finding class restriction.
|
||||||
|
- Cluster expressions SHALL be validated against the Bangladesh ICD-11
|
||||||
|
Cluster Validator at https://icd11.dghs.gov.bd/cluster/validate
|
||||||
|
prior to submission to the HIE.
|
||||||
|
|
||||||
|
Additional local codings are permitted alongside the mandatory ICD-11 stem
|
||||||
|
(slicing is open). Cluster expressions are typically sourced from the WHO
|
||||||
|
Electronic Coding Tool (ECT) at the point of care.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* code.coding ^slicing.discriminator.type = #value
|
||||||
|
* code.coding ^slicing.discriminator.path = "system"
|
||||||
|
* code.coding ^slicing.rules = #open
|
||||||
|
* code.coding ^slicing.description = "Slice requiring exactly one ICD-11 MMS stem code. Additional local codings permitted."
|
||||||
|
|
||||||
|
* code.coding contains stem 1..1
|
||||||
|
* code.coding[stem] ^short = "Mandatory ICD-11 MMS stem code"
|
||||||
|
* code.coding[stem] ^definition = """
|
||||||
|
Exactly one ICD-11 MMS stem code is required. The stem code SHALL be a
|
||||||
|
Diagnosis or Finding class concept. When the condition requires
|
||||||
|
postcoordination, the full cluster expression is carried in the
|
||||||
|
icd11-cluster-expression extension on this coding element.
|
||||||
|
"""
|
||||||
|
* code.coding[stem].system 1..1
|
||||||
|
* code.coding[stem].system = "http://id.who.int/icd/release/11/mms" (exactly)
|
||||||
|
* code.coding[stem].code 1..1
|
||||||
|
* code.coding[stem].extension contains
|
||||||
|
https://fhir.dghs.gov.bd/core/StructureDefinition/icd11-cluster-expression named clusterExpression 0..1
|
||||||
62
input/fsh/valueSets/BDConditionICD11DiagnosisVS.fsh
Normal file
62
input/fsh/valueSets/BDConditionICD11DiagnosisVS.fsh
Normal file
@@ -0,0 +1,62 @@
|
|||||||
|
// ============================================================
|
||||||
|
// BDConditionICD11DiagnosisVS.fsh
|
||||||
|
// ICD-11 MMS ValueSet restricted to Diagnosis and Finding classes
|
||||||
|
// Binding target for Condition.code in BDConditionProfile
|
||||||
|
// Empty stub — runtime enforcement via OCL $validate-code
|
||||||
|
// $expand not available — suppressed in sushi-config.yaml
|
||||||
|
// ============================================================
|
||||||
|
|
||||||
|
ValueSet: BDConditionICD11DiagnosisVS
|
||||||
|
Id: bd-condition-icd11-diagnosis-valueset
|
||||||
|
Title: "Bangladesh ICD-11 MMS Condition ValueSet (Diagnosis and Finding)"
|
||||||
|
Description: """
|
||||||
|
ICD-11 MMS concepts restricted to the Diagnosis (14,071) and Finding (5,590)
|
||||||
|
concept classes, totalling 19,661 concepts as of version 2025-01.
|
||||||
|
|
||||||
|
This ValueSet is the binding target for Condition.code in the BD-Core
|
||||||
|
Condition profile. Substance, Organism, Device, Anatomy, and Misc class
|
||||||
|
concepts are excluded and SHALL NOT appear as standalone stem codes in
|
||||||
|
Condition.code. This restriction applies to stem codes only — satellite
|
||||||
|
codes carried in the icd11-cluster-expression extension are exempt.
|
||||||
|
|
||||||
|
This ValueSet is an empty stub. No compose block is declared because
|
||||||
|
$expand is not supported by the national OCL terminology server and
|
||||||
|
no machine-executable filter for concept_class is available at the
|
||||||
|
IG layer. The compose would be nominal only and is omitted to avoid
|
||||||
|
misrepresenting machine-executable semantics.
|
||||||
|
|
||||||
|
The ValueSet is hosted in OCL as a collection with 19,661 explicit
|
||||||
|
concept references (Diagnosis and Finding classes only). Runtime
|
||||||
|
enforcement is via OCL ValueSet $validate-code:
|
||||||
|
|
||||||
|
GET https://tr.ocl.dghs.gov.bd/api/fhir/ValueSet/$validate-code
|
||||||
|
?url=https://fhir.dghs.gov.bd/core/ValueSet/bd-condition-icd11-diagnosis-valueset
|
||||||
|
&system=http://id.who.int/icd/release/11/mms
|
||||||
|
&code={code}
|
||||||
|
|
||||||
|
Confirmed behaviour:
|
||||||
|
- Diagnosis class (e.g. 1A00): accepted
|
||||||
|
- Finding class: accepted
|
||||||
|
- Device class (e.g. XD7EB1): rejected
|
||||||
|
- Substance class (e.g. XM6RB2): rejected
|
||||||
|
|
||||||
|
At the HAPI FHIR layer, enforcement is via RemoteTerminologyServiceValidationSupport
|
||||||
|
configured to call OCL. HAPI FHIR deployment is a known gap to be closed
|
||||||
|
before vendor onboarding.
|
||||||
|
|
||||||
|
VERSION UPGRADES:
|
||||||
|
Upgrading to a new ICD-11 MMS release requires re-running
|
||||||
|
populate_condition_valueset.py. Automated via version_upgrade.py.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-condition-icd11-diagnosis-valueset"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^version = "2025-01"
|
||||||
|
* ^publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.name = "DGHS Health Informatics Unit"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^copyright = "ICD-11 is copyright © World Health Organization. Used under licence."
|
||||||
|
* ^immutable = false
|
||||||
@@ -1,6 +0,0 @@
|
|||||||
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
|
|
||||||
63
input/package-list.json
Normal file
63
input/package-list.json
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"package-id": "bd.fhir.core",
|
||||||
|
"title": "Bangladesh Core FHIR Implementation Guide",
|
||||||
|
"canonical": "https://fhir.dghs.gov.bd/core",
|
||||||
|
"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 in development)",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/",
|
||||||
|
"status": "ci-build",
|
||||||
|
"current": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.5",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor bug fix release",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.5/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.4",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor visual improvements",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.4/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.3",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor documentation updates",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.3/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.2",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor bug fix release",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.2/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.1",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Second draft release of the Bangladesh Core FHIR IG",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.1/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"date": "2025-10-02",
|
||||||
|
"desc": "First draft release of the Bangladesh Core FHIR IG",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,5 +1,135 @@
|
|||||||
### A Heading
|
## Bangladesh Core FHIR Implementation Guide — General Specification
|
||||||
You can also use markdown if that's your thing
|
|
||||||
|
|
||||||
And an icon: 
|
### Purpose and Scope
|
||||||
|
|
||||||
|
This Implementation Guide (IG) defines the national FHIR R4 core profiles,
|
||||||
|
value sets, code systems, extensions, and implementation rules for digital
|
||||||
|
health systems in Bangladesh. It is published by the Directorate General of
|
||||||
|
Health Services (DGHS), Ministry of Health and Family Welfare (MoHFW).
|
||||||
|
|
||||||
|
This IG is a foundational component of the **Shareable Health Record (SHR)**
|
||||||
|
system — the national Health Information Exchange (HIE) and gateway for
|
||||||
|
producing a Personal Health Profile for every citizen of Bangladesh.
|
||||||
|
|
||||||
|
This IG is aligned with and gives technical expression to:
|
||||||
|
- **Bangladesh Digital Health Strategy 2023–2027**
|
||||||
|
- **Bangladesh Digital Health Architecture Blueprint**
|
||||||
|
|
||||||
|
The Patient profile strictly conforms to the **Citizen Core Data Structure
|
||||||
|
(CCDS)** defined by the Cabinet Division of the Government of Bangladesh.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Intended Audience
|
||||||
|
|
||||||
|
This IG is addressed to all software systems exchanging health data with
|
||||||
|
the national SHR, including but not limited to:
|
||||||
|
|
||||||
|
- Electronic Medical Record (EMR) systems
|
||||||
|
- Laboratory Information Systems (LIS)
|
||||||
|
- Picture Archiving and Communication Systems (PACS)
|
||||||
|
- Hospital Information Systems (HIS)
|
||||||
|
|
||||||
|
This includes systems operated by public sector facilities, private
|
||||||
|
hospitals and clinics, autonomous bodies, and non-governmental
|
||||||
|
organisations (NGOs) operating within Bangladesh.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### FHIR Version and Conventions
|
||||||
|
|
||||||
|
This IG is built on **FHIR R4 (4.0.1)**. All profiles, extensions, value
|
||||||
|
sets, and code systems defined here conform to the FHIR R4 specification.
|
||||||
|
|
||||||
|
Conformance language in this IG follows **RFC 2119**: SHALL, SHALL NOT,
|
||||||
|
SHOULD, SHOULD NOT, and MAY carry their standard normative meanings.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Design Principles
|
||||||
|
|
||||||
|
**1. National terminology over international defaults**
|
||||||
|
Where international code systems are used (ICD-11, LOINC, SNOMED CT),
|
||||||
|
they are bound through national infrastructure. The national OpenConceptLab
|
||||||
|
(OCL) terminology server at `https://tr.ocl.dghs.gov.bd` is the single
|
||||||
|
public-facing terminology resolution point. Vendors never interact with
|
||||||
|
upstream terminology sources directly.
|
||||||
|
|
||||||
|
**2. HIE boundary enforcement**
|
||||||
|
All vendor submissions pass through the national SHR HIE boundary. Mandatory
|
||||||
|
validation gates — including the Bangladesh ICD-11 Cluster Validator — are
|
||||||
|
applied at the HIE layer. Profile conformance is a necessary but not
|
||||||
|
sufficient condition for acceptance; HIE boundary rules apply additionally.
|
||||||
|
|
||||||
|
**3. Open slicing for extensibility**
|
||||||
|
Where slices are defined on coding elements, slicing is open (`#open`).
|
||||||
|
Mandatory slices enforce the presence of nationally required codes;
|
||||||
|
additional local or proprietary codings are permitted alongside them.
|
||||||
|
This ensures national interoperability without preventing systems from
|
||||||
|
carrying additional coded data.
|
||||||
|
|
||||||
|
**4. Citizen-centred identity**
|
||||||
|
The Patient profile conforms to the Citizen Core Data Structure (CCDS),
|
||||||
|
ensuring that patient identity in the SHR is anchored to the national
|
||||||
|
citizen identity infrastructure.
|
||||||
|
|
||||||
|
**5. Must Support obligations**
|
||||||
|
Must Support (MS) in this IG means that conformant systems SHALL be capable
|
||||||
|
of populating the element if the data is held by the system, and SHALL be
|
||||||
|
capable of processing it when received. Specific sender and receiver
|
||||||
|
obligations are \[TODO: to be defined in a future revision\].
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Profiles
|
||||||
|
|
||||||
|
The following national core profiles are defined in this IG:
|
||||||
|
|
||||||
|
| Profile | Base Resource | Purpose |
|
||||||
|
|---|---|---|
|
||||||
|
| [BD Patient](StructureDefinition-bd-patient.html) | Patient | Citizen identity conforming to CCDS |
|
||||||
|
| [BD Condition](StructureDefinition-bd-condition.html) | Condition | Clinical conditions coded with ICD-11 MMS |
|
||||||
|
| [BD Observation](StructureDefinition-bd-observation.html) | Observation | Vital signs, laboratory results, clinical findings |
|
||||||
|
| [BD Encounter](StructureDefinition-bd-encounter.html) | Encounter | Clinical visits and episodes of care |
|
||||||
|
| [BD Medication](StructureDefinition-bd-medication.html) | Medication | Medication definitions |
|
||||||
|
| [BD MedicationRequest](StructureDefinition-bd-medicationrequest.html) | MedicationRequest | Prescriptions and medication orders |
|
||||||
|
| [BD Immunization](StructureDefinition-bd-immunization.html) | Immunization | Vaccination records |
|
||||||
|
| [BD Organization](StructureDefinition-bd-organization.html) | Organization | Health facilities and organisations |
|
||||||
|
| [BD Practitioner](StructureDefinition-bd-practitioner.html) | Practitioner | Healthcare providers |
|
||||||
|
| [BD Location](StructureDefinition-bd-location.html) | Location | Physical locations and administrative geography |
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Terminology
|
||||||
|
|
||||||
|
The following external code systems are used in this IG:
|
||||||
|
|
||||||
|
| System | URI | Purpose |
|
||||||
|
|---|---|---|
|
||||||
|
| ICD-11 MMS | `http://id.who.int/icd/release/11/mms` | Condition coding |
|
||||||
|
| LOINC | `http://loinc.org` | Observation coding |
|
||||||
|
| UCUM | `http://unitsofmeasure.org` | Observation units |
|
||||||
|
| SNOMED CT | `http://snomed.info/sct` | Clinical terminology |
|
||||||
|
|
||||||
|
Runtime terminology resolution is provided by the national OCL terminology
|
||||||
|
server. See the [ICD-11 Implementation](icd11.html) page for full details
|
||||||
|
of ICD-11 integration, postcoordination conventions, and conformance
|
||||||
|
requirements.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Known Gaps and Planned Work
|
||||||
|
|
||||||
|
This IG is currently at version 0.2.5 with status `draft`. The following
|
||||||
|
are known gaps to be addressed in future revisions:
|
||||||
|
|
||||||
|
- **Must Support semantics** — sender and receiver obligations not yet
|
||||||
|
formally defined
|
||||||
|
- **Capability Statements** — no CapabilityStatement resources defined yet
|
||||||
|
- **Search Parameters** — no defined search parameter requirements yet
|
||||||
|
- **Transaction Patterns** — no defined FHIR transaction or message patterns yet
|
||||||
|
- **HAPI FHIR deployment** — `RemoteTerminologyServiceValidationSupport`
|
||||||
|
configuration for OCL not yet deployed; this is a prerequisite for
|
||||||
|
runtime ICD-11 class restriction enforcement before vendor onboarding
|
||||||
|
- **Must Support definitions per profile** — individual profile pages do
|
||||||
|
not yet carry explicit MS obligation tables
|
||||||
|
|||||||
@@ -1,2 +1,244 @@
|
|||||||
### A Heading
|
## ICD-11 Implementation
|
||||||
A child specification page with more detail
|
|
||||||
|
### Overview
|
||||||
|
|
||||||
|
The Bangladesh Core FHIR Implementation Guide uses ICD-11 Mortality and
|
||||||
|
Morbidity Statistics (MMS) as the mandatory coding system for clinical
|
||||||
|
conditions. This page documents the system URI, terminology infrastructure,
|
||||||
|
conformance requirements, and postcoordination conventions for implementers.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### System URI
|
||||||
|
|
||||||
|
All ICD-11 MMS codes SHALL use the WHO canonical system URI:
|
||||||
|
```
|
||||||
|
http://id.who.int/icd/release/11/mms
|
||||||
|
```
|
||||||
|
|
||||||
|
The preferred code form is the short stem code (e.g. `1A00`, `NC72.Z`).
|
||||||
|
Linearization URIs are not used as code identifiers in this IG.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Terminology Infrastructure
|
||||||
|
|
||||||
|
#### National OCL Terminology Server
|
||||||
|
|
||||||
|
Runtime code validation and lookup are delegated to the national
|
||||||
|
OpenConceptLab (OCL) terminology server operated by DGHS/MoHFW:
|
||||||
|
|
||||||
|
**Public FHIR R4 endpoint:** `https://tr.ocl.dghs.gov.bd`
|
||||||
|
|
||||||
|
OCL hosts ICD-11 MMS version 2025-01 with 36,941 concepts across the
|
||||||
|
following concept classes: Diagnosis, Finding, Substance, Organism,
|
||||||
|
Device, Anatomy, and Misc.
|
||||||
|
|
||||||
|
Vendors do not interact with OCL directly. All vendor submissions are
|
||||||
|
validated at the HIE boundary via the Bangladesh ICD-11 Cluster Validator
|
||||||
|
(see [Cluster Expressions](#cluster-expressions) below).
|
||||||
|
|
||||||
|
#### Supported OCL Operations
|
||||||
|
|
||||||
|
The following FHIR terminology operations are supported. The `system=`
|
||||||
|
parameter must be used — `url=` is not supported by OCL.
|
||||||
|
|
||||||
|
**CodeSystem $validate-code**
|
||||||
|
```
|
||||||
|
GET https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$validate-code
|
||||||
|
?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
```
|
||||||
|
|
||||||
|
**CodeSystem $lookup**
|
||||||
|
```
|
||||||
|
GET https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$lookup
|
||||||
|
?system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
```
|
||||||
|
|
||||||
|
**ValueSet $validate-code**
|
||||||
|
```
|
||||||
|
GET https://tr.ocl.dghs.gov.bd/api/fhir/ValueSet/$validate-code
|
||||||
|
?url=https://fhir.dghs.gov.bd/core/ValueSet/bd-condition-icd11-diagnosis-valueset
|
||||||
|
&system=http://id.who.int/icd/release/11/mms&code={code}
|
||||||
|
```
|
||||||
|
|
||||||
|
#### Unsupported OCL Operations
|
||||||
|
|
||||||
|
`$expand` is not supported — this is a known limitation of the national
|
||||||
|
OCL instance. Build-time expansion is suppressed. Implementers SHALL NOT
|
||||||
|
depend on `$expand` for ICD-11 ValueSets in this IG.
|
||||||
|
|
||||||
|
#### Local ICD-11 Docker Instance
|
||||||
|
|
||||||
|
A local WHO ICD-11 Docker instance is maintained internally by DGHS at
|
||||||
|
`https://icd11.dghs.gov.bd` running release 2025-01. This instance is
|
||||||
|
internal only and is not exposed to vendors. It serves as the import
|
||||||
|
source for OCL and as the backend for the cluster validator.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Condition.code Binding and Class Restriction
|
||||||
|
|
||||||
|
`Condition.code` is bound to the
|
||||||
|
[Bangladesh ICD-11 MMS Condition ValueSet](ValueSet-bd-condition-icd11-diagnosis-valueset.html)
|
||||||
|
at `preferred` strength. This ValueSet includes only Diagnosis (14,071)
|
||||||
|
and Finding (5,590) class concepts — 19,661 concepts total as of
|
||||||
|
version 2025-01.
|
||||||
|
|
||||||
|
`Condition.code` SHALL contain at least one coding conforming to the
|
||||||
|
`coding[stem]` slice with `system = http://id.who.int/icd/release/11/mms`.
|
||||||
|
Vendors cannot omit ICD-11 by substituting a local code.
|
||||||
|
|
||||||
|
The following concept classes SHALL NOT appear as standalone stem codes
|
||||||
|
in `Condition.code`: Substance, Organism, Device, Anatomy, Misc.
|
||||||
|
|
||||||
|
This restriction exists because these classes represent entities that
|
||||||
|
are not themselves diagnoses or clinical findings — they are axes used
|
||||||
|
in postcoordination (e.g. a causative substance, an affected anatomy
|
||||||
|
site). Their correct use is as satellite codes within a cluster
|
||||||
|
expression, not as standalone condition codes.
|
||||||
|
|
||||||
|
Class restriction is enforced at runtime via OCL ValueSet `$validate-code`
|
||||||
|
against the Bangladesh ICD-11 MMS Condition ValueSet. At the HAPI FHIR
|
||||||
|
layer, enforcement is via `RemoteTerminologyServiceValidationSupport`
|
||||||
|
configured to call OCL. HAPI FHIR deployment will be completed before
|
||||||
|
vendor onboarding.
|
||||||
|
|
||||||
|
The `coding[stem]` slice is open (`#open`) — additional local codings
|
||||||
|
are permitted alongside the mandatory ICD-11 stem.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Cluster Expressions
|
||||||
|
|
||||||
|
#### Background
|
||||||
|
|
||||||
|
ICD-11 supports postcoordination — the combination of a stem code with
|
||||||
|
one or more satellite codes to precisely represent a clinical concept
|
||||||
|
that cannot be expressed by a stem code alone. A postcoordinated
|
||||||
|
expression is called a cluster expression.
|
||||||
|
|
||||||
|
Cluster expressions are typically sourced from the WHO Electronic Coding
|
||||||
|
Tool (ECT) at the point of care.
|
||||||
|
|
||||||
|
#### Syntax
|
||||||
|
|
||||||
|
A cluster expression combines a stem code with satellite codes using
|
||||||
|
the `&` operator (combination) or `/` operator (specificity):
|
||||||
|
```
|
||||||
|
NC72.Z&XK8G&XJ7ZH&XJ7YM
|
||||||
|
```
|
||||||
|
|
||||||
|
Where:
|
||||||
|
- `NC72.Z` — stem code: Fracture of femur, unspecified
|
||||||
|
- `XK8G` — satellite: laterality
|
||||||
|
- `XJ7ZH` — satellite: fracture subtype
|
||||||
|
- `XJ7YM` — satellite: fracture open or closed
|
||||||
|
|
||||||
|
#### FHIR Representation
|
||||||
|
|
||||||
|
The stem code is carried in `Coding.code`. The full cluster expression
|
||||||
|
is carried in the
|
||||||
|
[ICD-11 Cluster Expression extension](StructureDefinition-icd11-cluster-expression.html)
|
||||||
|
on the same `Coding` element:
|
||||||
|
```json
|
||||||
|
"code": {
|
||||||
|
"coding": [
|
||||||
|
{
|
||||||
|
"system": "http://id.who.int/icd/release/11/mms",
|
||||||
|
"code": "NC72.Z",
|
||||||
|
"display": "Fracture of femur, unspecified",
|
||||||
|
"extension": [
|
||||||
|
{
|
||||||
|
"url": "https://fhir.dghs.gov.bd/core/StructureDefinition/icd11-cluster-expression",
|
||||||
|
"valueString": "NC72.Z&XK8G&XJ7ZH&XJ7YM"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"text": "Fracture of femur, unspecified — left, transverse, closed"
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The stem code in `Coding.code` SHALL match the leading stem code in the
|
||||||
|
cluster expression string.
|
||||||
|
|
||||||
|
#### Stem-Only vs Cluster
|
||||||
|
|
||||||
|
| Scenario | Representation | Validation |
|
||||||
|
|---|---|---|
|
||||||
|
| Single stem code | `Coding.code` only | OCL `$validate-code` |
|
||||||
|
| Postcoordinated expression | `Coding.code` + cluster extension | Cluster Validator |
|
||||||
|
|
||||||
|
The cluster validator explicitly rejects stem-only expressions. Single
|
||||||
|
stem codes SHALL be represented in `Coding.code` only and validated via
|
||||||
|
OCL `$validate-code`.
|
||||||
|
|
||||||
|
#### Satellite Code Class Restriction Exemption
|
||||||
|
|
||||||
|
Satellite codes in a cluster expression are exempt from the
|
||||||
|
Diagnosis/Finding class restriction that applies to stem codes in
|
||||||
|
`Condition.code`. Substance, Anatomy, Organism, and other axis codes
|
||||||
|
are valid and expected as satellites.
|
||||||
|
|
||||||
|
#### Bangladesh ICD-11 Cluster Validator
|
||||||
|
|
||||||
|
All postcoordinated cluster expressions SHALL be validated against the
|
||||||
|
Bangladesh ICD-11 Cluster Validator prior to submission to the HIE:
|
||||||
|
```
|
||||||
|
POST https://icd11.dghs.gov.bd/cluster/validate
|
||||||
|
Content-Type: application/json
|
||||||
|
|
||||||
|
{"expression": "NC72.Z&XK8G&XJ7ZH&XJ7YM"}
|
||||||
|
```
|
||||||
|
|
||||||
|
Example response:
|
||||||
|
```json
|
||||||
|
{
|
||||||
|
"valid": true,
|
||||||
|
"stem": {
|
||||||
|
"code": "NC72.Z",
|
||||||
|
"display": "Fracture of femur, unspecified",
|
||||||
|
"ocl_validated": true
|
||||||
|
},
|
||||||
|
"satellites": [
|
||||||
|
{"code": "XK8G", "axis": "laterality", "valid": true},
|
||||||
|
{"code": "XJ7ZH", "axis": "fractureSubtype", "valid": true},
|
||||||
|
{"code": "XJ7YM", "axis": "fractureOpenOrClosed", "valid": true}
|
||||||
|
],
|
||||||
|
"errors": []
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
The cluster validator is a mandatory HIE boundary gate. All vendor
|
||||||
|
submissions containing postcoordinated ICD-11 expressions pass through it.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
### Conformance Statements
|
||||||
|
|
||||||
|
**ICD-11-CONF-01:** ICD-11 MMS codes SHALL use system URI
|
||||||
|
`http://id.who.int/icd/release/11/mms`. Stem code validation is available
|
||||||
|
via OCL at:
|
||||||
|
`https://tr.ocl.dghs.gov.bd/api/fhir/CodeSystem/$validate-code?system=http://id.who.int/icd/release/11/mms&code={code}`
|
||||||
|
|
||||||
|
**ICD-11-CONF-02:** The `icd11-cluster-expression` extension SHALL only
|
||||||
|
be present when the expression contains at least one postcoordination
|
||||||
|
satellite code using `&` or `/` operators. Single stem codes SHALL be
|
||||||
|
represented in `Coding.code` only and validated via OCL `$validate-code`.
|
||||||
|
|
||||||
|
**ICD-11-CONF-03:** Postcoordinated cluster expressions SHALL be validated
|
||||||
|
against the Bangladesh ICD-11 Cluster Validator at
|
||||||
|
`https://icd11.dghs.gov.bd/cluster/validate` prior to submission to the HIE.
|
||||||
|
|
||||||
|
**ICD-11-CONF-04:** `Condition.code` SHALL contain at least one coding
|
||||||
|
conforming to the `coding[stem]` slice with
|
||||||
|
`system = http://id.who.int/icd/release/11/mms`. The stem code SHALL be
|
||||||
|
a member of the Bangladesh ICD-11 MMS Condition ValueSet, which includes
|
||||||
|
only Diagnosis and Finding class concepts. This restriction is enforced
|
||||||
|
at runtime via OCL ValueSet `$validate-code`.
|
||||||
|
|
||||||
|
**ICD-11-CONF-05:** Substance, Organism, Device, Anatomy, and Misc class
|
||||||
|
ICD-11 concepts SHALL NOT appear as standalone stem codes in
|
||||||
|
`Condition.code`. This restriction does not apply to satellite codes
|
||||||
|
carried in the `icd11-cluster-expression` extension.
|
||||||
14
input/publication-request.json
Normal file
14
input/publication-request.json
Normal 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"
|
||||||
|
}
|
||||||
@@ -1,30 +0,0 @@
|
|||||||
<rss xmlns:atom="http://www.w3.org/2005/Atom"
|
|
||||||
xmlns:content="http://purl.org/rss/1.0/modules/content/"
|
|
||||||
xmlns:dc="http://purl.org/dc/elements/1.1/"
|
|
||||||
xmlns:fhir="http://hl7.org/fhir/feed" version="2.0">
|
|
||||||
<channel>
|
|
||||||
<title>Bangladesh Core FHIR Packages</title>
|
|
||||||
<description>New Packages published by DGHS Bangladesh</description>
|
|
||||||
<link>https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG</link>
|
|
||||||
<generator>DGHS Bangladesh FHIR Publication tooling</generator>
|
|
||||||
<lastBuildDate>Thu, 02 Oct 2025 12:00:00 +0000</lastBuildDate>
|
|
||||||
<atom:link href="https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG/src/branch/main/package-feed.xml"
|
|
||||||
rel="self" type="application/rss+xml"/>
|
|
||||||
<pubDate>Thu, 02 Oct 2025 12:00:00 +0000</pubDate>
|
|
||||||
<language>en</language>
|
|
||||||
<ttl>600</ttl>
|
|
||||||
|
|
||||||
<item>
|
|
||||||
<title>bd.fhir.core#0.2.0</title>
|
|
||||||
<description>The first draft release of the Bangladesh Core FHIR Implementation Guide.</description>
|
|
||||||
<link>https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG/releases/download/v0.2.0/bd.fhir.core-0.2.0.tgz</link>
|
|
||||||
<guid isPermaLink="true">https://git.dghs.gov.bd/gitadmin/BD-Core-FHIR-IG/releases/download/v0.2.0/bd.fhir.core-0.2.0.tgz</guid>
|
|
||||||
<dc:creator>DGHS Bangladesh</dc:creator>
|
|
||||||
<fhir:version>4.0.1</fhir:version>
|
|
||||||
<fhir:kind>IG</fhir:kind>
|
|
||||||
<pubDate>Thu, 02 Oct 2025 12:00:00 +0000</pubDate>
|
|
||||||
<fhir:details>Publication run at 02/10/2025 by DGHS Bangladesh using IG Publisher. Source: BD-Core-FHIR-IG repo</fhir:details>
|
|
||||||
</item>
|
|
||||||
|
|
||||||
</channel>
|
|
||||||
</rss>
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
{
|
|
||||||
"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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
63
package-list.json
Normal file
63
package-list.json
Normal file
@@ -0,0 +1,63 @@
|
|||||||
|
{
|
||||||
|
"package-id": "bd.fhir.core",
|
||||||
|
"title": "Bangladesh Core FHIR Implementation Guide",
|
||||||
|
"canonical": "https://fhir.dghs.gov.bd/core",
|
||||||
|
"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 in development)",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/",
|
||||||
|
"status": "ci-build",
|
||||||
|
"current": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.5",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor bug fix release",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.5/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.4",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor visual improvements",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.4/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.3",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor documentation updates",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.3/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.2",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Minor bug fix release",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.2/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.1",
|
||||||
|
"date": "2025-10-06",
|
||||||
|
"desc": "Second draft release of the Bangladesh Core FHIR IG",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.1/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.2.0",
|
||||||
|
"date": "2025-10-02",
|
||||||
|
"desc": "First draft release of the Bangladesh Core FHIR IG",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.2.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
@@ -1,12 +0,0 @@
|
|||||||
{
|
|
||||||
"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
|
|
||||||
}
|
|
||||||
@@ -6,7 +6,7 @@ description: >
|
|||||||
This Implementation Guide defines the Bangladesh Core FHIR profiles,
|
This Implementation Guide defines the Bangladesh Core FHIR profiles,
|
||||||
value sets, code systems, and implementation rules for national digital health systems.
|
value sets, code systems, and implementation rules for national digital health systems.
|
||||||
status: draft
|
status: draft
|
||||||
version: 0.2.0
|
version: 0.3.0
|
||||||
fhirVersion: 4.0.1
|
fhirVersion: 4.0.1
|
||||||
copyrightYear: 2025+
|
copyrightYear: 2025+
|
||||||
releaseLabel: CI Build
|
releaseLabel: CI Build
|
||||||
|
|||||||
Reference in New Issue
Block a user