Compare commits
106 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f86f4a7f2c | |||
| 03d49f4eb6 | |||
| ad91d12875 | |||
| 3363403c8e | |||
| 311a853c31 | |||
| f8a13f1b19 | |||
| db8c1e2119 | |||
| 8147d76ebd | |||
| 39fe848fd4 | |||
| 593e8cbb11 | |||
| 55aa2340ad | |||
| 01c8e2b506 | |||
| 1c1b08c8a1 | |||
| adc2594bfb | |||
| 5bd6b13f7b | |||
| 6a9ca5639e | |||
| 3fc1acafe4 | |||
| 7761cd2b32 | |||
| df22875684 | |||
| 7d4ade03d8 | |||
| 3e91ff7e59 | |||
| 6e4cceae2e | |||
| 68a428f084 | |||
| 3f62ec237b | |||
| d88695dd8b | |||
| 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 |
@@ -2,9 +2,8 @@ name: FHIR IG CI/CD Pipeline with Version Persistence
|
|||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches: [ main, develop ]
|
|
||||||
tags:
|
tags:
|
||||||
- 'v*.*.*' # Trigger on version tags like v0.3.0
|
- 'v*.*.*'
|
||||||
pull_request:
|
pull_request:
|
||||||
branches: [ main ]
|
branches: [ main ]
|
||||||
|
|
||||||
@@ -14,394 +13,648 @@ env:
|
|||||||
|
|
||||||
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
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Extract version from IG
|
- name: Extract version from IG
|
||||||
id: version
|
id: version
|
||||||
run: |
|
run: |
|
||||||
# Extract version from ImplementationGuide resource
|
VERSION=$(grep -oP '<version value="\K[^"]+' input/bd.fhir.core.xml | head -1)
|
||||||
VERSION=$(grep -oP '<version value="\K[^"]+' input/bd.fhir.core.xml | head -1)
|
|
||||||
|
|
||||||
if [ -z "$VERSION" ]; then
|
if [ -z "$VERSION" ]; then
|
||||||
echo "ERROR: Could not extract version from ImplementationGuide XML"
|
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
|
exit 1
|
||||||
fi
|
fi
|
||||||
else
|
|
||||||
BUILD_TYPE="dev"
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "build_type=$BUILD_TYPE" >> $GITHUB_OUTPUT
|
echo "Extracted version: $VERSION"
|
||||||
echo "Build type: $BUILD_TYPE"
|
echo "version=$VERSION" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
# NEW STEP: Update package-list.json BEFORE build so IG Publisher can use it
|
if [[ "$GITHUB_REF" == refs/tags/v* ]]; then
|
||||||
- name: Pre-build package-list.json update
|
BUILD_TYPE="release"
|
||||||
run: |
|
TAG_VERSION="${GITHUB_REF#refs/tags/v}"
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
|
||||||
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
|
|
||||||
DATE=$(date +%Y-%m-%d)
|
|
||||||
|
|
||||||
# Only update for release builds
|
if [ "$TAG_VERSION" != "$VERSION" ]; then
|
||||||
if [ "$BUILD_TYPE" != "release" ]; then
|
echo "ERROR: Git tag version ($TAG_VERSION) doesn't match IG version ($VERSION)"
|
||||||
echo "ℹ️ Dev build - skipping package-list.json pre-build update"
|
exit 1
|
||||||
exit 0
|
fi
|
||||||
fi
|
else
|
||||||
|
BUILD_TYPE="dev"
|
||||||
|
fi
|
||||||
|
|
||||||
echo "📋 Updating package-list.json before build..."
|
echo "build_type=$BUILD_TYPE" >> $GITHUB_OUTPUT
|
||||||
|
echo "Build type: $BUILD_TYPE"
|
||||||
|
|
||||||
# Check if package-list.json exists
|
- name: Prepare package-list.json and history.xml for IG Publisher
|
||||||
if [ ! -f "package-list.json" ]; then
|
run: |
|
||||||
echo "⚠️ package-list.json not found in repo - history.html won't be generated"
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
echo "Creating minimal package-list.json for this build..."
|
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
|
||||||
cat > package-list.json << EOF
|
DATE=$(date +%Y-%m-%d)
|
||||||
{
|
|
||||||
"package-id": "bd.fhir.core",
|
export VERSION DATE BUILD_TYPE
|
||||||
"title": "Bangladesh Core FHIR Implementation Guide",
|
|
||||||
"canonical": "https://fhir.dghs.gov.bd/core",
|
echo "📋 Preparing package-list.json and history.xml for IG Publisher..."
|
||||||
"introduction": "Core FHIR profiles and extensions for Bangladesh healthcare",
|
|
||||||
"list": [
|
if [ ! -f "package-list.json" ]; then
|
||||||
{
|
echo "⚠️ package-list.json not found in repo root"
|
||||||
"version": "current",
|
echo "Creating initial package-list.json..."
|
||||||
"desc": "Continuous Integration Build (latest in version control)",
|
cat > package-list.json << 'PKGEOF'
|
||||||
"path": "https://fhir.dghs.gov.bd/core/",
|
{
|
||||||
"status": "ci-build",
|
"package-id": "bd.fhir.core",
|
||||||
"current": true
|
"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"
|
||||||
]
|
]
|
||||||
}
|
|
||||||
EOF
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Update package-list.json with new version
|
# Sort newest version first
|
||||||
python3 << 'PYEOF'
|
published.sort(
|
||||||
import json
|
key=lambda e: version_key(e.get("version", "0.0.0")),
|
||||||
import sys
|
reverse=True
|
||||||
|
)
|
||||||
|
|
||||||
version = "$VERSION"
|
published_found = False
|
||||||
date = "$DATE"
|
first_row = True
|
||||||
|
|
||||||
with open('package-list.json', 'r') as f:
|
for entry in published:
|
||||||
pkg_list = json.load(f)
|
published_found = True
|
||||||
|
|
||||||
# Check if this version already exists
|
version = escape(entry.get('version', 'Unknown'))
|
||||||
version_exists = any(e['version'] == version for e in pkg_list['list'])
|
date = escape(entry.get('date', 'N/A'))
|
||||||
|
desc = escape(entry.get('desc', ''))
|
||||||
|
path = escape(entry.get('path', '#'))
|
||||||
|
|
||||||
if not version_exists:
|
status_val = entry.get('status', 'unknown')
|
||||||
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:
|
if status_val == "trial-use":
|
||||||
json.dump(pkg_list, f, indent=2)
|
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>'
|
||||||
|
|
||||||
print(f"✅ Added version {version} to package-list.json")
|
badge = '<span class="badge bg-success">Latest</span> ' if first_row else ''
|
||||||
else:
|
|
||||||
print(f"ℹ️ Version {version} already exists in package-list.json")
|
|
||||||
PYEOF
|
|
||||||
|
|
||||||
echo "📋 package-list.json is ready for IG Publisher"
|
xml += f'''
|
||||||
cat package-list.json
|
<tr>
|
||||||
|
<td><a href="{path}">{badge}{version}</a></td>
|
||||||
|
<td>{date}</td>
|
||||||
|
<td>{status}</td>
|
||||||
|
<td>{desc}</td>
|
||||||
|
</tr>
|
||||||
|
'''
|
||||||
|
|
||||||
- name: Install Docker CLI
|
first_row = False
|
||||||
run: |
|
|
||||||
apt-get update
|
|
||||||
apt-get install -y docker.io
|
|
||||||
docker --version
|
|
||||||
|
|
||||||
- name: Build FHIR IG
|
if not published_found:
|
||||||
run: |
|
xml += '''
|
||||||
echo "Building FHIR IG version ${{ steps.version.outputs.version }}..."
|
<tr>
|
||||||
|
<td colspan="4">No published versions available yet.</td>
|
||||||
|
</tr>
|
||||||
|
'''
|
||||||
|
|
||||||
CONTAINER_ID=$(docker create \
|
xml += '''
|
||||||
hl7fhir/ig-publisher-base:latest \
|
</tbody>
|
||||||
/bin/bash -c "cp -r /home/publisher/ig /tmp/build && cd /tmp/build && _updatePublisher.sh -y && _genonce.sh")
|
</table>
|
||||||
|
|
||||||
echo "Container ID: $CONTAINER_ID"
|
<p class="lead"><b>Continuous Integration Build</b></p>
|
||||||
|
'''
|
||||||
|
|
||||||
docker cp $(pwd)/. $CONTAINER_ID:/home/publisher/ig/
|
current_entry = None
|
||||||
docker start -a $CONTAINER_ID
|
for entry in pkg_list['list']:
|
||||||
EXIT_CODE=$?
|
if entry.get('version') == 'current':
|
||||||
|
current_entry = entry
|
||||||
|
break
|
||||||
|
|
||||||
# Copy outputs
|
if current_entry:
|
||||||
echo "Copying outputs from container..."
|
path = escape(current_entry.get('path', pkg_list.get('canonical', '') + '/'))
|
||||||
docker cp $CONTAINER_ID:/tmp/build/output ./output || echo "Warning: No output directory"
|
xml += f'''
|
||||||
docker cp $CONTAINER_ID:/tmp/build/fsh-generated ./fsh-generated || echo "No FSH generated"
|
<p>The latest development build is available at:
|
||||||
docker cp $CONTAINER_ID:/tmp/build/input-cache ./input-cache || echo "No input-cache"
|
<a href="{path}">{path}</a></p>
|
||||||
docker cp $CONTAINER_ID:/tmp/build/temp ./temp || echo "No temp directory"
|
'''
|
||||||
|
else:
|
||||||
|
xml += '''
|
||||||
|
<p><i>No CI build entry found in package-list.json.</i></p>
|
||||||
|
'''
|
||||||
|
|
||||||
if [ $EXIT_CODE -ne 0 ]; then
|
xml += '''
|
||||||
echo "Build failed, showing logs:"
|
</div>
|
||||||
docker logs $CONTAINER_ID
|
'''
|
||||||
docker rm $CONTAINER_ID
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
docker rm $CONTAINER_ID
|
with open('input/pagecontent/history.xml', 'w', encoding='utf-8') as f:
|
||||||
|
f.write(xml)
|
||||||
|
|
||||||
if [ ! -f "output/index.html" ]; then
|
print("✅ Generated static history.xml")
|
||||||
echo "ERROR: Build failed - no index.html"
|
print(f" File location: {os.path.abspath('input/pagecontent/history.xml')}")
|
||||||
exit 1
|
print(f" File size: {os.path.getsize('input/pagecontent/history.xml')} bytes")
|
||||||
fi
|
PYEOF
|
||||||
|
|
||||||
# Check if history.html was generated
|
if [ -f "input/pagecontent/history.xml" ]; then
|
||||||
if [ -f "output/history.html" ]; then
|
echo "✅ Verified: history.xml exists"
|
||||||
echo "✅ history.html generated successfully"
|
echo " First 20 lines:"
|
||||||
else
|
head -20 input/pagecontent/history.xml
|
||||||
echo "⚠️ WARNING: history.html was not generated"
|
else
|
||||||
echo "This usually means package-list.json was missing or invalid"
|
echo "❌ ERROR: history.xml was not created!"
|
||||||
fi
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
echo "✅ Build successful!"
|
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: Update package-feed.xml for releases
|
- name: Emergency Disk Cleanup
|
||||||
if: steps.version.outputs.build_type == 'release'
|
run: |
|
||||||
run: |
|
echo "Disk usage before:"
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
df -h
|
||||||
DATETIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
|
||||||
|
|
||||||
cat > update-feed.py << 'EOF'
|
echo "Clearing tool cache..."
|
||||||
import sys
|
rm -rf /opt/hostedtoolcache/* || true
|
||||||
import xml.etree.ElementTree as ET
|
|
||||||
|
|
||||||
version = sys.argv[1]
|
rm -rf /usr/share/dotnet || true
|
||||||
datetime_iso = sys.argv[2]
|
rm -rf /usr/local/lib/android || true
|
||||||
|
rm -rf /opt/ghc || true
|
||||||
|
rm -rf ~/.fhir/packages || true
|
||||||
|
|
||||||
ET.register_namespace('', 'http://www.w3.org/2005/Atom')
|
echo "Disk usage after:"
|
||||||
|
df -h
|
||||||
|
|
||||||
tree = ET.parse('package-feed.xml')
|
- name: Install Docker CLI
|
||||||
root = tree.getroot()
|
run: |
|
||||||
ns = {'atom': 'http://www.w3.org/2005/Atom'}
|
apt-get update
|
||||||
|
apt-get install -y docker.io
|
||||||
|
docker --version
|
||||||
|
|
||||||
updated_elem = root.find('atom:updated', ns)
|
- name: Preload previous IG package for comparison
|
||||||
if updated_elem is not None:
|
run: |
|
||||||
updated_elem.text = datetime_iso
|
echo "Detecting previous version..."
|
||||||
|
export VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
PREV_VERSION=$(python3 <<'PY'
|
||||||
|
import json
|
||||||
|
import os
|
||||||
|
|
||||||
entry_exists = False
|
current_build = os.environ.get("VERSION")
|
||||||
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:
|
with open("package-list.json") as f:
|
||||||
new_entry = ET.Element('{http://www.w3.org/2005/Atom}entry')
|
data = json.load(f)
|
||||||
|
|
||||||
title = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}title')
|
def parse(v):
|
||||||
title.text = f"bd.fhir.core version {version}"
|
try:
|
||||||
|
return tuple(int(x) for x in v.split("."))
|
||||||
|
except:
|
||||||
|
return (0,)
|
||||||
|
|
||||||
link = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}link')
|
versions = [
|
||||||
link.set('rel', 'alternate')
|
v["version"]
|
||||||
link.set('href', f"https://fhir.dghs.gov.bd/core/{version}/")
|
for v in data["list"]
|
||||||
|
if v.get("version") not in ("current", current_build)
|
||||||
|
]
|
||||||
|
|
||||||
entry_id = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}id')
|
versions.sort(key=parse, reverse=True)
|
||||||
entry_id.text = f"https://fhir.dghs.gov.bd/core/{version}/"
|
|
||||||
|
|
||||||
entry_updated = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}updated')
|
print(versions[0] if versions else "")
|
||||||
entry_updated.text = datetime_iso
|
PY
|
||||||
|
)
|
||||||
|
|
||||||
summary = ET.SubElement(new_entry, '{http://www.w3.org/2005/Atom}summary')
|
if [ -z "$PREV_VERSION" ]; then
|
||||||
summary.text = f"Release {version} of Bangladesh Core FHIR Implementation Guide"
|
echo "No previous version found. Skipping preload."
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
insert_pos = 0
|
echo "Previous version detected: $PREV_VERSION"
|
||||||
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)
|
mkdir -p previous-packages
|
||||||
|
TMPDIR=$(mktemp -d)
|
||||||
|
|
||||||
tree.write('output/package-feed.xml', encoding='utf-8', xml_declaration=True)
|
URL="https://fhir.dghs.gov.bd/core/$PREV_VERSION/package.tgz"
|
||||||
print(f"✅ Updated package-feed.xml")
|
|
||||||
EOF
|
|
||||||
|
|
||||||
python3 update-feed.py "$VERSION" "$DATETIME"
|
echo "Downloading $URL"
|
||||||
|
curl -fL "$URL" -o "$TMPDIR/package.tgz"
|
||||||
|
|
||||||
# Also copy the updated package-list.json to output
|
mkdir -p "previous-packages/bd.fhir.core#$PREV_VERSION"
|
||||||
cp package-list.json output/package-list.json
|
tar -xzf "$TMPDIR/package.tgz" -C "previous-packages/bd.fhir.core#$PREV_VERSION"
|
||||||
|
|
||||||
echo "📋 Updated registry files"
|
echo "Previous package cached:"
|
||||||
|
ls previous-packages
|
||||||
|
|
||||||
- name: Prepare deployment artifact
|
- name: Build FHIR IG
|
||||||
run: |
|
run: |
|
||||||
VERSION="${{ steps.version.outputs.version }}"
|
echo "Building FHIR IG version ${{ steps.version.outputs.version }}..."
|
||||||
BUILD_TYPE="${{ steps.version.outputs.build_type }}"
|
|
||||||
|
|
||||||
tar -czf ig-output.tar.gz -C output .
|
CONTAINER_ID=$(docker create \
|
||||||
|
-v $(pwd)/previous-packages:/previous-packages \
|
||||||
|
hl7fhir/ig-publisher-base:latest \
|
||||||
|
/bin/bash -c "
|
||||||
|
|
||||||
echo "version=$VERSION" > deployment.env
|
mkdir -p /tmp/build
|
||||||
echo "build_type=$BUILD_TYPE" >> deployment.env
|
cp -r /home/publisher/ig /tmp/build/ig
|
||||||
echo "build_date=$(date -u +%Y-%m-%dT%H:%M:%SZ)" >> deployment.env
|
|
||||||
|
|
||||||
# List what's in the output
|
cd /tmp/build/ig
|
||||||
echo "📦 Output contents:"
|
mkdir -p input-cache
|
||||||
ls -lh output/ | grep -E "(history\.html|package-list\.json|package-feed\.xml|index\.html)"
|
curl -L -o input-cache/publisher.jar https://supervision.dghs.gov.bd/publisher.jar
|
||||||
|
ls -lh input-cache
|
||||||
|
rm -f package-list.json
|
||||||
|
|
||||||
ls -lh ig-output.tar.gz
|
_genonce.sh
|
||||||
|
")
|
||||||
|
|
||||||
- name: Upload artifact
|
echo "Container ID: $CONTAINER_ID"
|
||||||
uses: actions/upload-artifact@v3
|
|
||||||
with:
|
docker cp "$(pwd)/." "$CONTAINER_ID:/home/publisher/ig/"
|
||||||
name: ig-output
|
echo "Mounted FHIR packages:"
|
||||||
path: |
|
ls -R previous-packages || echo "No previous packages directory"
|
||||||
ig-output.tar.gz
|
docker start -a "$CONTAINER_ID"
|
||||||
deployment.env
|
EXIT_CODE=$?
|
||||||
package-list.json
|
|
||||||
package-feed.xml
|
echo "Copying outputs from container..."
|
||||||
retention-days: 30
|
docker cp "$CONTAINER_ID:/tmp/build/ig/output" ./output || echo "Warning: No output directory"
|
||||||
|
docker cp "$CONTAINER_ID:/tmp/build/ig/fsh-generated" ./fsh-generated || echo "No FSH generated"
|
||||||
|
docker cp "$CONTAINER_ID:/tmp/build/ig/input-cache" ./input-cache || echo "No input-cache"
|
||||||
|
docker cp "$CONTAINER_ID:/tmp/build/ig/temp" ./temp || echo "No temp directory"
|
||||||
|
|
||||||
|
if [ $EXIT_CODE -ne 0 ]; then
|
||||||
|
echo "Build failed, showing logs:"
|
||||||
|
docker logs "$CONTAINER_ID"
|
||||||
|
docker rm "$CONTAINER_ID"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker rm "$CONTAINER_ID"
|
||||||
|
|
||||||
|
if [ ! -f "output/index.html" ]; then
|
||||||
|
echo "ERROR: Build failed - no index.html"
|
||||||
|
exit 1
|
||||||
|
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!"
|
||||||
|
|
||||||
|
- name: Update package-feed.xml for releases
|
||||||
|
if: steps.version.outputs.build_type == 'release'
|
||||||
|
run: |
|
||||||
|
VERSION="${{ steps.version.outputs.version }}"
|
||||||
|
DATETIME=$(date -u +%Y-%m-%dT%H:%M:%SZ)
|
||||||
|
|
||||||
|
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
|
||||||
|
|
||||||
|
cat > update-feed.py << 'EOF'
|
||||||
|
import sys
|
||||||
|
import xml.etree.ElementTree as ET
|
||||||
|
|
||||||
|
version = sys.argv[1]
|
||||||
|
datetime_iso = sys.argv[2]
|
||||||
|
|
||||||
|
ET.register_namespace('', 'http://www.w3.org/2005/Atom')
|
||||||
|
|
||||||
|
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:
|
||||||
|
name: ig-output
|
||||||
|
path: |
|
||||||
|
ig-output.tar.gz
|
||||||
|
deployment.env
|
||||||
|
package-list.json
|
||||||
|
package-feed.xml
|
||||||
|
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' || startsWith(github.ref, 'refs/tags/v'))
|
if: github.ref == 'refs/heads/main' || startsWith(github.ref, 'refs/tags/v')
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Download artifact
|
- name: Download artifact
|
||||||
uses: actions/download-artifact@v3
|
uses: actions/download-artifact@v3
|
||||||
with:
|
with:
|
||||||
name: ig-output
|
name: ig-output
|
||||||
|
|
||||||
- name: Load deployment env
|
- name: Load deployment env
|
||||||
id: deploy_info
|
id: deploy_info
|
||||||
run: |
|
run: |
|
||||||
source deployment.env
|
source deployment.env
|
||||||
echo "version=$version" >> $GITHUB_OUTPUT
|
echo "version=$version" >> $GITHUB_OUTPUT
|
||||||
echo "build_type=$build_type" >> $GITHUB_OUTPUT
|
echo "build_type=$build_type" >> $GITHUB_OUTPUT
|
||||||
echo "build_date=$build_date" >> $GITHUB_OUTPUT
|
echo "build_date=$build_date" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
echo "Deploying version: $version"
|
echo "Deploying version: $version"
|
||||||
echo "Build type: $build_type"
|
echo "Build type: $build_type"
|
||||||
|
|
||||||
- name: Deploy to server
|
- name: Deploy to server
|
||||||
uses: appleboy/scp-action@v0.1.7
|
uses: appleboy/scp-action@v0.1.7
|
||||||
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 }}
|
||||||
source: "ig-output.tar.gz,deployment.env,package-list.json,package-feed.xml"
|
source: "ig-output.tar.gz,deployment.env,package-list.json,package-feed.xml"
|
||||||
target: "/tmp/fhir-ig-deploy/"
|
target: "/tmp/fhir-ig-deploy/"
|
||||||
|
|
||||||
- name: Execute deployment on server
|
- name: Execute deployment on server
|
||||||
uses: appleboy/ssh-action@v1.0.3
|
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 }}
|
||||||
script: |
|
script: |
|
||||||
set -e
|
set -e
|
||||||
|
|
||||||
# Load deployment info
|
source /tmp/fhir-ig-deploy/deployment.env
|
||||||
source /tmp/fhir-ig-deploy/deployment.env
|
|
||||||
|
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
echo "Deploying FHIR IG"
|
echo "Deploying FHIR IG"
|
||||||
echo "Version: $version"
|
echo "Version: $version"
|
||||||
echo "Build Type: $build_type"
|
echo "Build Type: $build_type"
|
||||||
echo "Build Date: $build_date"
|
echo "Build Date: $build_date"
|
||||||
echo "=========================================="
|
echo "=========================================="
|
||||||
|
|
||||||
# Create version directory structure
|
VERSIONS_DIR="/opt/fhir-ig/versions"
|
||||||
VERSIONS_DIR="/opt/fhir-ig/versions"
|
mkdir -p "$VERSIONS_DIR"
|
||||||
mkdir -p "$VERSIONS_DIR"
|
|
||||||
|
|
||||||
# Determine target directory
|
if [ "$build_type" = "release" ]; then
|
||||||
if [ "$build_type" == "release" ]; then
|
TARGET_DIR="$VERSIONS_DIR/$version"
|
||||||
TARGET_DIR="$VERSIONS_DIR/$version"
|
echo "📦 Deploying release version to: $TARGET_DIR"
|
||||||
echo "📦 Deploying release version to: $TARGET_DIR"
|
else
|
||||||
else
|
TARGET_DIR="$VERSIONS_DIR/dev"
|
||||||
TARGET_DIR="$VERSIONS_DIR/dev"
|
echo "🔧 Deploying dev build to: $TARGET_DIR"
|
||||||
echo "🔧 Deploying dev build to: $TARGET_DIR"
|
mkdir -p "$TARGET_DIR"
|
||||||
|
echo "Cleaning old dev files..."
|
||||||
|
rm -rf "$TARGET_DIR"/*
|
||||||
|
fi
|
||||||
|
|
||||||
echo "Cleaning old dev files..."
|
mkdir -p "$TARGET_DIR"
|
||||||
rm -rf "$TARGET_DIR"/*
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Create target directory
|
echo "Extracting IG output..."
|
||||||
mkdir -p "$TARGET_DIR"
|
tar -xzf /tmp/fhir-ig-deploy/ig-output.tar.gz -C "$TARGET_DIR"
|
||||||
|
|
||||||
# Extract IG output
|
if [ -f "$TARGET_DIR/history.html" ]; then
|
||||||
echo "Extracting IG output..."
|
echo "✅ history.html deployed successfully"
|
||||||
tar -xzf /tmp/fhir-ig-deploy/ig-output.tar.gz -C "$TARGET_DIR"
|
else
|
||||||
|
echo "⚠️ WARNING: history.html not found in deployment"
|
||||||
|
fi
|
||||||
|
|
||||||
# Verify history.html was deployed
|
cp "$TARGET_DIR/package-list.json" "$VERSIONS_DIR/package-list.json"
|
||||||
if [ -f "$TARGET_DIR/history.html" ]; then
|
cp "$TARGET_DIR/package-feed.xml" "$VERSIONS_DIR/package-feed.xml"
|
||||||
echo "✅ history.html deployed successfully"
|
|
||||||
else
|
|
||||||
echo "⚠️ WARNING: history.html not found in deployment"
|
|
||||||
fi
|
|
||||||
|
|
||||||
cp /tmp/fhir-ig-deploy/package-list.json "$VERSIONS_DIR/package-list.json"
|
cp "$TARGET_DIR/package-list.json" "/opt/fhir-ig/package-list.json"
|
||||||
|
cp "$TARGET_DIR/package-feed.xml" "/opt/fhir-ig/package-feed.xml"
|
||||||
|
|
||||||
# Copy package-feed.xml to root
|
if [ "$build_type" = "release" ]; then
|
||||||
cp /tmp/fhir-ig-deploy/package-feed.xml "$VERSIONS_DIR/package-feed.xml"
|
echo "Updating 'current' symlink to point to $version"
|
||||||
|
rm -f "$VERSIONS_DIR/current"
|
||||||
|
ln -sf "$version" "$VERSIONS_DIR/current"
|
||||||
|
fi
|
||||||
|
|
||||||
# Update 'current' symlink for releases
|
cd /opt/fhir-ig
|
||||||
if [ "$build_type" == "release" ]; then
|
|
||||||
echo "Updating 'current' symlink to point to $version"
|
|
||||||
rm -f "$VERSIONS_DIR/current"
|
|
||||||
ln -sf "$version" "$VERSIONS_DIR/current"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Ensure nginx container is running with correct config
|
if [ ! -f "docker-compose.prod.yml" ]; then
|
||||||
cd /opt/fhir-ig
|
echo "ERROR: docker-compose.prod.yml not found!"
|
||||||
|
echo "Please deploy the updated docker-compose.prod.yml and nginx.conf first"
|
||||||
|
exit 1
|
||||||
|
fi
|
||||||
|
|
||||||
# Download deployment files if they don't exist
|
docker compose -f docker-compose.prod.yml up -d --force-recreate fhir-ig
|
||||||
if [ ! -f "docker-compose.prod.yml" ]; then
|
|
||||||
echo "ERROR: docker-compose.prod.yml not found!"
|
|
||||||
echo "Please deploy the updated docker-compose.prod.yml and nginx.conf first"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Force recreate container to ensure new config/mounts are applied
|
rm -rf /tmp/fhir-ig-deploy
|
||||||
# This handles "stuck" states better than a simple restart
|
|
||||||
docker compose -f docker-compose.prod.yml up -d --force-recreate fhir-ig
|
|
||||||
|
|
||||||
# Cleanup
|
echo "=========================================="
|
||||||
rm -rf /tmp/fhir-ig-deploy
|
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 "=========================================="
|
||||||
|
|
||||||
echo "=========================================="
|
echo "Available versions:"
|
||||||
echo "✅ Deployment completed successfully!"
|
ls -lh "$VERSIONS_DIR" | grep -v total
|
||||||
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 "=========================================="
|
|
||||||
|
|
||||||
# List all versions
|
|
||||||
echo "Available versions:"
|
|
||||||
ls -lh "$VERSIONS_DIR" | grep -v total
|
|
||||||
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.1"/>
|
<version value="0.4.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"/>
|
||||||
@@ -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>
|
||||||
|
|||||||
@@ -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)
|
|
||||||
33
input/fsh/codeSystems/BDDGDADrugCS.fsh
Normal file
33
input/fsh/codeSystems/BDDGDADrugCS.fsh
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
CodeSystem: BDDGDADrugCS
|
||||||
|
Id: dgda-drug-registry
|
||||||
|
Title: "DGDA Drug Registry Code System"
|
||||||
|
Description: """
|
||||||
|
Code system representing the Drug Registration Authority (DGDA) of Bangladesh's
|
||||||
|
official drug registry. Concepts are maintained in the national OCL terminology
|
||||||
|
server at https://tr.ocl.dghs.gov.bd and are not enumerated within this
|
||||||
|
Implementation Guide.
|
||||||
|
|
||||||
|
This code system contains two concept classes:
|
||||||
|
- **Drug**: Finished pharmaceutical drug products (identified by DAR number and trade name)
|
||||||
|
- **Ingredient**: Raw material / active pharmaceutical ingredients
|
||||||
|
|
||||||
|
Concept IDs follow the format: {DAR-number}--{trade-name-slug}
|
||||||
|
Example: 353-0026-039--marvelous-fe
|
||||||
|
|
||||||
|
**Canonical URL note:** https://dgda.gov.bd/drug-registry is a logical identifier
|
||||||
|
only and does not resolve to a web endpoint.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://dgda.gov.bd/drug-registry"
|
||||||
|
* ^version = "v1.0.0"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "Directorate General of Drug Administration (DGDA), Government of 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"
|
||||||
|
* ^content = #not-present
|
||||||
|
* ^count = 39196
|
||||||
|
* ^caseSensitive = true
|
||||||
|
* ^valueSet = "https://dgda.gov.bd/fhir/ValueSet/registered-drugs"
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
CodeSystem: BDMedicationCodeSystem
|
CodeSystem: BDMedicationCS
|
||||||
Id: bd-medication-code
|
Id: bd-medication-code
|
||||||
Title: "Bangladesh Medication Codes"
|
Title: "Bangladesh Medication Codes"
|
||||||
Description: "Bangladesh Medication Codes"
|
Description: "Bangladesh Medication Codes"
|
||||||
@@ -21,4 +21,4 @@ ValueSet: BDMedicationVS
|
|||||||
Id: bd-medication-valueset
|
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 BDMedicationCS
|
||||||
@@ -30,12 +30,11 @@ Description: "Medication dose form codes according to CCDS guideline"
|
|||||||
"Low-viscosity liquid topical dosage form for external application."
|
"Low-viscosity liquid topical dosage form for external application."
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------
|
// // ---------------------------
|
||||||
// ValueSet for BD Medication Dose Forms
|
// // ValueSet for BD Medication Dose Forms
|
||||||
// ---------------------------
|
// // ---------------------------
|
||||||
ValueSet: BDMedicationDoseFormVS
|
// ValueSet: BDMedicationDoseFormVS
|
||||||
Id: bd-dose-form-valueset
|
// 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-valueset"
|
// * ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-dose-form-valueset"
|
||||||
* include codes from system BDMedicationDoseForm
|
|
||||||
|
|||||||
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
|
||||||
25
input/fsh/examples/BDEncounterExample.fsh
Normal file
25
input/fsh/examples/BDEncounterExample.fsh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Instance: BDEncounterExample
|
||||||
|
InstanceOf: BDEncounter
|
||||||
|
Usage: #example
|
||||||
|
Title: "Example of a Bangladesh Patient Encounter"
|
||||||
|
Description: "An example of an outpatient encounter for a Bangladesh patient."
|
||||||
|
|
||||||
|
* identifier[0].value = "ENC-2023-001"
|
||||||
|
* identifier[0].system = "https://fhir.dghs.gov.bd/core/identifier/encounter"
|
||||||
|
|
||||||
|
* status = #finished
|
||||||
|
|
||||||
|
// Must use a code from your BDEncounterClassSubsetVS
|
||||||
|
// Example using standard HL7 ActCode for ambulatory (outpatient)
|
||||||
|
* class = http://terminology.hl7.org/CodeSystem/v3-ActCode#AMB "ambulatory"
|
||||||
|
|
||||||
|
// Reference the patient example we created in the previous step
|
||||||
|
* subject = Reference(BDPatientExample)
|
||||||
|
|
||||||
|
// serviceProvider is 1..1 in your profile
|
||||||
|
* serviceProvider = Reference(BDOrganizationExample)
|
||||||
|
|
||||||
|
// participant and participant.period are 1..1
|
||||||
|
* participant[0].individual = Reference(BDPractitionerExample)
|
||||||
|
* participant[0].period.start = "2023-10-27T10:00:00Z"
|
||||||
|
* participant[0].period.end = "2023-10-27T10:30:00Z"
|
||||||
33
input/fsh/examples/BDMedicationExample.fsh
Normal file
33
input/fsh/examples/BDMedicationExample.fsh
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
Instance: BDMedicationExample
|
||||||
|
InstanceOf: BDMedication
|
||||||
|
Title: "Medication Example — Marvelous Fe (Combination Drug)"
|
||||||
|
Description: """
|
||||||
|
Example BDMedication instance for Marvelous Fe, a combination drug containing
|
||||||
|
ferrous sulphate and folic acid. Demonstrates multi-ingredient handling with
|
||||||
|
ICD-11 MMS substance codes populated from OCL Has-active-ingredient mappings.
|
||||||
|
Dose form coded using EDQM Standard Terms.
|
||||||
|
"""
|
||||||
|
Usage: #example
|
||||||
|
|
||||||
|
* code.coding[0].system = "https://dgda.gov.bd/drug-registry"
|
||||||
|
* code.coding[0].code = #353-0026-039--marvelous-fe
|
||||||
|
* code.coding[0].display = "Marvelous Fe"
|
||||||
|
* code.text = "Marvelous Fe"
|
||||||
|
|
||||||
|
* form.coding[0].system = "http://standardterms.edqm.eu"
|
||||||
|
* form.coding[0].code = #10219000
|
||||||
|
* form.coding[0].display = "Tablet"
|
||||||
|
|
||||||
|
// Ingredient 1: Ferrous Sulphate → ICD-11 XM substance code
|
||||||
|
* ingredient[0].itemCodeableConcept.coding[0].system = "http://id.who.int/icd/release/11/mms"
|
||||||
|
* ingredient[0].itemCodeableConcept.coding[0].code = #XM3SQ1
|
||||||
|
* ingredient[0].itemCodeableConcept.coding[0].display = "Ferrous sulphate"
|
||||||
|
* ingredient[0].itemCodeableConcept.text = "Ferrous sulphate"
|
||||||
|
* ingredient[0].isActive = true
|
||||||
|
|
||||||
|
// Ingredient 2: Folic Acid → ICD-11 XM substance code
|
||||||
|
* ingredient[1].itemCodeableConcept.coding[0].system = "http://id.who.int/icd/release/11/mms"
|
||||||
|
* ingredient[1].itemCodeableConcept.coding[0].code = #XM7R82
|
||||||
|
* ingredient[1].itemCodeableConcept.coding[0].display = "Folic acid"
|
||||||
|
* ingredient[1].itemCodeableConcept.text = "Folic acid"
|
||||||
|
* ingredient[1].isActive = true
|
||||||
41
input/fsh/examples/BDMedicationRequestExample.fsh
Normal file
41
input/fsh/examples/BDMedicationRequestExample.fsh
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
Instance: BDMedicationRequestExample
|
||||||
|
InstanceOf: BDMedicationRequest
|
||||||
|
Title: "Medication Request Example — Marvelous Fe Prescription"
|
||||||
|
Description: """
|
||||||
|
Example BDMedicationRequest instance prescribing Marvelous Fe. Demonstrates
|
||||||
|
the full prescription chain: BDMedicationRequest → BDMedication → DGDA code
|
||||||
|
→ ICD-11 substance ingredients. Route of administration coded using HL7 v3
|
||||||
|
RouteOfAdministration.
|
||||||
|
"""
|
||||||
|
Usage: #example
|
||||||
|
|
||||||
|
* identifier[0].system = "https://fhir.dghs.gov.bd/identifier/prescription"
|
||||||
|
* identifier[0].value = "RX-2024-BD-000001"
|
||||||
|
|
||||||
|
* status = #active
|
||||||
|
* intent = #order
|
||||||
|
|
||||||
|
* medicationReference = Reference(BDMedicationExample)
|
||||||
|
|
||||||
|
* subject = Reference(BDPatientExample)
|
||||||
|
* subject.display = "Example Patient"
|
||||||
|
|
||||||
|
* encounter = Reference(BDEncounterExample)
|
||||||
|
* encounter.display = "Example Outpatient Encounter"
|
||||||
|
|
||||||
|
* authoredOn = "2024-11-01T10:30:00+06:00"
|
||||||
|
|
||||||
|
* requester = Reference(BDPractitionerExample)
|
||||||
|
* requester.display = "Example Practitioner"
|
||||||
|
|
||||||
|
* dosageInstruction[0].text = "Take 1 tablet daily after meals"
|
||||||
|
* dosageInstruction[0].timing.repeat.frequency = 1
|
||||||
|
* dosageInstruction[0].timing.repeat.period = 1
|
||||||
|
* dosageInstruction[0].timing.repeat.periodUnit = #d
|
||||||
|
* dosageInstruction[0].route.coding[0].system = "http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration"
|
||||||
|
* dosageInstruction[0].route.coding[0].code = #PO
|
||||||
|
* dosageInstruction[0].route.coding[0].display = "Swallow, oral"
|
||||||
|
* dosageInstruction[0].doseAndRate[0].doseQuantity.value = 1
|
||||||
|
* dosageInstruction[0].doseAndRate[0].doseQuantity.unit = "tablet"
|
||||||
|
* dosageInstruction[0].doseAndRate[0].doseQuantity.system = "http://unitsofmeasure.org"
|
||||||
|
* dosageInstruction[0].doseAndRate[0].doseQuantity.code = #{tbl}
|
||||||
22
input/fsh/examples/BDOrganizationExample.fsh
Normal file
22
input/fsh/examples/BDOrganizationExample.fsh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
Instance: BDOrganizationExample
|
||||||
|
InstanceOf: BDOrganization
|
||||||
|
Usage: #example
|
||||||
|
Title: "Dhaka Medical College Hospital"
|
||||||
|
Description: "Example for DMCH using the Facility Code 10000033"
|
||||||
|
|
||||||
|
// Strictly following 'identifier 1..* MS' from your profile
|
||||||
|
* identifier[0].value = "10000033"
|
||||||
|
* identifier[0].system = "http://hrm.dghs.gov.bd/facilities/code" // Using a generic DGHS system
|
||||||
|
* identifier[0].type = http://terminology.hl7.org/CodeSystem/v2-0203#FI "Facility ID"
|
||||||
|
|
||||||
|
* name = "Dhaka Medical College Hospital"
|
||||||
|
|
||||||
|
// Standard FHIR Address fields (No 'division' as a top-level field)
|
||||||
|
* address[0].line = "100 Ramna"
|
||||||
|
* address[0].city = "Dhaka"
|
||||||
|
* address[0].district = "Dhaka"
|
||||||
|
* address[0].country = "BD"
|
||||||
|
|
||||||
|
// To include Division without a 'does not exist' error, use the extension syntax:
|
||||||
|
* address[0].extension[0].url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-division"
|
||||||
|
* address[0].extension[0].valueCodeableConcept = https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes#30 "Dhaka"
|
||||||
39
input/fsh/examples/BDPatientExample.fsh
Normal file
39
input/fsh/examples/BDPatientExample.fsh
Normal file
@@ -0,0 +1,39 @@
|
|||||||
|
Instance: BDPatientExample
|
||||||
|
InstanceOf: BDPatient
|
||||||
|
Usage: #example
|
||||||
|
Title: "Example of a Bangladesh Patient"
|
||||||
|
Description: "A minimal example for a patient satisfying name translations and address requirements."
|
||||||
|
|
||||||
|
// Required Name with English and Bangla Translations
|
||||||
|
* name[0].use = #official
|
||||||
|
* name[0].text = "Abul Kashem"
|
||||||
|
* name[0].text.extension[nameEn].extension[lang].valueCode = #en
|
||||||
|
* name[0].text.extension[nameEn].extension[content].valueString = "Abul Kashem"
|
||||||
|
* name[0].text.extension[nameBn].extension[lang].valueCode = #bn
|
||||||
|
* name[0].text.extension[nameBn].extension[content].valueString = "আবুল কাশেম"
|
||||||
|
|
||||||
|
// Required Gender and BirthDate (for clinical completeness)
|
||||||
|
* gender = #male
|
||||||
|
* birthDate = "1985-05-20"
|
||||||
|
|
||||||
|
// Identifier Slice: NID Example
|
||||||
|
* identifier[NID].type.coding.system = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type"
|
||||||
|
* identifier[NID].type.coding.code = #NID
|
||||||
|
* identifier[NID].value = "1234567890"
|
||||||
|
|
||||||
|
// --- Address with required extensions ---
|
||||||
|
* address[0].use = #home
|
||||||
|
* address[0].line = "House 12, Road 5"
|
||||||
|
* address[0].city = "Dhamrai"
|
||||||
|
* address[0].district = "Dhaka" // This is a native field in your profile
|
||||||
|
* address[0].postalCode = "1350"
|
||||||
|
* address[0].country = "BD"
|
||||||
|
|
||||||
|
// The "Division" extension (Must match the name in BDAddress)
|
||||||
|
* address[0].extension[division].valueCodeableConcept = https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes#30 "Dhaka"
|
||||||
|
|
||||||
|
// The "Upazilla" extension (Must match the name in BDAddress)
|
||||||
|
* address[0].extension[upazilla].valueCodeableConcept = https://fhir.dghs.gov.bd/core/CodeSystem/bd-geocodes#3026 "Dhamrai"
|
||||||
|
|
||||||
|
// Optional Religion Extension
|
||||||
|
* extension[religion].valueCodeableConcept = https://fhir.dghs.gov.bd/core/CodeSystem/bd-religions-cs#islam "Islam"
|
||||||
25
input/fsh/examples/BDPractitionerExample.fsh
Normal file
25
input/fsh/examples/BDPractitionerExample.fsh
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
Instance: BDPractitionerExample
|
||||||
|
InstanceOf: BDPractitioner
|
||||||
|
Usage: #example
|
||||||
|
Title: "Example of a Bangladesh Practitioner"
|
||||||
|
Description: "A licensed physician example for the Bangladesh HIE."
|
||||||
|
|
||||||
|
// Required Identifier (1..* MS)
|
||||||
|
// Using BMDC (Bangladesh Medical & Dental Council) registration number
|
||||||
|
* identifier[0].system = "https://fhir.dghs.gov.bd/core/identifier/bmdc-registration"
|
||||||
|
* identifier[0].value = "A-12345"
|
||||||
|
* identifier[0].type = http://terminology.hl7.org/CodeSystem/v2-0203#MD "Medical License number"
|
||||||
|
|
||||||
|
// Recommended Name
|
||||||
|
* name[0].use = #official
|
||||||
|
* name[0].family = "Ahmed"
|
||||||
|
* name[0].given[0] = "Tanvir"
|
||||||
|
* name[0].prefix[0] = "Dr."
|
||||||
|
|
||||||
|
// Contact Information
|
||||||
|
* telecom[0].system = #phone
|
||||||
|
* telecom[0].value = "+8801712345678"
|
||||||
|
* telecom[0].use = #work
|
||||||
|
|
||||||
|
// Gender (Commonly used in health records)
|
||||||
|
* gender = #male
|
||||||
@@ -6,5 +6,5 @@ Description: "BD Division"
|
|||||||
Context: Address
|
Context: Address
|
||||||
|
|
||||||
|
|
||||||
* value[x] only string
|
* value[x] only CodeableConcept
|
||||||
* value[x] from BDDivisionsVS
|
* valueCodeableConcept from BDDivisionsVS (required)
|
||||||
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.
|
||||||
|
"""
|
||||||
@@ -6,5 +6,5 @@ Description: "BD Upazilla"
|
|||||||
Context: Address
|
Context: Address
|
||||||
|
|
||||||
|
|
||||||
* value[x] only string
|
* value[x] only CodeableConcept
|
||||||
* value[x] from BDUpazillasVS
|
* valueCodeableConcept from BDUpazillasVS (required)
|
||||||
@@ -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 (required)
|
||||||
|
* 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
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
|
|
||||||
Profile: BDEncounterProfile
|
Profile: BDEncounter
|
||||||
Id: bd-encounter
|
Id: bd-encounter
|
||||||
Parent: Encounter
|
Parent: Encounter
|
||||||
Title: "Encounter Profile for Bangladesh"
|
Title: "Encounter Profile for Bangladesh"
|
||||||
|
|||||||
@@ -35,11 +35,11 @@ Description: "Bangladesh Immunization Profile"
|
|||||||
|
|
||||||
* patient 1..1
|
* patient 1..1
|
||||||
* patient ^definition = "The patient receiving the vaccine"
|
* patient ^definition = "The patient receiving the vaccine"
|
||||||
* patient only Reference(BDPatientProfile)
|
* patient only Reference(BDPatient)
|
||||||
|
|
||||||
* encounter 1..1
|
* encounter 1..1
|
||||||
* encounter ^definition = "Encounter during which vaccine was administered"
|
* encounter ^definition = "Encounter during which vaccine was administered"
|
||||||
* encounter only Reference(BDEncounterProfile)
|
* encounter only Reference(BDEncounter)
|
||||||
|
|
||||||
* occurrence[x] 1..1
|
* occurrence[x] 1..1
|
||||||
|
|
||||||
|
|||||||
77
input/fsh/profile/BDLabPanelObservation.fsh
Normal file
77
input/fsh/profile/BDLabPanelObservation.fsh
Normal file
@@ -0,0 +1,77 @@
|
|||||||
|
Profile: BDLabPanelObservationProfile
|
||||||
|
Id: bd-lab-panel-observation
|
||||||
|
Parent: bd-observation
|
||||||
|
Title: "Bangladesh Laboratory Panel Observation"
|
||||||
|
Description: """
|
||||||
|
Profile for laboratory panel (order-level) Observations in Bangladesh.
|
||||||
|
Represents an ordered laboratory test panel (e.g. CBC, LFT, RFT) as the
|
||||||
|
parent Observation in a hasMember hierarchy.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
- Observation.code is the panel/order code (from BD LOINC Lab Panels ValueSet)
|
||||||
|
- Observation.hasMember references individual result Observations
|
||||||
|
(bd-lab-result-observation) for each component
|
||||||
|
- Observation.value[x] is prohibited — panels do not carry a direct result value
|
||||||
|
- Observation.category is fixed to 'laboratory'
|
||||||
|
|
||||||
|
FHIR hasMember pattern:
|
||||||
|
DiagnosticReport.result --> bd-lab-panel-observation
|
||||||
|
└── hasMember --> bd-lab-result-observation (x N)
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-lab-panel-observation"
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^status = #draft
|
||||||
|
|
||||||
|
// ── Identifier ────────────────────────────────────────────────────────────
|
||||||
|
// Lab panels must carry an identifier (accession number or order ID).
|
||||||
|
* identifier 1..* MS
|
||||||
|
* identifier.value 1..1
|
||||||
|
|
||||||
|
// ── Category ──────────────────────────────────────────────────────────────
|
||||||
|
// Fixed to 'laboratory' for all lab panel observations.
|
||||||
|
* category = http://terminology.hl7.org/CodeSystem/observation-category#laboratory
|
||||||
|
* category ^definition = "Fixed to 'laboratory' for laboratory panel observations"
|
||||||
|
|
||||||
|
// ── Code ──────────────────────────────────────────────────────────────────
|
||||||
|
// Bound to BD LOINC Lab Panels ValueSet — orderable panel codes only.
|
||||||
|
* code 1..1 MS
|
||||||
|
* code from https://fhir.dghs.gov.bd/core/ValueSet/loinc-lab-panels (extensible)
|
||||||
|
* code ^definition = "LOINC panel/order code for this laboratory panel"
|
||||||
|
* code ^comment = "E.g. 58410-2 CBC panel, 24323-8 Comprehensive metabolic panel"
|
||||||
|
|
||||||
|
// ── Status ────────────────────────────────────────────────────────────────
|
||||||
|
// Restrict to statuses relevant to lab reporting.
|
||||||
|
* status from http://hl7.org/fhir/ValueSet/observation-status (required)
|
||||||
|
|
||||||
|
// ── Effective ─────────────────────────────────────────────────────────────
|
||||||
|
// When the panel was performed — required for lab context.
|
||||||
|
* effective[x] 1..1 MS
|
||||||
|
* effective[x] only dateTime or Period
|
||||||
|
* effectiveDateTime ^definition = "Date/time the laboratory panel was performed"
|
||||||
|
|
||||||
|
// ── Value[x] ──────────────────────────────────────────────────────────────
|
||||||
|
// Panels do not carry a direct result value — results are in hasMember children.
|
||||||
|
* value[x] 0..0
|
||||||
|
|
||||||
|
// ── hasMember ─────────────────────────────────────────────────────────────
|
||||||
|
// Must reference at least one component result Observation.
|
||||||
|
// Typed to bd-lab-result-observation.
|
||||||
|
* hasMember 1..* MS
|
||||||
|
* hasMember only Reference(BDLabResultObservationProfile)
|
||||||
|
* hasMember ^definition = "References to individual component result Observations for this panel"
|
||||||
|
* hasMember ^comment = "Each hasMember entry is a bd-lab-result-observation"
|
||||||
|
|
||||||
|
// ── derivedFrom ───────────────────────────────────────────────────────────
|
||||||
|
// Panels are not derived from other observations — prohibited at this level.
|
||||||
|
* derivedFrom 0..0
|
||||||
|
|
||||||
|
// ── Specimen ──────────────────────────────────────────────────────────────
|
||||||
|
// SHOULD be present for laboratory panels per IPS alignment.
|
||||||
|
* specimen 0..1 MS
|
||||||
|
* specimen ^definition = "Specimen collected for this laboratory panel"
|
||||||
|
* specimen ^comment = "Should be present when specimen information is available"
|
||||||
|
|
||||||
|
// ── Note ──────────────────────────────────────────────────────────────────
|
||||||
|
* note 0..* MS
|
||||||
|
* note ^definition = "Comments about the laboratory panel"
|
||||||
122
input/fsh/profile/BDLabReport.fsh
Normal file
122
input/fsh/profile/BDLabReport.fsh
Normal file
@@ -0,0 +1,122 @@
|
|||||||
|
Profile: BDLabReportProfile
|
||||||
|
Id: bd-lab-report
|
||||||
|
Parent: DiagnosticReport
|
||||||
|
Title: "Bangladesh Laboratory Report"
|
||||||
|
Description: """
|
||||||
|
Profile for laboratory DiagnosticReport in Bangladesh, aligned with IPS
|
||||||
|
(International Patient Summary) DiagnosticReport pattern.
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
- Represents a complete laboratory report for a patient encounter
|
||||||
|
- DiagnosticReport.result references panel-level Observations
|
||||||
|
(bd-lab-panel-observation) or standalone result Observations
|
||||||
|
(bd-lab-result-observation) where no panel grouping exists
|
||||||
|
- DiagnosticReport.code is fixed to LOINC 11502-2 (Laboratory report)
|
||||||
|
- specimen is SHOULD (MS, 0..*)
|
||||||
|
|
||||||
|
Report structure:
|
||||||
|
bd-lab-report (DiagnosticReport)
|
||||||
|
├── result --> bd-lab-panel-observation
|
||||||
|
│ └── hasMember --> bd-lab-result-observation (x N)
|
||||||
|
└── result --> bd-lab-result-observation (standalone, no panel)
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-lab-report"
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^status = #draft
|
||||||
|
|
||||||
|
// ── Identifier ────────────────────────────────────────────────────────────
|
||||||
|
// Lab reports must carry an accession number or report ID.
|
||||||
|
* identifier 1..* MS
|
||||||
|
* identifier.value 1..1
|
||||||
|
|
||||||
|
// ── Status ────────────────────────────────────────────────────────────────
|
||||||
|
* status 1..1
|
||||||
|
* status from http://hl7.org/fhir/ValueSet/diagnostic-report-status (required)
|
||||||
|
* status ^definition = "Status of the laboratory report"
|
||||||
|
* status ^comment = "E.g. registered, partial, preliminary, final, amended, corrected"
|
||||||
|
|
||||||
|
// ── Category ──────────────────────────────────────────────────────────────
|
||||||
|
// Fixed to LAB (laboratory) category.
|
||||||
|
* category 1..* MS
|
||||||
|
* category = http://terminology.hl7.org/CodeSystem/v2-0074#LAB "Laboratory"
|
||||||
|
* category ^definition = "Fixed to 'LAB' for laboratory diagnostic reports"
|
||||||
|
|
||||||
|
// ── Code ──────────────────────────────────────────────────────────────────
|
||||||
|
// Fixed to LOINC 11502-2 (Laboratory report) — IPS-aligned.
|
||||||
|
* code 1..1 MS
|
||||||
|
* code = http://loinc.org#11502-2 "Laboratory report"
|
||||||
|
* code ^definition = "Fixed to LOINC 11502-2 — Laboratory report"
|
||||||
|
|
||||||
|
// ── Subject ───────────────────────────────────────────────────────────────
|
||||||
|
* subject 1..1 MS
|
||||||
|
* subject only Reference(Patient)
|
||||||
|
* subject.reference 1..1 MS
|
||||||
|
* subject.display 1..1 MS
|
||||||
|
* subject ^definition = "Reference to the Patient this report is about"
|
||||||
|
|
||||||
|
// ── Encounter ─────────────────────────────────────────────────────────────
|
||||||
|
* encounter 1..1 MS
|
||||||
|
* encounter.reference 1..1 MS
|
||||||
|
* encounter ^definition = "Reference to the Encounter during which this report was ordered"
|
||||||
|
|
||||||
|
// ── Effective ─────────────────────────────────────────────────────────────
|
||||||
|
// When the report was clinically relevant — required for lab context.
|
||||||
|
* effective[x] 1..1 MS
|
||||||
|
* effective[x] only dateTime or Period
|
||||||
|
* effectiveDateTime ^definition = "Date/time the specimen was collected or the report period"
|
||||||
|
|
||||||
|
// ── Issued ────────────────────────────────────────────────────────────────
|
||||||
|
// Date/time the report was released — required for lab reports.
|
||||||
|
* issued 1..1 MS
|
||||||
|
* issued ^definition = "Date/time the report was issued by the laboratory"
|
||||||
|
|
||||||
|
// ── Performer ─────────────────────────────────────────────────────────────
|
||||||
|
// Who performed the laboratory test (laboratory organization or practitioner).
|
||||||
|
// Kept flexible — may be Organization, Practitioner, or PractitionerRole.
|
||||||
|
* performer 1..* MS
|
||||||
|
* performer ^definition = "Laboratory or practitioner who performed the test"
|
||||||
|
* performer ^comment = "Typically the laboratory Organization. May also include the responsible Practitioner."
|
||||||
|
|
||||||
|
// ── Results Interpreter ───────────────────────────────────────────────────
|
||||||
|
// Who interpreted the results (clinician, pathologist).
|
||||||
|
// Optional but MustSupport — include when a formal interpretation was made.
|
||||||
|
* resultsInterpreter 0..* MS
|
||||||
|
* resultsInterpreter ^definition = "Clinician or pathologist who interpreted the laboratory results"
|
||||||
|
* resultsInterpreter ^comment = "Include when a formal interpretation or authorisation was made by a named clinician."
|
||||||
|
|
||||||
|
// ── Specimen ──────────────────────────────────────────────────────────────
|
||||||
|
// SHOULD be present per IPS alignment — MustSupport, optional cardinality.
|
||||||
|
* specimen 0..* MS
|
||||||
|
* specimen ^definition = "Specimen(s) used for this laboratory report"
|
||||||
|
* specimen ^comment = "Should be present when specimen information is available. IPS alignment: SHOULD."
|
||||||
|
|
||||||
|
// ── Result ────────────────────────────────────────────────────────────────
|
||||||
|
// References panel-level Observations or standalone result Observations.
|
||||||
|
// At least one result is required for a meaningful report.
|
||||||
|
* result 1..* MS
|
||||||
|
* result only Reference(BDLabPanelObservationProfile or BDLabResultObservationProfile)
|
||||||
|
* result ^definition = "References to Observation resources that are part of this report"
|
||||||
|
* result ^comment = """
|
||||||
|
Use BDLabPanelObservationProfile for ordered panels (CBC, LFT, RFT, etc.)
|
||||||
|
where individual results are grouped under a panel using hasMember.
|
||||||
|
Use BDLabResultObservationProfile directly for standalone results
|
||||||
|
that are not part of a named panel.
|
||||||
|
"""
|
||||||
|
|
||||||
|
// ── Conclusion ────────────────────────────────────────────────────────────
|
||||||
|
// Free-text clinical interpretation of the overall report.
|
||||||
|
* conclusion 0..1 MS
|
||||||
|
* conclusion ^definition = "Clinical interpretation or summary of the laboratory report"
|
||||||
|
|
||||||
|
// ── Conclusion Code ───────────────────────────────────────────────────────
|
||||||
|
// Coded clinical finding — may reference ICD-11 diagnosis codes.
|
||||||
|
* conclusionCode 0..* MS
|
||||||
|
* conclusionCode ^definition = "Coded representation of the clinical conclusion"
|
||||||
|
* conclusionCode ^comment = "May use ICD-11 MMS codes consistent with bd-condition-icd11-diagnosis-valueset"
|
||||||
|
|
||||||
|
// ── Presented Form ────────────────────────────────────────────────────────
|
||||||
|
// Attach the original PDF or HL7 CDA report if available.
|
||||||
|
* presentedForm 0..* MS
|
||||||
|
* presentedForm ^definition = "Entire report as issued — e.g. PDF attachment"
|
||||||
|
* presentedForm ^comment = "Include the original report document when available"
|
||||||
104
input/fsh/profile/BDLabResultObservation.fsh
Normal file
104
input/fsh/profile/BDLabResultObservation.fsh
Normal file
@@ -0,0 +1,104 @@
|
|||||||
|
Profile: BDLabResultObservationProfile
|
||||||
|
Id: bd-lab-result-observation
|
||||||
|
Parent: bd-observation
|
||||||
|
Title: "Bangladesh Laboratory Result Observation"
|
||||||
|
Description: """
|
||||||
|
Profile for individual laboratory result (component-level) Observations
|
||||||
|
in Bangladesh. Represents a single test result within a laboratory panel
|
||||||
|
(e.g. Haemoglobin within a CBC panel).
|
||||||
|
|
||||||
|
Usage:
|
||||||
|
- Observation.code is the result/component code (from BD LOINC Lab Results ValueSet)
|
||||||
|
- Observation.value[x] is required — every leaf result must carry a value
|
||||||
|
- Observation.hasMember is prohibited — leaf results cannot group further
|
||||||
|
- Observation.derivedFrom references the parent panel Observation
|
||||||
|
- Observation.category is fixed to 'laboratory'
|
||||||
|
|
||||||
|
FHIR hasMember pattern:
|
||||||
|
bd-lab-panel-observation
|
||||||
|
└── hasMember --> bd-lab-result-observation (this profile)
|
||||||
|
|
||||||
|
Coded results (Ord/Nom scale):
|
||||||
|
Use valueCodeableConcept with codes from BD LOINC Answer Lists ValueSet.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-lab-result-observation"
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^status = #draft
|
||||||
|
|
||||||
|
// ── Identifier ────────────────────────────────────────────────────────────
|
||||||
|
// Result observations carry the accession number or result ID.
|
||||||
|
* identifier 1..* MS
|
||||||
|
* identifier.value 1..1
|
||||||
|
|
||||||
|
// ── Category ──────────────────────────────────────────────────────────────
|
||||||
|
// Fixed to 'laboratory' for all lab result observations.
|
||||||
|
* category = http://terminology.hl7.org/CodeSystem/observation-category#laboratory
|
||||||
|
* category ^definition = "Fixed to 'laboratory' for laboratory result observations"
|
||||||
|
|
||||||
|
// ── Code ──────────────────────────────────────────────────────────────────
|
||||||
|
// Bound to BD LOINC Lab Results ValueSet — leaf result codes only.
|
||||||
|
* code 1..1 MS
|
||||||
|
* code from https://fhir.dghs.gov.bd/core/ValueSet/loinc-lab-results (extensible)
|
||||||
|
* code ^definition = "LOINC result/component code for this individual laboratory result"
|
||||||
|
* code ^comment = "E.g. 718-7 Hemoglobin, 2160-0 Creatinine"
|
||||||
|
|
||||||
|
// ── Status ────────────────────────────────────────────────────────────────
|
||||||
|
* status from http://hl7.org/fhir/ValueSet/observation-status (required)
|
||||||
|
|
||||||
|
// ── Effective ─────────────────────────────────────────────────────────────
|
||||||
|
* effective[x] 1..1 MS
|
||||||
|
* effective[x] only dateTime or Period
|
||||||
|
* effectiveDateTime ^definition = "Date/time the result was obtained"
|
||||||
|
|
||||||
|
// ── Value[x] ──────────────────────────────────────────────────────────────
|
||||||
|
// Required — every leaf result must carry a value.
|
||||||
|
* value[x] 1..1 MS
|
||||||
|
* value[x] only Quantity or CodeableConcept
|
||||||
|
* value[x] ^definition = "The actual result value for this laboratory test"
|
||||||
|
|
||||||
|
// Numeric results (Qn scale) — UCUM units required
|
||||||
|
* valueQuantity MS
|
||||||
|
* valueQuantity.value 1..1
|
||||||
|
* valueQuantity.unit 1..1
|
||||||
|
* valueQuantity.system 1..1
|
||||||
|
* valueQuantity.system = "http://unitsofmeasure.org"
|
||||||
|
* valueQuantity.code 1..1
|
||||||
|
* valueQuantity ^comment = "Use for quantitative (Qn scale) results. Units must be UCUM."
|
||||||
|
|
||||||
|
// Coded results (Ord/Nom scale) — bound to LOINC Answer Lists
|
||||||
|
* valueCodeableConcept MS
|
||||||
|
* valueCodeableConcept from https://fhir.dghs.gov.bd/core/ValueSet/loinc-answer-lists (extensible)
|
||||||
|
* valueCodeableConcept ^comment = "Use for ordinal or nominal (Ord/Nom scale) results."
|
||||||
|
|
||||||
|
// ── hasMember ─────────────────────────────────────────────────────────────
|
||||||
|
// Leaf results cannot group further observations.
|
||||||
|
* hasMember 0..0
|
||||||
|
|
||||||
|
// ── derivedFrom ───────────────────────────────────────────────────────────
|
||||||
|
// References the parent panel Observation.
|
||||||
|
* derivedFrom 0..* MS
|
||||||
|
* derivedFrom only Reference(BDLabPanelObservationProfile)
|
||||||
|
* derivedFrom ^definition = "Reference to the parent panel Observation this result belongs to"
|
||||||
|
|
||||||
|
// ── Interpretation ────────────────────────────────────────────────────────
|
||||||
|
// Strongly recommended for lab results — High, Low, Normal, etc.
|
||||||
|
* interpretation 0..* MS
|
||||||
|
* interpretation from http://hl7.org/fhir/ValueSet/observation-interpretation (extensible)
|
||||||
|
* interpretation ^definition = "Clinical interpretation of the result value"
|
||||||
|
* interpretation ^comment = "E.g. H (High), L (Low), N (Normal), A (Abnormal)"
|
||||||
|
|
||||||
|
// ── Reference Range ───────────────────────────────────────────────────────
|
||||||
|
* referenceRange 0..* MS
|
||||||
|
* referenceRange ^definition = "Normal reference range for this result"
|
||||||
|
* referenceRange ^comment = "Should be present when reference ranges are known"
|
||||||
|
|
||||||
|
// ── Specimen ──────────────────────────────────────────────────────────────
|
||||||
|
// May reference the same specimen as the parent panel.
|
||||||
|
* specimen 0..1 MS
|
||||||
|
* specimen ^definition = "Specimen used for this result observation"
|
||||||
|
* specimen ^comment = "Should be consistent with the parent panel specimen"
|
||||||
|
|
||||||
|
// ── Note ──────────────────────────────────────────────────────────────────
|
||||||
|
* note 0..* MS
|
||||||
|
* note ^definition = "Comments about this individual result"
|
||||||
@@ -1,17 +1,76 @@
|
|||||||
// @Name: Profile
|
|
||||||
// @Description: Example of a profile of the Medication resource. This example includes a few of the most commonly used constraints and documentation features of FHIR profiles.
|
|
||||||
|
|
||||||
Profile: BDMedication
|
Profile: BDMedication
|
||||||
Id: bd-medication
|
Id: bd-medication
|
||||||
Parent: Medication
|
Parent: Medication
|
||||||
Title: "Medication Profile for Bangladesh-V2"
|
Title: "Medication Profile for Bangladesh"
|
||||||
Description: "Profile of Medication Bangladesh Standard V2"
|
Description: """
|
||||||
|
Profile of the Medication resource for the Bangladesh National Health Information
|
||||||
|
Exchange (HIE). Drug products are coded using the DGDA Drug Registry maintained
|
||||||
|
by the Drug Registration Authority of Bangladesh and served via the national OCL
|
||||||
|
terminology server at https://tr.ocl.dghs.gov.bd.
|
||||||
|
|
||||||
* form 1..1 MS
|
Ingredient coding uses ICD-11 MMS substance codes (XM-prefix) to support
|
||||||
* form from BDMedicationDoseFormVS
|
International Patient Summary (IPS) generation and cross-border data exchange.
|
||||||
|
Ingredient data is system-populated from OCL Has-active-ingredient mappings and
|
||||||
|
is not required to be entered manually by clinicians.
|
||||||
|
|
||||||
|
Combination drugs are supported via the repeating ingredient element.
|
||||||
|
Unmatched ingredients (not yet mapped to ICD-11 substances) may be represented
|
||||||
|
using ingredient.itemCodeableConcept.text without a coded value.
|
||||||
|
|
||||||
|
Dose form is optional and should be coded using EDQM Standard Terms when
|
||||||
|
populated. Dose form is derivable from the DGDA drug concept via OCL lookup.
|
||||||
|
A DGDA plain text dose form to EDQM code mapping is planned for a future
|
||||||
|
IG version.
|
||||||
|
"""
|
||||||
|
|
||||||
* code 1..1 MS
|
* code 1..1 MS
|
||||||
* code from BDMedicationVS
|
* code from BDDGDADrugsVS (required)
|
||||||
|
* code ^short = "DGDA registered drug product code"
|
||||||
|
* code ^definition = """
|
||||||
|
The DGDA drug registry code identifying the finished pharmaceutical product.
|
||||||
|
Concept ID format: {DAR-number}--{trade-name-slug}
|
||||||
|
Example: 353-0026-039--marvelous-fe
|
||||||
|
"""
|
||||||
|
* code.text 1..1 MS
|
||||||
|
* code.text ^short = "Trade name of the drug product"
|
||||||
|
* code.text ^definition = """
|
||||||
|
The trade name of the drug product as registered with DGDA. Mandatory for
|
||||||
|
human readability in IPS documents and cross-border data exchange scenarios.
|
||||||
|
"""
|
||||||
|
|
||||||
* ingredient 1..* MS
|
* form 0..1 MS
|
||||||
* ingredient.strength 1..1 MS
|
* form from BDMedicationDoseFormVS (preferred)
|
||||||
|
* form ^short = "Pharmaceutical dose form — EDQM Standard Terms (optional)"
|
||||||
|
* form ^definition = """
|
||||||
|
The pharmaceutical dose form of the drug product. Optional in this profile
|
||||||
|
as dose form is carried as plain text in the DGDA drug concept and is
|
||||||
|
derivable via OCL lookup. When populated, EDQM Standard Terms codes served
|
||||||
|
from the national OCL terminology server should be used.
|
||||||
|
A DGDA dose form to EDQM mapping is planned for a future IG version.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ingredient MS
|
||||||
|
* ingredient ^short = "Active ingredient(s) of the drug product"
|
||||||
|
* ingredient ^definition = """
|
||||||
|
Active pharmaceutical ingredients of the drug product, coded using ICD-11 MMS
|
||||||
|
substance codes (XM-prefix). Populated automatically by clinical systems via
|
||||||
|
OCL Has-active-ingredient mappings. Combination drugs will carry multiple
|
||||||
|
ingredient entries. Unmatched ingredients may use text only without a coded value.
|
||||||
|
"""
|
||||||
|
* ingredient.item[x] only CodeableConcept
|
||||||
|
* ingredient.itemCodeableConcept 1..1 MS
|
||||||
|
* ingredient.itemCodeableConcept from BDICD11SubstancesVS (extensible)
|
||||||
|
* ingredient.itemCodeableConcept ^short = "ICD-11 substance code for the ingredient"
|
||||||
|
* ingredient.itemCodeableConcept ^definition = """
|
||||||
|
ICD-11 MMS substance code (XM-prefix) identifying the active ingredient.
|
||||||
|
Source value set: https://fhir.dghs.gov.bd/core/ValueSet/icd11-substances-valueset
|
||||||
|
served from the national OCL terminology server.
|
||||||
|
For ingredients not yet mapped to ICD-11 substances, use text only.
|
||||||
|
"""
|
||||||
|
* ingredient.strength 0..1
|
||||||
|
* ingredient.strength ^short = "Strength of the ingredient (optional)"
|
||||||
|
* ingredient.strength ^definition = """
|
||||||
|
Strength of the active ingredient. Optional in this profile as strength data
|
||||||
|
is maintained in the DGDA registry and accessible via OCL. May be populated
|
||||||
|
by dispensing systems for precision medication management.
|
||||||
|
"""
|
||||||
@@ -1,24 +1,66 @@
|
|||||||
// @Name: Profile
|
|
||||||
// @Description: Example of a profile of the MedicationRequest resource. This example includes a few of the most commonly used constraints and documentation features of FHIR profiles.
|
|
||||||
|
|
||||||
Profile: BDMedicationRequest
|
Profile: BDMedicationRequest
|
||||||
Id: bd-medication-request
|
Id: bd-medication-request
|
||||||
Parent: MedicationRequest
|
Parent: MedicationRequest
|
||||||
Title: "Medication Request Profile for Bangladesh-V2"
|
Title: "Medication Request Profile for Bangladesh"
|
||||||
Description: "Profile of MedicationRequest Bangladesh Standard V2"
|
Description: """
|
||||||
|
Profile of the MedicationRequest resource for the Bangladesh National Health
|
||||||
|
Information Exchange (HIE). Prescriptions must reference a BDMedication
|
||||||
|
resource coded against the DGDA Drug Registry, ensuring all prescribed
|
||||||
|
medications are traceable to DGDA-registered drug products.
|
||||||
|
|
||||||
|
This profile constrains medication references to BDMedication only.
|
||||||
|
Inline medicationCodeableConcept is not permitted — all medication data
|
||||||
|
must be carried in a referenced BDMedication resource to support ingredient
|
||||||
|
coding for IPS and cross-border data exchange.
|
||||||
|
|
||||||
|
Route of administration is coded using HL7 v3 RouteOfAdministration served
|
||||||
|
via the national OCL terminology server.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* identifier 1..* MS
|
||||||
|
* identifier ^short = "Prescription identifier"
|
||||||
|
* identifier ^definition = """
|
||||||
|
Business identifier for this prescription. At least one identifier is required
|
||||||
|
to support prescription tracking within the Bangladesh HIE.
|
||||||
|
"""
|
||||||
|
|
||||||
* identifier 1..*
|
|
||||||
* medication[x] 1..1 MS
|
* medication[x] 1..1 MS
|
||||||
* medication[x] only Reference(BDMedication) or CodeableConcept
|
* medication[x] only Reference(BDMedication)
|
||||||
* subject only Reference(BDPatientProfile)
|
* medication[x] ^short = "Reference to DGDA-registered medication"
|
||||||
|
* medication[x] ^definition = """
|
||||||
|
Reference to a BDMedication resource identifying the prescribed drug product.
|
||||||
|
The referenced BDMedication must carry a valid DGDA drug registry code.
|
||||||
|
Inline CodeableConcept is not permitted in this profile.
|
||||||
|
"""
|
||||||
|
|
||||||
|
* subject 1..1 MS
|
||||||
|
* subject only Reference(BDPatient)
|
||||||
|
* subject ^short = "Patient for whom the medication is prescribed"
|
||||||
|
|
||||||
* encounter 0..1 MS
|
* encounter 0..1 MS
|
||||||
* encounter only Reference(BDEncounterProfile)
|
* encounter only Reference(BDEncounter)
|
||||||
* encounter ^definition = "The encounter during which this prescription was created."
|
* encounter ^short = "Encounter during which this prescription was created"
|
||||||
* authoredOn 1..1
|
* encounter ^definition = """
|
||||||
* requester 1..1
|
The encounter during which this prescription was created. Should be populated
|
||||||
|
for inpatient and outpatient prescriptions where an encounter record exists.
|
||||||
|
"""
|
||||||
|
|
||||||
* reportedReference only Reference(BDPractitioner or BDOrganization or BDPatientProfile)
|
* authoredOn 1..1 MS
|
||||||
|
* authoredOn ^short = "Date and time the prescription was authored"
|
||||||
|
|
||||||
|
* requester 1..1 MS
|
||||||
* requester only Reference(BDPractitioner or BDOrganization)
|
* requester only Reference(BDPractitioner or BDOrganization)
|
||||||
|
* requester ^short = "Practitioner or organisation that authored the prescription"
|
||||||
|
|
||||||
|
* reportedReference only Reference(BDPractitioner or BDOrganization or BDPatient)
|
||||||
|
|
||||||
* priorPrescription only Reference(BDMedicationRequest)
|
* priorPrescription only Reference(BDMedicationRequest)
|
||||||
|
* priorPrescription ^short = "Reference to a prior prescription this replaces"
|
||||||
|
|
||||||
* basedOn only Reference(BDMedicationRequest or ServiceRequest or CarePlan or ImmunizationRecommendation)
|
* basedOn only Reference(BDMedicationRequest or ServiceRequest or CarePlan or ImmunizationRecommendation)
|
||||||
|
* basedOn ^short = "Plan or request this prescription is based on"
|
||||||
|
|
||||||
|
* dosageInstruction 0..* MS
|
||||||
|
* dosageInstruction.route MS
|
||||||
|
* dosageInstruction.route from BDRouteOfAdministrationVS (required)
|
||||||
|
* dosageInstruction.route ^short = "Route of administration coded using HL7 v3 RouteOfAdministration"
|
||||||
@@ -2,51 +2,83 @@ Profile: BDObservationProfile
|
|||||||
Id: bd-observation
|
Id: bd-observation
|
||||||
Parent: Observation
|
Parent: Observation
|
||||||
Title: "Bangladesh Observation Profile"
|
Title: "Bangladesh Observation Profile"
|
||||||
Description: "Bangladesh Observation Profile"
|
Description: """
|
||||||
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-observation"
|
Base observation profile for Bangladesh. This is an abstract-style base profile
|
||||||
* ^version = "1.0.0"
|
from which all BD-Core observation profiles are derived. It is not intended to
|
||||||
* ^status = #active
|
be used directly in clinical resources — use a derived profile instead.
|
||||||
|
|
||||||
* identifier 1..* MS
|
Derived profiles (v0.4.0):
|
||||||
|
- bd-lab-panel-observation : Laboratory panel/order (hasMember pattern)
|
||||||
|
- bd-lab-result-observation : Laboratory leaf result (child of hasMember)
|
||||||
|
|
||||||
|
Planned derived profiles (v0.5.0+):
|
||||||
|
- bd-vital-signs-observation
|
||||||
|
- bd-exam-observation
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/StructureDefinition/bd-observation"
|
||||||
|
* ^version = "2.0.0"
|
||||||
|
* ^status = #draft
|
||||||
|
|
||||||
|
// ── Identifier ────────────────────────────────────────────────────────────
|
||||||
|
// 0..* at base — not all observation types carry identifiers.
|
||||||
|
// Child profiles (e.g. lab results) constrain to 1..*.
|
||||||
|
* identifier 0..* MS
|
||||||
* identifier.value 1..1
|
* identifier.value 1..1
|
||||||
|
|
||||||
|
// ── Status ────────────────────────────────────────────────────────────────
|
||||||
* status 1..1
|
* status 1..1
|
||||||
|
|
||||||
* partOf 0..*
|
// ── Category ──────────────────────────────────────────────────────────────
|
||||||
|
// Preferred binding at base — child profiles fix to specific category codes
|
||||||
|
// (e.g. laboratory, vital-signs). Required binding here would block child
|
||||||
|
// profiles from narrowing to a fixed category slice.
|
||||||
* category 1..* MS
|
* category 1..* MS
|
||||||
* category from http://hl7.org/fhir/ValueSet/observation-category (required)
|
* category from http://hl7.org/fhir/ValueSet/observation-category (preferred)
|
||||||
* category ^definition = "Type of category"
|
* category ^definition = "Type of observation category"
|
||||||
* category ^comment = "E.g. vital, physical examination"
|
* category ^comment = "E.g. laboratory, vital-signs, exam. Child profiles fix this to a specific value."
|
||||||
|
|
||||||
|
// ── Code ──────────────────────────────────────────────────────────────────
|
||||||
|
// Extensible binding at base — child profiles bind to narrower ValueSets
|
||||||
|
// (e.g. BD LOINC lab panels, BD LOINC lab results). Required binding here
|
||||||
|
// would prevent child profiles from using a subset binding.
|
||||||
* code 1..1 MS
|
* code 1..1 MS
|
||||||
* code from http://hl7.org/fhir/ValueSet/observation-codes (required)
|
* code from http://hl7.org/fhir/ValueSet/observation-codes (extensible)
|
||||||
* code ^definition = "Type of test/measurement"
|
* code ^definition = "Type of observation / test / measurement"
|
||||||
* code ^comment = "E.g., Hb, RBS, CBC"
|
* code ^comment = "E.g. Hb, RBS, CBC. Child profiles bind to specific ValueSets."
|
||||||
|
|
||||||
// Subject: Reference to Patient Profile (Required)
|
// ── Subject ───────────────────────────────────────────────────────────────
|
||||||
* subject 1..1 MS
|
* subject 1..1 MS
|
||||||
|
* subject only Reference(Patient)
|
||||||
* subject.reference 1..1 MS
|
* subject.reference 1..1 MS
|
||||||
* subject.display 1..1 MS
|
* subject.display 1..1 MS
|
||||||
* subject.identifier 0..1
|
* subject.identifier 0..1
|
||||||
* subject ^definition = "Reference to Patient Profile"
|
* subject ^definition = "Reference to the Patient this observation is about"
|
||||||
* subject ^comment = "EX: http://mci.mcishr.dghs.gov.bd/api/v1/patients/98002412586"
|
* subject ^comment = "EX: http://mci.mcishr.dghs.gov.bd/api/v1/patients/98002412586"
|
||||||
|
|
||||||
|
// ── Encounter ─────────────────────────────────────────────────────────────
|
||||||
* encounter 1..1 MS
|
* encounter 1..1 MS
|
||||||
* encounter.reference 1..1 MS
|
* encounter.reference 1..1 MS
|
||||||
* encounter ^definition = "Reference to Patient Profile"
|
* encounter ^definition = "Reference to the Encounter during which this observation was made"
|
||||||
* encounter ^comment = "EX: uuid:34c38499-58ab-41e0-8e94-c3931491ad0e - bundle encounter uuid from local"
|
* encounter ^comment = "EX: uuid:34c38499-58ab-41e0-8e94-c3931491ad0e"
|
||||||
|
|
||||||
|
// ── Performer ─────────────────────────────────────────────────────────────
|
||||||
* performer 1..*
|
* performer 1..*
|
||||||
* performer.reference 1..1
|
* performer.reference 1..1
|
||||||
|
|
||||||
// Value[x]: Result value (Optional, but constrained)
|
// ── Part Of ───────────────────────────────────────────────────────────────
|
||||||
|
* partOf 0..*
|
||||||
|
|
||||||
|
// ── Value[x] ──────────────────────────────────────────────────────────────
|
||||||
|
// 0..1 at base — child profiles constrain presence and type.
|
||||||
|
// Panel observations set value[x] to 0..0.
|
||||||
|
// Result observations set value[x] to 1..1.
|
||||||
* value[x] 0..1
|
* value[x] 0..1
|
||||||
* value[x] ^definition = "Result value (Quantity, string, code, boolean, etc.)"
|
* value[x] ^definition = "Result value (Quantity, string, code, boolean, etc.)"
|
||||||
* valueQuantity 0..1
|
* valueQuantity 0..1
|
||||||
* valueQuantity ^comment = "If numeric, must include UCUM unit"
|
* valueQuantity ^comment = "If numeric, must include UCUM unit"
|
||||||
* valueQuantity.system 0..1
|
* valueQuantity.system 0..1
|
||||||
|
* valueQuantity.system = "http://unitsofmeasure.org"
|
||||||
* valueQuantity.code 0..1
|
* valueQuantity.code 0..1
|
||||||
* valueString 0..1
|
* valueString 0..1
|
||||||
* valueCodeableConcept 0..1
|
* valueCodeableConcept 0..1
|
||||||
@@ -59,26 +91,43 @@ Description: "Bangladesh Observation Profile"
|
|||||||
* valueDateTime 0..1
|
* valueDateTime 0..1
|
||||||
* valuePeriod 0..1
|
* valuePeriod 0..1
|
||||||
|
|
||||||
|
// ── Interpretation ────────────────────────────────────────────────────────
|
||||||
|
// Extensible at base — required was too strict for general observation use.
|
||||||
* interpretation 0..*
|
* interpretation 0..*
|
||||||
* interpretation from http://hl7.org/fhir/ValueSet/observation-interpretation (required)
|
* interpretation from http://hl7.org/fhir/ValueSet/observation-interpretation (extensible)
|
||||||
* interpretation ^definition = "Type of test/measurement"
|
* interpretation ^definition = "Assessment of the observation result"
|
||||||
* interpretation ^comment = "E.g.: High, low, normal, etc"
|
* interpretation ^comment = "E.g. High, Low, Normal"
|
||||||
|
|
||||||
|
// ── Method ────────────────────────────────────────────────────────────────
|
||||||
|
// Extensible at base — required was too strict for general observation use.
|
||||||
* method 0..1
|
* method 0..1
|
||||||
* method from http://hl7.org/fhir/ValueSet/observation-methods (required)
|
* method from http://hl7.org/fhir/ValueSet/observation-methods (extensible)
|
||||||
* method ^definition = "Type of observation method"
|
* method ^definition = "Type of observation method"
|
||||||
* method ^comment = "E.g.: Technique, Total measurement"
|
* method ^comment = "E.g. Technique, Total measurement"
|
||||||
|
|
||||||
// Issued: Date/time result was issued (Optional)
|
// ── Issued ────────────────────────────────────────────────────────────────
|
||||||
* issued 0..1
|
* issued 0..1
|
||||||
* issued ^definition = "Date/time result was issued"
|
* issued ^definition = "Date/time the result was issued"
|
||||||
|
|
||||||
// Reference Range: Normal reference range (Optional)
|
// ── Reference Range ───────────────────────────────────────────────────────
|
||||||
* referenceRange 0..*
|
* referenceRange 0..*
|
||||||
* referenceRange ^definition = "Normal reference range"
|
* referenceRange ^definition = "Normal reference range for the observation"
|
||||||
* referenceRange ^comment = "Optional"
|
|
||||||
|
|
||||||
// Specimen: Specimen used for the observation (Optional)
|
// ── Specimen ──────────────────────────────────────────────────────────────
|
||||||
* specimen 0..1
|
// MustSupport at base — relevant for lab, pathology, and future imaging.
|
||||||
* specimen ^definition = "Specimen used for the observation"
|
* specimen 0..1 MS
|
||||||
* specimen ^comment = "Optional"
|
* specimen ^definition = "Specimen used for this observation"
|
||||||
|
|
||||||
|
// ── hasMember ─────────────────────────────────────────────────────────────
|
||||||
|
// Defined at base to support the panel/component pattern.
|
||||||
|
// bd-lab-panel-observation constrains this to 1..* typed references.
|
||||||
|
// bd-lab-result-observation constrains this to 0..0.
|
||||||
|
* hasMember 0..* MS
|
||||||
|
* hasMember ^definition = "References to component result Observations that belong to this panel"
|
||||||
|
* hasMember ^comment = "Used in panel-type Observations. Leaf result Observations must not use hasMember."
|
||||||
|
|
||||||
|
// ── derivedFrom ───────────────────────────────────────────────────────────
|
||||||
|
// Defined at base to support child results referencing their parent panel.
|
||||||
|
* derivedFrom 0..* MS
|
||||||
|
* derivedFrom ^definition = "References to the panel Observation from which this result is derived"
|
||||||
|
* derivedFrom ^comment = "Used in leaf result Observations to reference their parent panel."
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Alias: $translation = http://hl7.org/fhir/StructureDefinition/translation
|
Alias: $translation = http://hl7.org/fhir/StructureDefinition/translation
|
||||||
// @Name: Profile
|
// @Name: Profile
|
||||||
// @Description: Example of a profile of the Patient resource. This example includes a few of the most commonly used constraints and documentation features of FHIR profiles.
|
// @Description: Example of a profile of the Patient resource. This example includes a few of the most commonly used constraints and documentation features of FHIR profiles.
|
||||||
Profile: BDPatientProfile
|
Profile: BDPatient
|
||||||
Id: bd-patient
|
Id: bd-patient
|
||||||
Parent: Patient
|
Parent: Patient
|
||||||
Title: "Patient Profile for Bangladesh"
|
Title: "Patient Profile for Bangladesh"
|
||||||
@@ -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-valueset"
|
* identifier[NID].type.coding.system = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type"
|
||||||
* 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-valueset"
|
* identifier[BRN].type.coding.system = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type"
|
||||||
* 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-valueset"
|
* identifier[UHID].type.coding.system = "https://fhir.dghs.gov.bd/core/CodeSystem/bd-identifier-type"
|
||||||
* identifier[UHID].type from BangladeshIdentifierTypeVS (extensible)
|
* identifier[UHID].type from BangladeshIdentifierTypeVS (extensible)
|
||||||
* identifier[UHID].type.text = "Organization identifier"
|
* identifier[UHID].type.text = "Organization identifier"
|
||||||
|
|
||||||
|
|||||||
@@ -10,8 +10,10 @@ Description: "Address for Bangladesh Standard"
|
|||||||
|
|
||||||
* country 1..1 MS
|
* country 1..1 MS
|
||||||
* extension contains Division named division 1..1 MS
|
* extension contains Division named division 1..1 MS
|
||||||
|
* extension[division] ^short = "Division code"
|
||||||
|
|
||||||
* district 1..1 MS
|
* district 1..1 MS
|
||||||
* district from BDDistrictsVS
|
* district from BDDistrictsVS
|
||||||
|
|
||||||
* extension contains Upazillas named upazilla 1..1 MS
|
* extension contains Upazillas named upazilla 1..1 MS
|
||||||
|
* extension[upazilla] ^short = "Upazilla code"
|
||||||
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
|
|
||||||
34
input/fsh/valueSets/BDDGDADrugsVS.fsh
Normal file
34
input/fsh/valueSets/BDDGDADrugsVS.fsh
Normal file
@@ -0,0 +1,34 @@
|
|||||||
|
ValueSet: BDDGDADrugsVS
|
||||||
|
Id: dgda-registered-drugs
|
||||||
|
Title: "DGDA Registered Drugs Value Set"
|
||||||
|
Description: """
|
||||||
|
Value set containing all registered drug products from the Drug Registration
|
||||||
|
Authority (DGDA) of Bangladesh. This value set includes 39,196 finished
|
||||||
|
pharmaceutical drug product concepts maintained in the national OCL terminology
|
||||||
|
server at https://tr.ocl.dghs.gov.bd.
|
||||||
|
|
||||||
|
This value set is the normative binding for BDMedication.code and represents
|
||||||
|
the only permitted drug coding vocabulary for medication resources in the
|
||||||
|
Bangladesh national health information exchange.
|
||||||
|
|
||||||
|
Validation is performed via $validate-code and $lookup against the national
|
||||||
|
OCL terminology server. $expand is not supported for this value set due to its
|
||||||
|
size.
|
||||||
|
|
||||||
|
Source collection: dgda-registered-drugs-valueset (MoHFW organisation, OCL)
|
||||||
|
OCL collection canonical: https://dgda.gov.bd/fhir/ValueSet/registered-drugs
|
||||||
|
OCL FHIR endpoint: https://tr.ocl.dghs.gov.bd/orgs/MoHFW/collections/dgda-registered-drugs-valueset/
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://dgda.gov.bd/fhir/ValueSet/registered-drugs"
|
||||||
|
* ^version = "v1.0.0"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "Directorate General of Drug Administration (DGDA), Government of 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"
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system https://dgda.gov.bd/drug-registry
|
||||||
32
input/fsh/valueSets/BDICD11SubstancesVS.fsh
Normal file
32
input/fsh/valueSets/BDICD11SubstancesVS.fsh
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
ValueSet: BDICD11SubstancesVS
|
||||||
|
Id: icd11-substances-valueset
|
||||||
|
Title: "ICD-11 Substances Value Set"
|
||||||
|
Description: """
|
||||||
|
Value set containing all ICD-11 MMS substance and medicament concepts
|
||||||
|
(XM-prefix concept class: Substance) maintained in the national OCL
|
||||||
|
terminology server at https://tr.ocl.dghs.gov.bd.
|
||||||
|
|
||||||
|
This value set contains 7,776 substance concepts and is used for coding
|
||||||
|
active pharmaceutical ingredients in the BDMedication.ingredient element
|
||||||
|
to support IPS generation and cross-border data exchange.
|
||||||
|
|
||||||
|
This value set is defined and maintained in OCL. It is declared here as a
|
||||||
|
minimal stub to allow IG publisher binding resolution only.
|
||||||
|
|
||||||
|
**OCL collection canonical:** https://fhir.dghs.gov.bd/core/ValueSet/icd11-substances-valueset
|
||||||
|
**OCL FHIR endpoint:** https://tr.ocl.dghs.gov.bd/orgs/MoHFW/collections/icd11-substances-valueset/
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/icd11-substances-valueset"
|
||||||
|
* ^version = "2025-01"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "World Health Organization (WHO) — served via DGHS National OCL"
|
||||||
|
* ^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"
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system http://id.who.int/icd/release/11/mms
|
||||||
|
where concept-class = "Substance"
|
||||||
22
input/fsh/valueSets/BDLoincAnswerListsVS.fsh
Normal file
22
input/fsh/valueSets/BDLoincAnswerListsVS.fsh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
ValueSet: BDLoincAnswerListsVS
|
||||||
|
Id: bd-loinc-answer-lists-valueset
|
||||||
|
Title: "Bangladesh LOINC Answer Lists ValueSet"
|
||||||
|
Description: "LOINC answer codes (LA-prefixed) and answer list groupers (LL-prefixed)
|
||||||
|
for Bangladesh laboratory results. Includes all answer codes referenced by in-scope
|
||||||
|
lab result codes from LOINC 2.82. Used as Observation.valueCodeableConcept in
|
||||||
|
bd-lab-result-observation for ordinal and nominal scale results."
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-loinc-answer-lists-valueset"
|
||||||
|
* ^status = #draft
|
||||||
|
* ^experimental = true
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.name = "DGHS Health Information Unit"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^copyright = "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use."
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system http://loinc.org
|
||||||
|
where concept in "https://fhir.dghs.gov.bd/core/ValueSet/loinc-answer-lists"
|
||||||
21
input/fsh/valueSets/BDLoincLabPanelsVS.fsh
Normal file
21
input/fsh/valueSets/BDLoincLabPanelsVS.fsh
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
ValueSet: BDLoincLabPanelsVS
|
||||||
|
Id: bd-loinc-lab-panels-valueset
|
||||||
|
Title: "Bangladesh LOINC Lab Panels ValueSet"
|
||||||
|
Description: "LOINC orderable laboratory panel codes for Bangladesh. Includes universal
|
||||||
|
lab order panel codes from LOINC 2.82 scoped to the Universal Lab Orders ValueSet.
|
||||||
|
Used as Observation.code in bd-lab-panel-observation."
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-loinc-lab-panels-valueset"
|
||||||
|
* ^status = #draft
|
||||||
|
* ^experimental = true
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.name = "DGHS Health Information Unit"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^copyright = "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use."
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system http://loinc.org
|
||||||
|
where concept in "https://fhir.dghs.gov.bd/core/ValueSet/loinc-lab-panels"
|
||||||
22
input/fsh/valueSets/BDLoincLabResultsVS.fsh
Normal file
22
input/fsh/valueSets/BDLoincLabResultsVS.fsh
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
ValueSet: BDLoincLabResultsVS
|
||||||
|
Id: bd-loinc-lab-results-valueset
|
||||||
|
Title: "Bangladesh LOINC Lab Results ValueSet"
|
||||||
|
Description: "LOINC leaf-level laboratory result codes for Bangladesh. Includes
|
||||||
|
individual component/result codes from LOINC 2.82 scoped to the Universal Lab Orders
|
||||||
|
ValueSet. Excludes discouraged and non-laboratory codes. Used as Observation.code
|
||||||
|
in bd-lab-result-observation."
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-loinc-lab-results-valueset"
|
||||||
|
* ^status = #draft
|
||||||
|
* ^experimental = true
|
||||||
|
* ^version = "0.1.0"
|
||||||
|
* ^publisher = "Directorate General of Health Services (DGHS), MoHFW, Bangladesh"
|
||||||
|
* ^contact.name = "DGHS Health Information Unit"
|
||||||
|
* ^contact.telecom.system = #url
|
||||||
|
* ^contact.telecom.value = "https://dghs.gov.bd"
|
||||||
|
* ^jurisdiction = urn:iso:std:iso:3166#BD "Bangladesh"
|
||||||
|
* ^copyright = "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use."
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system http://loinc.org
|
||||||
|
where concept in "https://fhir.dghs.gov.bd/core/ValueSet/loinc-lab-results"
|
||||||
36
input/fsh/valueSets/BDMedicationDoseFormVS.fsh
Normal file
36
input/fsh/valueSets/BDMedicationDoseFormVS.fsh
Normal file
@@ -0,0 +1,36 @@
|
|||||||
|
ValueSet: BDMedicationDoseFormVS
|
||||||
|
Id: bd-medication-dose-form
|
||||||
|
Title: "Medication Dose Form Value Set"
|
||||||
|
Description: """
|
||||||
|
Value set containing pharmaceutical dose form concepts from the European
|
||||||
|
Directorate for the Quality of Medicines (EDQM) Standard Terms, domain:
|
||||||
|
Pharmaceutical Dose Forms (PDF).
|
||||||
|
|
||||||
|
This value set is used to code the physical form of a medication product
|
||||||
|
in BDMedication.form. EDQM Standard Terms are maintained and versioned
|
||||||
|
by the Council of Europe and are the WHO-recommended international standard
|
||||||
|
for pharmaceutical dose form coding.
|
||||||
|
|
||||||
|
Concepts are loaded into the national OCL terminology server at
|
||||||
|
https://tr.ocl.dghs.gov.bd under the MoHFW organisation as source EDQM-PDF.
|
||||||
|
|
||||||
|
**Binding:** preferred on BDMedication.form — systems should use EDQM
|
||||||
|
codes when populating dose form, but omission is permitted. A mapping from
|
||||||
|
DGDA plain text dose forms to EDQM codes is planned for a future IG version.
|
||||||
|
|
||||||
|
**Code system canonical:** https://standardterms.edqm.eu
|
||||||
|
**OCL source:** https://tr.ocl.dghs.gov.bd/#/orgs/MoHFW/sources/EDQM-PDF/
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/edqm-dose-forms"
|
||||||
|
* ^version = "1.0.0"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "DGHS Health Informatics Unit"
|
||||||
|
* ^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"
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system https://standardterms.edqm.eu
|
||||||
31
input/fsh/valueSets/BDRouteOfAdministrationVS.fsh
Normal file
31
input/fsh/valueSets/BDRouteOfAdministrationVS.fsh
Normal file
@@ -0,0 +1,31 @@
|
|||||||
|
ValueSet: BDRouteOfAdministrationVS
|
||||||
|
Id: bd-route-of-administration
|
||||||
|
Title: "Route of Administration Value Set"
|
||||||
|
Description: """
|
||||||
|
Value set containing route of administration concepts from the HL7 Version 3
|
||||||
|
RouteOfAdministration code system.
|
||||||
|
|
||||||
|
This value set is used to code the route by which a medication is administered
|
||||||
|
in MedicationRequest.dosageInstruction.route. HL7 v3 RouteOfAdministration
|
||||||
|
is a license-free, internationally recognised vocabulary already embedded in
|
||||||
|
the FHIR ecosystem.
|
||||||
|
|
||||||
|
Concepts are loaded into the national OCL terminology server at
|
||||||
|
https://tr.ocl.dghs.gov.bd under the MoHFW organisation.
|
||||||
|
|
||||||
|
**Code system canonical:** http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration
|
||||||
|
**Binding:** required on BDMedicationRequest.dosageInstruction.route
|
||||||
|
"""
|
||||||
|
|
||||||
|
* ^url = "https://fhir.dghs.gov.bd/core/ValueSet/bd-route-of-administration"
|
||||||
|
* ^version = "1.0.0"
|
||||||
|
* ^status = #active
|
||||||
|
* ^experimental = false
|
||||||
|
* ^publisher = "DGHS Health Informatics Unit"
|
||||||
|
* ^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"
|
||||||
|
* ^immutable = false
|
||||||
|
|
||||||
|
* include codes from system http://terminology.hl7.org/CodeSystem/v3-RouteOfAdministration
|
||||||
79
input/package-list.json
Normal file
79
input/package-list.json
Normal file
@@ -0,0 +1,79 @@
|
|||||||
|
{
|
||||||
|
"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.4.0",
|
||||||
|
"date": "2026-04-06",
|
||||||
|
"desc": "DGDA Drug and LOINC Integration",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.4.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.3.0",
|
||||||
|
"date": "2026-03-08",
|
||||||
|
"desc": "ICD-11 MMS integration and minor bug fixes",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.3.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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.
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
<?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>
|
|
||||||
@@ -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"
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"package-id": "bd.fhir.core",
|
"package-id": "bd.fhir.core",
|
||||||
"title": "Bangladesh Core FHIR Implementation Guide",
|
"title": "Bangladesh Core FHIR Implementation Guide",
|
||||||
"canonical": "https://fhir.dghs.gov.bd/core/",
|
"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.",
|
"introduction": "The Bangladesh Core FHIR IG defines national base profiles, value sets, and extensions for health data interoperability.",
|
||||||
"list": [
|
"list": [
|
||||||
{
|
{
|
||||||
@@ -10,6 +10,62 @@
|
|||||||
"path": "https://fhir.dghs.gov.bd/core/",
|
"path": "https://fhir.dghs.gov.bd/core/",
|
||||||
"status": "ci-build",
|
"status": "ci-build",
|
||||||
"current": true
|
"current": true
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.4.0",
|
||||||
|
"date": "2026-04-06",
|
||||||
|
"desc": "DGDA Drug and LOINC Integration",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.4.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"version": "0.3.0",
|
||||||
|
"date": "2026-03-08",
|
||||||
|
"desc": "ICD-11 MMS integration and minor bug fixes",
|
||||||
|
"path": "https://fhir.dghs.gov.bd/core/0.3.0/",
|
||||||
|
"status": "trial-use",
|
||||||
|
"sequence": "STU 1"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"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",
|
"version": "0.2.0",
|
||||||
|
|||||||
@@ -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