AgentSkillsCN

fix-ig-export-links

修复已下载的MII肿瘤学实施指南导出文件中损坏的Simplifier解析链接。当从Simplifier下载IG时链接损坏、准备IG导出以供离线使用,或使链接在本地和官方MII页面上都能正常工作时使用。处理MII Onko个人资料/ValueSets/CodeSystems、FHIR R4核心链接、MII依赖模块、德国基础个人资料以及artifacts/package/路径。

SKILL.md
--- frontmatter
name: fix-ig-export-links
description: Fix broken Simplifier resolve links in downloaded MII Onkologie Implementation Guide exports. Use when downloading an IG from Simplifier and links are broken, preparing an IG export for offline use, or making links work both locally and on the official MII page. Handles MII Onko profiles/ValueSets/CodeSystems, FHIR R4 core links, MII dependency modules, German base profiles, and artifacts/package/ paths.

Fix IG Export Links

Fix broken /resolve? links in Simplifier IG exports to work offline and on official MII pages.

Link Categories and Targets

CategorySource PatternTarget
MII Onko Canonical/resolve?&scope=...onkologie...&canonical=https://...modul-onko/...https://simplifier.net/resolve?canonical=...&fhirVersion=R4
FHIR R4 Base (Basis column)/resolve?&scope=...&canonical=http://hl7.org/fhir/StructureDefinition/...https://hl7.org/fhir/R4/....html
FHIR R4 Core (filepath)simplifier.net/resolve?...hl7.fhir.r4.core...filepath=...https://hl7.org/fhir/R4/...
HL7 Terminology (THO)simplifier.net/resolve?...hl7.terminology.r4...https://terminology.hl7.org/...
German base profilessimplifier.net/resolve?...de.basisprofil.r4...https://simplifier.net/packages/de.basisprofil.r4/.../files/...
de.fhir.medicationsimplifier.net/resolve?...de.fhir.medication...https://simplifier.net/packages/de.fhir.medication/.../files/...
MII Base Modulesimplifier.net/resolve?...kerndatensatz.base...https://simplifier.net/packages/.../files/...
MII Medikationsimplifier.net/resolve?...kerndatensatz.medikation...https://simplifier.net/packages/.../files/...
MII MolGensimplifier.net/resolve?...kerndatensatz.molgen...https://simplifier.net/packages/.../files/...
MII Core Canonical/resolve?...canonical=https://...core/modul-diagnose/...https://simplifier.net/resolve?canonical=...&fhirVersion=R4
Internal Profilesartifacts/package/StructureDefinition-mii-pr-onko-*.jsonLocal HTML page
Internal ValueSetsartifacts/package/ValueSet-mii-vs-onko-*.jsonhttps://simplifier.net/resolve?canonical=...&fhirVersion=R4
Internal CodeSystemsartifacts/package/CodeSystem-mii-cs-onko-*.jsonhttps://simplifier.net/resolve?canonical=...&fhirVersion=R4
Internal Extensionsartifacts/package/StructureDefinition-mii-ex-onko-*.jsonhttps://simplifier.net/resolve?canonical=...&fhirVersion=R4
Old guide URLsmii-ig-modul-onkologie-2024-deUpdated guide URL
.page.md broken link*.page.mdCorrect HTML page

Procedure

  1. Download and extract the IG ZIP from Simplifier to a working directory
  2. Navigate to the extracted directory containing HTML files
  3. Run the fix script:
    bash
    cd /path/to/extracted-ig
    bash /path/to/fix-links.sh
    
  4. Verify remaining resolve links (should only be intentional Simplifier links):
    bash
    grep -c "resolve?" *.html | grep -v ":0$"
    

Script Location

The fix script is located at: .claude/skills/fix-ig-export-links/scripts/fix-links.sh

Technical Notes

HTML Encoding Variants

The script handles two encoding patterns:

  • Single-quoted href with &: Used in FQL canonical box tables (href='...')
  • Double-quoted href with &: Used elsewhere (href="...")

Link Pattern Types

  • ?canonical=: Links to profile canonical URLs (should resolve via Simplifier)
  • ?filepath=: Links to package files (should resolve to official spec URLs or Simplifier packages)

ValueSet and CodeSystem Handling

Unlike simpler IGs, Onkologie defines ~97 ValueSets and ~43 CodeSystems that are referenced in binding tables. These are transformed to Simplifier resolve links with the canonical URL pattern:

code
https://simplifier.net/resolve?canonical=https://www.medizininformatik-initiative.de/fhir/ext/modul-onko/ValueSet/{id}&fhirVersion=R4

Expected Remaining Links

After running the script, these Simplifier resolve links are intentional:

  • MII Onko profile/ValueSet/CodeSystem canonical URLs -> https://simplifier.net/resolve?canonical=...&fhirVersion=R4
  • CapabilityStatement canonical -> remains as Simplifier resolve

Example Usage

bash
# Extract the downloaded IG
unzip "MII-IG-Onkologie-DE-v2026@current.zip" -d ig-export

# Run the fix script
cd ig-export
bash ~/.claude/skills/fix-ig-export-links/scripts/fix-links.sh

# Verify - count should show only intentional Simplifier links
grep -o "simplifier.net/resolve" *.html | wc -l

# Check a specific high-traffic page
grep "resolve?" MIIIGModulOnkologie-TechnischeImplementierung-FHIR-Profile-Diagnose-Diagnose-Condition.html | head -5

Package Information

  • Package Name: de.medizininformatikinitiative.kerndatensatz.onkologie
  • Current Version: 2026.0.0
  • Canonical Base: https://www.medizininformatik-initiative.de/fhir/ext/modul-onko
  • Guide Name: mii-ig-modul-onkologie-v2026-de

Dependencies Handled

PackageVersionLink Target
hl7.fhir.r4.core4.0.1hl7.org/fhir/R4/
hl7.terminology.r47.0.0terminology.hl7.org/
de.basisprofil.r41.5.4Simplifier packages
de.fhir.medication1.0.3Simplifier packages
de.medizininformatikinitiative.kerndatensatz.base2026.0.0Simplifier packages
de.medizininformatikinitiative.kerndatensatz.medikation2026.0.0Simplifier packages
de.medizininformatikinitiative.kerndatensatz.molgen2026.0.4Simplifier packages