Branded UI Fixed

This commit is contained in:
2025-09-28 04:32:17 +00:00
parent 0f0087d756
commit 3c281adb2c
193 changed files with 19151 additions and 0 deletions

Binary file not shown.

View File

@@ -0,0 +1,4 @@
{
"index-version" : 2,
"files" : []
}

View File

@@ -0,0 +1,192 @@
<?xml version="1.0" encoding="UTF-8"?>
<project name="ProcessIg">
<property name="folder.input" value="input"/>
<target name="onLoad.findSpreadsheets">
<!-- Look in all input folders that might contain spreadsheets and capture the list of spreadsheet XML files as a property -->
<fileset id="spreadsheet.contents.id" dir="${ig.root}">
<include name="${folder.input}/examples/*spreadsheet.xml"/>
<include name="${folder.input}/extensions/*spreadsheet.xml"/>
<include name="${folder.input}/models/*spreadsheet.xml"/>
<include name="${folder.input}/profiles/*spreadsheet.xml"/>
<include name="${folder.input}/resources/*spreadsheet.xml"/>
<include name="${folder.input}/structures/*spreadsheet.xml"/>
<include name="${folder.input}/vocabulary/*spreadsheet.xml"/>
</fileset>
<property name="prop.spreadsheet.contents" refid="spreadsheet.contents.id"/>
</target>
<target name="onLoad.updateIg" depends="onLoad.findSpreadsheets">
<!-- Supplement the IG file with various standard configuration files, as well as with a list of any found spreadsheets (if they're not already enumerated) -->
<xslt in="${onLoad.ig.source}xml" out="${onLoad.ig.dest}xml" style="${ig.scripts}/onLoad.xslt">
<param name="spreadsheetList" expression="${prop.spreadsheet.contents}"/>
</xslt>
</target>
<extension-point name="onLoad.extend" depends="onLoad.updateIg"/>
<target name="onLoad" depends="onLoad.extend">
<concat destfile="${ig.template}/onLoad-validation.json" encoding="UTF-8" outputencoding="UTF-8">
<header>{"resourceType":"OperationOutcome","issue":[&#x0a;
</header>
<footer>]}&#x0a;
</footer>
<filterchain>
<tailfilter lines="-1" skip="1"/>
</filterchain>
<fileset dir="${ig.template}" includes="onLoad-validation*.json"/>
</concat>
</target>
<macrodef name="getSchemas">
<attribute name="version"/>
<attribute name="url"/>
<sequential>
<mkdir dir="${dir.schemas}/@{version}"/>
<get src="@{url}fhir-single.xsd" dest="${dir.schemas}/@{version}" usetimestamp="true" ignoreerrors="true"/>
<get src="@{url}fhir-xhtml.xsd" dest="${dir.schemas}/@{version}" usetimestamp="true" ignoreerrors="true"/>
<get src="@{url}xml.xsd" dest="${dir.schemas}/@{version}" usetimestamp="true" ignoreerrors="true"/>
<get src="@{url}xmldsig-core-schema.xsd" dest="${dir.schemas}/@{version}" usetimestamp="true" ignoreerrors="true"/>
</sequential>
</macrodef>
<target name="onGenerate.checkVersions">
<xslt in="${onGenerate.ig.source}xml" out="${ig.template}/versions.txt" style="${ig.scripts}/onGenerate.getVersions.xslt"/>
<loadproperties srcfile="${ig.template}/versions.txt"/>
<condition property="dir.schemas" value="${ig.root}/../schemas" else="${ig.root}/input-cache/schemas">
<available file="${ig.root}/../schemas" type="dir"/>
</condition>
<mkdir dir="${dir.schemas}"/>
</target>
<target name="onGenerate.data">
<xslt in="${onGenerate.ig.source}xml" out="${ig.temp}/_data/artifacts.json" style="${ig.scripts}/onGenerate.data.xslt"/>
</target>
<target name="onGenerate.r5-schemas" depends="onGenerate.checkVersions" if="R5">
<getSchemas version="R5" url="http://build.fhir.org/"/>
</target>
<target name="onGenerate.r4-schemas" depends="onGenerate.checkVersions" if="R4">
<getSchemas version="R4" url="http://hl7.org/fhir/R4/"/>
</target>
<target name="onGenerate.r3-schemas" depends="onGenerate.checkVersions" if="R3">
<getSchemas version="R3" url="http://hl7.org/fhir/STU3/"/>
</target>
<target name="onGenerate.r2b-schemas" depends="onGenerate.checkVersions" if="R2B">
<getSchemas version="R2B" url="http://hl7.org/fhir/2016May/"/>
</target>
<target name="onGenerate.r2-schemas" depends="onGenerate.checkVersions" if="R2">
<getSchemas version="R2" url="http://hl7.org/fhir/DSTU2/"/>
</target>
<target name="onGenerate.schemas" depends="onGenerate.r5-schemas,onGenerate.r4-schemas,onGenerate.r3-schemas,onGenerate.r2b-schemas,onGenerate.r2-schemas"/>
<target name="onGenerate.setup">
<property name="dir.input" value="${ig.root}/${folder.input}"/>
<property name="dir.temp.includes" value="${ig.temp}/_includes" relative="yes"/>
<property name="dir.template.includes" value="${ig.template}/includes" relative="yes"/>
<loadfile property="groupings" srcFile="${ig.scripts}/groupings.txt" encoding="UTF-8"/>
</target>
<target name="check-plantumlfiles">
<condition property="ig.plantumlfiles.exist">
<and>
<available type="dir" file="${basedir}/${folder.input}/images-source"/>
<resourcecount when="greater" count="0">
<fileset file="${basedir}/${folder.input}/images-source/**.plantuml"/>
</resourcecount>
</and>
</condition>
<condition property="template.plantumlfiles.exist">
<and>
<available type="dir" file="${ig.template}/images-source"/>
<resourcecount when="greater" count="0">
<fileset file="${ig.template}/images-source/**.plantuml"/>
</resourcecount>
</and>
</condition>
</target>
<target name="onGenerate.plantUml.ig" depends="check-plantumlfiles" if="ig.plantumlfiles.exist">
<java jar="${ig.scripts}/plantuml.jar" fork="true" failonerror="true">
<jvmarg line="-Dfile.encoding=UTF-8"/>
<arg line="-nometadata -failfast2 -tsvg -o &quot;${basedir}/${dir.temp.includes}&quot; &quot;${basedir}/${folder.input}/images-source/**.plantuml&quot;"/>
</java>
</target>
<target name="onGenerate.plantUml.template" depends="check-plantumlfiles" if="template.plantumlfiles.exist">
<java jar="${ig.scripts}/plantuml.jar" fork="true" failonerror="true">
<jvmarg line="-Dfile.encoding=UTF-8"/>
<arg line="-nometadata -failfast2 -tsvg -o &quot;${basedir}/${dir.temp.includes}&quot; &quot;${ig.template}/images-source/**.plantuml&quot;"/>
</java>
</target>
<target name="onGenerate.plantUml" depends="onGenerate.plantUml.ig,onGenerate.plantUml.template"/>
<target name="onGenerate.infoFile" depends="onGenerate.setup">
<xslt in="${onGenerate.ig.source}xml" out="${ig.temp}/_data/info.json" style="${ig.scripts}/onGenerate.genJson.xslt"/>
</target>
<target name="onGenerate.processIg">
<xslt in="${onGenerate.ig.source}xml" out="${onGenerate.ig.source}1.xml" style="${ig.scripts}/onGenerate.group.xslt"/>
<replace file="${onGenerate.ig.source}1.xml" token="&lt;!--TEMPLATE_GROUPS_HERE--&gt;" value="${groupings}"/>
<xslt in="${onGenerate.ig.source}1.xml" out="${onGenerate.ig.source}2.xml" style="${ig.scripts}/onGenerate.groupSort.xslt"/>
<xslt in="${onGenerate.ig.source}2.xml" out="${onGenerate.ig.dest}xml" style="${ig.scripts}/onGenerate.final.xslt"/>
</target>
<target name="onGenerate.processIncludes" depends="onGenerate.setup">
<copy todir="${dir.temp.includes}">
<fileset dir="${dir.template.includes}" includes="*"/>
</copy>
</target>
<target name="onGenerate.igQa" depends="onGenerate.processIg">
<xslt in="${onGenerate.ig.dest}xml" out="${ig.template}/ongenerate-validation-igqa.json" style="${ig.scripts}/onGenerate.qa.xslt"/>
</target>
<target name="onGenerate.artifactList" depends="onGenerate.checkVersions,onGenerate.igQa,onGenerate.setup">
<xslt in="${onGenerate.ig.dest}xml" out="${dir.temp.includes}/artifacts.xml" style="${ig.scripts}/createArtifactSummary.xslt">
<param name="globals" expression="${globals}"/>
</xslt>
<fileset id="onGenerate.artifacts.id" dir="${ig.root}">
<include name="${dir.temp.includes}/artifacts.xml"/>
<include name="${dir.temp.includes}/*.svg"/>
</fileset>
<property name="onGenerate.artifacts.files" refid="onGenerate.artifacts.id"/>
<property name="onGenerate.files" value="${onGenerate.artifacts.files}"/>
</target>
<extension-point name="onGenerate.extend" depends="onGenerate.schemas,onGenerate.data,onGenerate.infoFile,onGenerate.processIncludes,onGenerate.artifactList,onGenerate.plantUml, onGenerate.copyDataFiles"/>
<target name="onGenerate" depends="onGenerate.extend">
<!-- <resources id="onGenerate.files.id">
<fileset refid="onGenerate.artifacts.id"/>
</resources>
<property name="onGenerate.files" refid="onGenerate.files.id"/>-->
<echo file="${ig.template}/onGenerate-validation.json" message="{&quot;resourceType&quot;:&quot;OperationOutcome&quot;,&quot;issue&quot;:[&#x0a;"/>
<concat destfile="${ig.template}/onGenerate-validation.json" encoding="UTF-8" outputencoding="UTF-8" append="yes">
<fileset dir="${ig.template}" includes="ongenerate-validation*.json" />
<filterchain>
<tailfilter lines="-1" skip="0"/>
<!-- <tailfilter lines="-1" skip="1"/>-->
</filterchain>
</concat>
<echo file="${ig.template}/onGenerate-validation.json" message="]}&#x0a;" append="yes"/>
<replace file="${ig.template}/onGenerate-validation.json" token=",]}" value="]}"/>
</target>
<scriptdef name="appendArtifacts" language="javascript" description="Adds additional values to the to the onGenerate.files list">
<attribute name="files"/>
self.project.setProperty("onGenerate.files", self.project.getProperty("onGenerate.files").concat(";").concat(attributes.get("files")));
</scriptdef>
<target name="onGenerate.copyDataFiles">
<!-- Jekyll data files from IG (input/data) or from template -->
<copy todir="${ig.temp}/_data" failonerror="false">
<fileset dir="${ig.template}/data"/>
</copy>
<!-- input/data already works, no need to add (commenting out in case we need to revisit due to conflicts and overlaps ) -->
<!--
<copy todir="${ig.temp}/_data" failonerror="false">
<fileset dir="${dir.input}/data"/>
</copy>
-->
</target>
<extension-point name="onCheck.extend"/>
<target name="onCheck" depends="onCheck.extend">
<echo file="${ig.template}/onCheck-validation.json" message="{&quot;resourceType&quot;:&quot;OperationOutcome&quot;,&quot;issue&quot;:[&#x0a;"/>
<concat destfile="${ig.template}/onCheck-validation.json" encoding="UTF-8" outputencoding="UTF-8" append="yes">
<fileset dir="${ig.template}" includes="oncheck-validation*.json"/>
<fileset dir="${ig.template}" includes="**/*.oncheck-validation.json"/>
<filterchain>
<tailfilter lines="-1" skip="0"/>
</filterchain>
</concat>
<echo file="${ig.template}/onCheck-validation.json" message="]}&#x0a;" append="yes"/>
<replace file="${ig.template}/onCheck-validation.json" token=",]}" value="]}"/>
</target>
<scriptdef name="appendArtifacts" language="javascript" description="Adds additional values to the to the onGenerate.files list">
<attribute name="files"/>
self.project.setProperty("onGenerate.files", self.project.getProperty("onGenerate.files").concat(";").concat(attributes.get("files")));
</scriptdef>
</project>

View File

@@ -0,0 +1,118 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://hl7.org/fhir">
<xsl:output method="xml" encoding="utf-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:param name="columns" select="3"/>
<xsl:param name="version"/>
<xsl:param name="globals"/>
<xsl:template match="f:ImplementationGuide">
<!-- Include a note in the output with breadcrumbs back to this script -->
<xsl:comment>DO NOT EDIT THIS FILE - It is generated by https://github.com/HL7/ig-template-base/blob/master/scripts/createArtifactSummary.xslt and any changes made will be overwritten</xsl:comment>
<div class="markdown-toc">
<p>Contents:</p>
<ul>
<xsl:if test="$globals='Y'">
<li>
<a href="#globals">Globals</a>
</li>
</xsl:if>
<xsl:for-each select="f:definition/f:grouping">
<li>
<a href="#{position()}">
<xsl:value-of select="f:name/@value"/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
<div>
<p>This page provides a list of the FHIR artifacts defined as part of this implementation guide.</p>
<xsl:if test="$globals='Y'">
<a name="globals">
<xsl:value-of select="' '"/>
</a>
<h3>Global profiles</h3>
{% include globals-table.xhtml %}
</xsl:if>
<xsl:for-each select="f:definition/f:grouping">
<xsl:variable name="relevantResources">
<xsl:for-each select="f:resource[f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']][not(f:extension[@url='http://hl7.org/fhir/StructureDefinition/tools-alternateVersion'] or $version) or (f:extension[@url='http://hl7.org/fhir/StructureDefinition/tools-alternateVersion']/f:valueCode/@value=$version)]|
parent::f:definition/f:resource[f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']][f:package/@value=current()/@id or f:groupingId/@value=current()/@id][not(f:extension[@url='http://hl7.org/fhir/StructureDefinition/tools-alternateVersion'] or $version) or (f:extension[@url='http://hl7.org/fhir/StructureDefinition/tools-alternateVersion']/f:valueCode/@value=$version)]">content</xsl:for-each>
</xsl:variable>
<xsl:if test="$relevantResources">
<a name="{position()}">
<xsl:value-of select="' '"/>
</a>
<h3>
<xsl:value-of select="concat(f:name/@value, ' ')"/>
</h3>
<xsl:apply-templates select="."/>
</xsl:if>
</xsl:for-each>
</div>
</xsl:template>
<xsl:template match="f:grouping">
<xsl:text>{% capture grouping_desc %}</xsl:text>
<xsl:value-of select="f:description/@value" disable-output-escaping="no"/>
<xsl:text>{% endcapture %}
{{ grouping_desc | markdownify}}</xsl:text>
<xsl:variable name="showDescriptions" select="count(parent::f:definition/f:resource[f:groupingId/@value=current()/@id]/f:description/@value)!=0"/>
<table class="grid">
<col style="width:20%"/>
<tbody>
<xsl:for-each select="parent::f:definition/f:resource[f:groupingId/@value=current()/@id]">
<tr>
<td style="column-width:30%">
<a href="{f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']/f:valueUri/@value}" title="{f:reference/f:reference/@value}">
<!-- <xsl:text>&#160;&#160;&#x2022;&#160;&#160;</xsl:text>-->
<xsl:choose>
<xsl:when test="f:name">
<xsl:value-of select="f:name/@value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="f:reference/f:reference/@value"/>
</xsl:otherwise>
</xsl:choose>
</a>
</td>
<xsl:if test="$showDescriptions">
<td>
<xsl:text>{% capture desc %}</xsl:text>
<xsl:value-of select="f:description/@value" disable-output-escaping="no"/>
<xsl:text>{% endcapture %}
{{ desc | markdownify}}</xsl:text>
</td>
</xsl:if>
</tr>
</xsl:for-each>
</tbody>
</table>
</xsl:template>
<xsl:template match="f:grouping" mode="first">
<tr>
<xsl:apply-templates select=".|following-sibling::f:grouping[position() &lt; $columns]" mode="next"/>
<xsl:if test="count(following-sibling::f:grouping) &lt; ($columns - 1)">
<xsl:call-template name="emptycell">
<xsl:with-param name="cells" select="$columns - 1 - count(following-sibling::f:grouping)"/>
</xsl:call-template>
</xsl:if>
</tr>
<tr colspan="3">
<td>&#160;</td>
</tr>
</xsl:template>
<xsl:template match="f:grouping" mode="next">
<td style="column-width:30%">
<a href="{translate(concat('#',name/@value), ' ', '_')}">
<xsl:number/>. <xsl:value-of select="f:name/@value"/> &#160;&#160;&#160;&#9654;</a>
</td>
</xsl:template>
<xsl:template name="emptycell">
<xsl:param name="cells"/>
<td/>
<xsl:if test="$cells &gt; 1">
<xsl:call-template name="emptycell">
<xsl:with-param name="cells" select="$cells - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,112 @@
<grouping xmlns="http://hl7.org/fhir" id="-req-actordefinition">
<name value="Requirements: Actor Definitions"/>
<description value="The following artifacts define the types of individuals and/or systems that will interact as part of the use cases covered by this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-req-requirements">
<name value="Requirements: Formal Requirements"/>
<description value="The following artifacts describe the specific requirements to be met by systems compliant with the implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-dyn-capabilitystatement">
<name value="Behavior: Capability Statements"/>
<description value="The following artifacts define the specific capabilities that different types of systems are expected to have in order to comply with this implementation guide. Systems conforming to this implementation guide are expected to declare conformance to one or more of the following capability statements."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-dyn-operationdefinition">
<name value="Behavior: Operation Definitions"/>
<description value="These are custom operations that can be supported by and/or invoked by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-dyn-messagedefinition">
<name value="Behavior: Message Definitions"/>
<description value="These define the types of messages that can be sent and/or received by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-dyn-searchparameter">
<name value="Behavior: Search Parameters"/>
<description value="These define the properties by which a RESTful server can be searched. They can also be used for sorting and including related resources."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ka-activitydefinition">
<name value="Knowledge Artifacts: Activity Definitions"/>
<description value="These define activities that can be performed as part of content in this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ka-plandefinition">
<name value="Knowledge Artifacts: Plan Definitions"/>
<description value="These define workflows, rules, strategies, or protocols as part of content in this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ka-measure">
<name value="Knowledge Artifacts: Measure"/>
<description value="These define measures as part of content in this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ka-library">
<name value="Knowledge Artifacts: Libraries"/>
<description value="These define logic, asset collections and other libraries as part of content in this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-graphdefinition">
<name value="Structures: Graph Definitions"/>
<description value="These define collections of interrelated resources that are useful to pass around as a group."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-logicalmodel">
<name value="Structures: Logical Models"/>
<description value="These define data models that represent the domain covered by this implementation guide in more business-friendly terms than the underlying FHIR resources."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-questionnaire">
<name value="Structures: Questionnaires"/>
<description value="These define forms used by systems conforming to this implementation guide to capture or expose data to end users."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-abstractprofile">
<name value="Structures: Abstract Profiles"/>
<description value="These are profiles on resources or data types that describe patterns used by other profiles, but cannot be instantiated directly. I.e. instances can conform to profiles *based* on these abstract profiles but do not declare conformance to the abstract profiles themselves."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-profile">
<name value="Structures: Resource Profiles"/>
<description value="These define constraints on FHIR resources for systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-datatype">
<name value="Structures: Data Type Profiles"/>
<description value="These define constraints on FHIR data types for systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-str-extension">
<name value="Structures: Extension Definitions"/>
<description value="These define constraints on FHIR data types for systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-term-valueset">
<name value="Terminology: Value Sets"/>
<description value="These define sets of codes used by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-term-codesystem">
<name value="Terminology: Code Systems"/>
<description value="These define new code systems used by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-term-namingsystem">
<name value="Terminology: Naming Systems"/>
<description value="These define identifier and/or code system identities used by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-map-structuremap">
<name value="Terminology: Structure Maps"/>
<description value="These define transformations to convert between data structures used by systems conforming to this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-map-conceptmap">
<name value="Terminology: Concept Maps"/>
<description value="These define transformations to convert between codes by systems conforming with this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-test-testplan">
<name value="Testing Artifacts: TestPlans"/>
<description value="These test plans are available to verify test coverage for this implementation guide"/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-test-testscript">
<name value="Testing Artifacts: TestScripts"/>
<description value="These test definitions are available to FHIR test engines to verify systems are conforming to this implementation guide"/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ex-examplescenario">
<name value="Example: Example Scenarios"/>
<description value="These define groups of interrelated examples that demonstrate one or more of the workflows supported by this implementation guide."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ex-example">
<name value="Example: Example Instances"/>
<description value="These are example instances that show what data produced and consumed by systems conforming with this implementation guide might look like."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-ex-examplesup">
<name value="Example: Example Supporting Instances"/>
<description value="These are example instances that are not governed by this implementation guide, but which are necessary to support other examples defined in the IG."/>
</grouping>
<grouping xmlns="http://hl7.org/fhir" id="-other">
<name value="Other"/>
<description value="These are resources that are used within this implementation guide that do not fit into one of the other categories."/>
</grouping>

View File

@@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- A helper-transform that supports reporting issues.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://hl7.org/fhir" xmlns="http://hl7.org/fhir" exclude-result-prefixes="f">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template name="raiseError">
<xsl:param name="code"/>
<xsl:param name="details"/>
<xsl:param name="location"/>
<xsl:call-template name="raiseIssue">
<xsl:with-param name="severity">error</xsl:with-param>
<xsl:with-param name="code" select="$code"/>
<xsl:with-param name="details" select="$details"/>
<xsl:with-param name="location" select="$location"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="raiseWarning">
<xsl:param name="code"/>
<xsl:param name="details"/>
<xsl:param name="location"/>
<xsl:call-template name="raiseIssue">
<xsl:with-param name="severity">warning</xsl:with-param>
<xsl:with-param name="code" select="$code"/>
<xsl:with-param name="details" select="$details"/>
<xsl:with-param name="location" select="$location"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="raiseIssue">
<xsl:param name="severity"/>
<xsl:param name="code"/>
<xsl:param name="details"/>
<xsl:param name="location"/>
<xsl:text>&#xa;{"severity":"</xsl:text>
<xsl:value-of select="$severity"/>
<xsl:text>","code":"</xsl:text>
<xsl:value-of select="$code"/>
<xsl:text>","details":{"text":"</xsl:text>
<xsl:value-of select="$details"/>
<xsl:text>"},"location":["</xsl:text>
<xsl:value-of select="$location"/>
<xsl:text>"]}&#xa;,</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,31 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Spits out a data file containing information about each resource for use in rendering resource pages
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://hl7.org/fhir" xmlns="http://hl7.org/fhir" exclude-result-prefixes="f">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:variable name="baseUrl" select="substring-before(/f:ImplementationGuide/f:url/@value, 'ImplementationGuide')"/>
<xsl:template match="/f:ImplementationGuide">
<xsl:text>{</xsl:text>
<xsl:apply-templates select="f:definition/f:resource"/>
<xsl:text>}</xsl:text>
</xsl:template>
<xsl:template match="@*|node()"/>
<xsl:template match="f:definition/f:resource">
<xsl:variable name="type" select="substring-before(f:reference/f:reference/@value, '/')"/>
<xsl:variable name="id" select="f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']/f:valueUri/@value"/>
<xsl:if test="position()!=1">,</xsl:if>
<xsl:value-of select="concat('&quot;', $id, '&quot;:{&quot;type&quot;:&quot;', $type, '&quot;')"/>
<xsl:if test="f:exampleBoolean/@value='true' or f:exampleCanonical">
<xsl:text>,"example":true</xsl:text>
</xsl:if>
<xsl:for-each select="f:exampleCanonical">
<xsl:variable name="refId" select="substring-after(@value, $baseUrl)"/>
<xsl:for-each select="ancestor::f:ImplementationGuide/f:definition/f:resource[f:reference/f:reference/@value=$refId]">
<xsl:variable name="page" select="f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']/f:valueUri/@value"/>
<xsl:value-of select="concat(',&quot;exampleOf&quot;:{&quot;name&quot;:&quot;', f:name/@value, '&quot;,&quot;url&quot;:&quot;', $page, '&quot;}')"/>
</xsl:for-each>
</xsl:for-each>
<xsl:text>}</xsl:text>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,126 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- This is a cleanup script that does a few things:
- - ensures that the 'root' page is the generated "toc.xml" page
- - ensures that somewhere in the list of pages is the generated "artifacts.xml" page
- - places a list of all artifacts (ordered by order of table of contents) as pages beneath artifacts.xml
- - strips the igpublisher-spreadsheet extensions, if any
- If dealing with a multi-version IG, it will be run against both IG versions.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://hl7.org/fhir" exclude-result-prefixes="html f">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:variable name="noRootToc" select="/f:ImplementationGuide/f:definition/f:parameter[f:code/@value='noRootToc']/f:value/@value"/>
<xsl:variable name="artifactsOnRoot" select="/f:ImplementationGuide/f:definition/f:parameter[f:code/@value='artifactsOnRoot']/f:value/@value"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="f:extension[@url='http://hl7.org/fhir/StructureDefinition/igpublisher-spreadsheet']"/>
<xsl:template match="f:grouping">
<xsl:if test="parent::f:definition/f:resource/f:groupingId[@value=current()/@id]">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:template>
<xsl:template match="f:definition">
<!-- If we've defined the groups, then we sort based on the groups, then alphabetically -->
<xsl:choose>
<xsl:when test="f:grouping[starts-with(@id, '-')] or groups/f:grouping[starts-with(@id, '-')]">
<xsl:copy>
<xsl:apply-templates select="node()[not(self::f:resource or self::f:page or self::f:parameter or self::f:template)]"/>
<xsl:for-each select="f:grouping">
<xsl:choose>
<xsl:when test="starts-with(@id, '-')">
<xsl:for-each select="parent::f:definition/f:resource[f:groupingId/@value=current()/@id]">
<xsl:sort select="f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/resource-sort']/f:valueInteger/@value"/>
<xsl:sort select="f:name/@value"/>
<xsl:sort select="f:reference/f:reference/@value"/>
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:for-each select="parent::f:definition/f:resource[f:groupingId/@value=current()/@id]">
<xsl:apply-templates select="."/>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<xsl:apply-templates select="f:resource[not(f:groupingId)]"/>
<xsl:apply-templates select="f:page|f:parameter|f:template"/>
</xsl:copy>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="f:ImplementationGuide/f:definition/f:page">
<xsl:copy>
<xsl:choose>
<xsl:when test="$noRootToc='true' or (f:nameUrl/@value='toc.html' and f:generation/@value='html')">
<xsl:apply-templates select="@*|node()"/>
</xsl:when>
<xsl:otherwise>
<nameUrl xmlns="http://hl7.org/fhir" value="toc.html"/>
<title xmlns="http://hl7.org/fhir" value="Table of Contents"/>
<generation xmlns="http://hl7.org/fhir" value="html"/>
<page xmlns="http://hl7.org/fhir">
<xsl:apply-templates select="@*|node()[not(self::f:page)]"/>
</page>
<xsl:apply-templates select="f:page"/>
</xsl:otherwise>
</xsl:choose>
<xsl:choose>
<xsl:when test="$artifactsOnRoot='true'">
<xsl:call-template name="artifactPages"/>
</xsl:when>
<xsl:otherwise>
<xsl:if test="not(descendant-or-self::f:page[f:nameUrl/@value='artifacts.html'])">
<page xmlns="http://hl7.org/fhir">
<nameUrl value="artifacts.html"/>
<title value="Artifacts Summary"/>
<generation value="html"/>
<xsl:call-template name="artifactPages"/>
</page>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
<xsl:template match="f:page[f:nameUrl/@value='artifacts.html']">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
<xsl:if test="not($artifactsOnRoot='true')">
<xsl:call-template name="artifactPages"/>
</xsl:if>
</xsl:copy>
</xsl:template>
<xsl:template name="artifactPages">
<xsl:for-each select="/f:ImplementationGuide/f:definition/f:grouping">
<xsl:if test="not(following-sibling::f:grouping[@id=current()/@id])">
<xsl:for-each select="parent::f:definition/f:resource[f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']][f:groupingId/@value=current()/@id]">
<xsl:variable name="id" select="substring-after(f:reference/f:reference/@value, '/')"/>
<page xmlns="http://hl7.org/fhir">
<nameUrl value="{f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']/f:valueUri/@value}"/>
<title value="{f:name/@value}"/>
<generation value="generated"/>
<xsl:for-each select="f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/contained-resource-information']">
<page xmlns="http://hl7.org/fhir">
<xsl:variable name="url" select="concat(f:extension[@url='type']/f:valueCode/@value, '-', $id, '_', f:extension[@url='id']/f:valueId/@value, '.html')"/>
<nameUrl value="{$url}"/>
<xsl:for-each select="f:extension[@url='title']/f:valueString">
<title value="{@value}"/>
</xsl:for-each>
<generation value="generated"/>
</page>
</xsl:for-each>
</page>
</xsl:for-each>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,101 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:f="http://hl7.org/fhir" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="f:ImplementationGuide">
<xsl:variable name="releaselabel">
<xsl:call-template name="getParameter">
<xsl:with-param name="name">releaselabel</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($releaselabel)">
<xsl:message terminate="yes">IG must include a definition parameter with a code of 'releaselabel'. Value can be 'CI build' or some other status.</xsl:message>
</xsl:if>
<xsl:variable name="copyrightyear">
<xsl:call-template name="getParameter">
<xsl:with-param name="name">copyrightyear</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:if test="not($copyrightyear)">
<xsl:message terminate="yes">IG must include a definition parameter with a code of 'copyrightyear'. Value can be '2020+' or some similar value.</xsl:message>
</xsl:if>
<xsl:variable name="excludexml">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'excludexml'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="excludejson">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'excludejson'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="excludettl">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'excludettl'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="excludelogbinaryformat">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'excludelogbinaryformat'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="excludemap">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'excludemap'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="shownav">
<xsl:call-template name="getBoolean">
<xsl:with-param name="property" select="'shownav'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fcp">
<xsl:call-template name="getParameter">
<xsl:with-param name="name" select="'fcp-approved-specification'"/>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="fmm">
<xsl:call-template name="getParameter">
<xsl:with-param name="name" select="'fmm-definition'"/>
</xsl:call-template>
</xsl:variable>
<xsl:value-of select="concat('{&#xa;',
' &quot;releaselabel&quot;:&quot;', $releaselabel, '&quot;,&#xa;',
' &quot;copyrightyear&quot;:&quot;', $copyrightyear, '&quot;,&#xa;',
' &quot;shownav&quot;:&quot;', $shownav, '&quot;,&#xa;',
' &quot;excludexml&quot;:&quot;', $excludexml, '&quot;,&#xa;',
' &quot;excludejson&quot;:&quot;', $excludejson, '&quot;,&#xa;',
' &quot;excludettl&quot;:&quot;', $excludettl, '&quot;,&#xa;',
' &quot;excludelogbinaryformat&quot;:&quot;', $excludelogbinaryformat, '&quot;,&#xa;',
' &quot;excludemap&quot;:&quot;', $excludemap, '&quot;,&#xa;',
' &quot;fcpspec&quot;:&quot;', $fcp, '&quot;,&#xa;',
' &quot;fmm-definition&quot;:&quot;', $fmm, '&quot;&#xa;}')"/>
</xsl:template>
<xsl:template name="getParameter">
<xsl:param name="name"/>
<xsl:choose>
<xsl:when test="f:definition/f:parameter[f:code/@value=$name]">
<xsl:value-of select="f:definition/f:parameter[f:code/@value=$name]/f:value/@value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="f:definition/f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/ig-parameter'][f:extension[@url='code']/f:valueString/@value=$name]/f:extension[@url='value']/f:valueString/@value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="getBoolean">
<xsl:param name="property"/>
<xsl:variable name="boolean">
<xsl:call-template name="getParameter">
<xsl:with-param name="name" select="$property"/>
</xsl:call-template>
</xsl:variable>
<xsl:choose>
<xsl:when test="starts-with(translate($boolean, 'y', 'Y'), 'Y') or starts-with(translate($boolean, 't', 'T'), 'T')">y</xsl:when>
<xsl:when test="$boolean='' or starts-with(translate($boolean, 'n', 'N'), 'N') or starts-with(translate($boolean, 'f', 'F'), 'F')">N</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
<xsl:value-of select="concat('Unrecognized value ' + $boolean, ' for parameter ' + $property + ' - should have been Y if present')"/>
</xsl:message>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,13 @@
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:f="http://hl7.org/fhir" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:template match="f:ImplementationGuide">
<xsl:text>R5=Y&#xa;</xsl:text>
<xsl:if test="f:fhirVersion/@value[starts-with(., '4.')]">R4=Y&#xa;</xsl:if>
<xsl:if test="f:fhirVersion/@value[starts-with(., '3.')]">R3=Y&#xa;</xsl:if>
<xsl:if test="f:fhirVersion/@value[starts-with(., '1.4')]">R2B=Y&#xa;</xsl:if>
<xsl:if test="f:fhirVersion/@value[starts-with(., '1.0')]">R2=Y&#xa;</xsl:if>
<xsl:value-of select="concat('igVersion=', f:version/@value, '&#xa;')"/>
<xsl:if test="f:definition/f:parameter[f:code/@value='globals-in-artifacts']/f:value/@value='true'">globals=Y</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,94 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- This script ensures that all artifacts are assigned to a 'grouping' and, when necessary, defines additional groupings to hold un-grouped artifacts
- when dealing with a multi-version IG, it will be run against both IG versions.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://hl7.org/fhir" exclude-result-prefixes="html f">
<xsl:output method="xml" version="1.0" encoding="UTF-8"/>
<xsl:variable name="mode">
<xsl:choose>
<xsl:when test="not(f:definition/f:grouping[not(contains(@id, 'spreadsheet.xml'))])">allgroups</xsl:when>
<xsl:when test="f:resource[not(f:groupingId)]">defaultgroup</xsl:when>
<xsl:otherwise>noaction</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/f:ImplementationGuide">
<xsl:choose>
<xsl:when test="$mode='noaction'">
<xsl:copy-of select="."/>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="f:definition">
<xsl:copy>
<xsl:apply-templates select="@*|f:id|f:extension|f:modifierExtension|f:grouping|comment()[not(preceding-sibling::f:resource|preceding-sibling::f:page)]"/>
<!-- This is a placeholder that will be replaced with the list of groups from this template. (We use a separate file so they're easier to override/translate.) -->
<groups xmlns="http://hl7.org/fhir">
<xsl:comment>TEMPLATE_GROUPS_HERE</xsl:comment>
</groups>
<xsl:apply-templates select="f:resource|f:page|f:parameter|f:template|comment()[preceding-sibling::f:resource|preceding-sibling::f:page]"/>
</xsl:copy>
</xsl:template>
<xsl:template match="f:resource">
<xsl:copy>
<xsl:apply-templates select="@*"/>
<xsl:if test="not(f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/resource-sort'])">
<extension xmlns="http://hl7.org/fhir" url="http://hl7.org/fhir/tools/StructureDefinition/resource-sort">
<valueInteger value="999999999"/>
</extension>
</xsl:if>
<xsl:apply-templates select="node()[not(self::f:groupingId)]"/>
<xsl:choose>
<xsl:when test="f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page'] and (not(f:groupingId) or contains(f:groupingId/@value, 'spreadsheet.xml'))">
<xsl:variable name="infoExt" select="f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/resource-information']/f:valueString/@value"/>
<xsl:variable name="groupingId">
<xsl:choose>
<xsl:when test="$mode='defaultgroup'">-other</xsl:when>
<xsl:when test="f:exampleBoolean/@value='true' or f:exampleCanonical">-ex-example</xsl:when>
<xsl:when test="$infoExt='ActorDefinition'">-req-actordefinition</xsl:when>
<xsl:when test="$infoExt='Requirements'">-req-requirements</xsl:when>
<xsl:when test="$infoExt='CapabilityStatement'">-dyn-capabilitystatement</xsl:when>
<xsl:when test="$infoExt='OperationDefinition'">-dyn-operationdefinition</xsl:when>
<xsl:when test="$infoExt='MessageDefinition'">-dyn-messagedefinition</xsl:when>
<xsl:when test="$infoExt='SearchParameter'">-dyn-searchparameter</xsl:when>
<xsl:when test="$infoExt='ActivityDefinition'">-ka-activitydefinition</xsl:when>
<xsl:when test="$infoExt='Measure'">-ka-measure</xsl:when>
<xsl:when test="$infoExt='PlanDefinition'">-ka-plandefinition</xsl:when>
<xsl:when test="$infoExt='Library'">-ka-library</xsl:when>
<xsl:when test="$infoExt='GraphDefinition'">-str-graphdefinition</xsl:when>
<xsl:when test="starts-with($infoExt,'StructureDefinition:logical')">-str-logicalmodel</xsl:when>
<xsl:when test="$infoExt='Questionnaire'">-str-questionnaire</xsl:when>
<xsl:when test="$infoExt='StructureDefinition:resource:abstract' or $infoExt='StructureDefinition:primitive-type:abstract' or $infoExt='StructureDefinition:complex-type:abstract'">-str-abstractprofile</xsl:when>
<xsl:when test="$infoExt='StructureDefinition:resource'">-str-profile</xsl:when>
<xsl:when test="$infoExt='StructureDefinition:primitive-type' or $infoExt='StructureDefinition:complex-type'">-str-datatype</xsl:when>
<xsl:when test="$infoExt='StructureDefinition:extension'">-str-extension</xsl:when>
<xsl:when test="$infoExt='ValueSet'">-term-valueset</xsl:when>
<xsl:when test="$infoExt='CodeSystem'">-term-codesystem</xsl:when>
<xsl:when test="$infoExt='NamingSystem'">-term-namingsystem</xsl:when>
<xsl:when test="$infoExt='StructureMap'">-map-structuremap</xsl:when>
<xsl:when test="$infoExt='ConceptMap'">-map-conceptmap</xsl:when>
<xsl:when test="$infoExt='ExampleScenario'">-ex-examplescenario</xsl:when>
<xsl:when test="$infoExt='TestPlan'">-test-testplan</xsl:when>
<xsl:when test="$infoExt='TestScript'">-test-testscript</xsl:when>
<xsl:otherwise>-other</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<groupingId xmlns="http://hl7.org/fhir" value="{$groupingId}"/>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="f:groupingId"/>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,73 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Integrate the 'default' groupings with any custom groupings, sorting ones that start with '-' to intermix with other 'standard' groupings
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns:f="http://hl7.org/fhir" exclude-result-prefixes="f">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes" omit-xml-declaration="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="f:definition">
<xsl:copy>
<xsl:apply-templates select="@*|f:extension|f:modifierExtension"/>
<xsl:call-template name="doGroupings"/>
<xsl:apply-templates select="node()[not(self::f:extension or self::f:modifierExtension or self::f:grouping or self::f:groups)]"/>
</xsl:copy>
</xsl:template>
<xsl:template name="doGroupings">
<xsl:apply-templates select="f:grouping[not(starts-with(@id, '-'))]"/>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-req'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-dyn'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-ka'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-str'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-term'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-map'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-test'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-ex'"/>
</xsl:call-template>
<xsl:call-template name="doGrouping">
<xsl:with-param name="prefix" select="'-other'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="doGrouping">
<xsl:param name="prefix"/>
<xsl:for-each select="f:groups/f:grouping[starts-with(@id, $prefix)]">
<xsl:copy>
<xsl:choose>
<xsl:when test="parent::f:groups/parent::*/f:grouping[@id=current()/@id]">
<xsl:for-each select="parent::f:groups/parent::*/f:grouping[@id=current()/@id]">
<xsl:apply-templates select="@*|node()"/>
</xsl:for-each>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates select="@*|node()"/>
</xsl:otherwise>
</xsl:choose>
</xsl:copy>
</xsl:for-each>
<xsl:for-each select="f:grouping[starts-with(@id, $prefix)]">
<xsl:if test="not(parent::*/f:groups/f:grouping[@id=current()/@id])">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- This process runs a QA check on the final IG, ensuring that elements required for publication are properly populated
-
- NOTE: UTG suppresses this because at the moment, all it does is checks related to the artifacts.html page, which UTG doesn't use. If we change the template to extend this, we'll
- need to refactor to allow UTG to enable only the relevant validation.
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:f="http://hl7.org/fhir" xmlns="http://hl7.org/fhir" exclude-result-prefixes="f">
<xsl:output method="text" encoding="UTF-8"/>
<xsl:include href="handleIssues.xslt"/>
<xsl:template match="/f:ImplementationGuide">
<xsl:apply-templates select="f:definition/f:resource"/>
</xsl:template>
<xsl:template match="@*|node()"/>
<xsl:template match="f:definition/f:resource[f:extension[@url='http://hl7.org/fhir/StructureDefinition/implementationguide-page']]">
<xsl:if test="not(f:name)">
<xsl:call-template name="raiseIssue">
<xsl:with-param name="severity">error</xsl:with-param>
<xsl:with-param name="code">required</xsl:with-param>
<xsl:with-param name="details" select="concat('Unable to find ImplementationGuide.definition.resource.name for the resource ', f:reference/f:reference/@value, '. Name is mandatory if it cannot be inferred from the resource to allow proper population of the artifact list.')"/>
<xsl:with-param name="location" select="concat('ImplementationGuide.definition.resource[', count(preceding::f:resource), ']')"/>
</xsl:call-template>
</xsl:if>
<xsl:if test="not(f:description)">
<xsl:call-template name="raiseIssue">
<xsl:with-param name="severity">warning</xsl:with-param>
<xsl:with-param name="code">invariant</xsl:with-param>
<xsl:with-param name="details" select="concat('Unable to find ImplementationGuide.definition.resource.description for the resource ', f:reference/f:reference/@value, '. Descriptions are strongly encouraged if they cannot be inferred from the resource to allow proper population of the artifact list.')"/>
<xsl:with-param name="location" select="concat('ImplementationGuide.definition.resource[', count(preceding::f:resource), ']')"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

View File

@@ -0,0 +1,418 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- Updates the IG to list all found spreadsheets, sets license and fills in all of the default parameters used by this template
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:f="http://hl7.org/fhir" exclude-result-prefixes="html f">
<xsl:param name="spreadsheetList"/>
<xsl:variable name="autoload">
<xsl:call-template name="getParameter">
<xsl:with-param name="name">autoload-resources</xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:variable name="addResources">
<xsl:if test="not(/f:ImplementationGuide/f:definition/f:resource or f:ImplementationGuide/f:extension[@url=$spreadsheetExt]) or not($autoload='false')">true</xsl:if>
</xsl:variable>
<xsl:variable name="spreadsheetExt" select="'http://hl7.org/fhir/StructureDefinition/igpublisher-spreadsheet'"/>
<xsl:variable name="toolsSystem" select="'http://hl7.org/fhir/tools/CodeSystem/ig-parameters'"/>
<xsl:variable name="fhirVersion">
<xsl:value-of select="substring(f:ImplementationGuide/f:fhirVersion/@value,1,1)"/>
</xsl:variable>
<xsl:variable name="oldFHIR">
<xsl:if test="$fhirVersion='1' or $fhirVersion='3' or $fhirVersion='4'">Y</xsl:if>
</xsl:variable>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="f:ImplementationGuide">
<xsl:if test="not(f:version/@value)">
<xsl:message terminate="yes">ImplementationGuide.version must be specified</xsl:message>
</xsl:if>
<xsl:copy>
<xsl:apply-templates select="@*|f:id|f:meta|f:implicitRules|f:language|f:text|f:contained|f:extension"/>
<xsl:if test="$addResources='true'">
<xsl:call-template name="addSpreadsheets">
<xsl:with-param name="spreadsheets" select="$spreadsheetList"/>
</xsl:call-template>
</xsl:if>
<xsl:apply-templates select="f:modifierExtension"/>
<xsl:apply-templates select="f:url|f:version|f:name|f:title|f:status|f:experimental|f:date|f:publisher|f:contact|f:description|f:useContext|f:jurisdiction|f:copyright|f:packageId|f:license"/>
<xsl:if test="not(f:license)">
<license xmlns="http://hl7.org/fhir" value="CC0-1.0"/>
</xsl:if>
<xsl:apply-templates select="f:fhirVersion|f:dependsOn|f:global|f:definition|f:manifest"/>
</xsl:copy>
</xsl:template>
<xsl:template name="addSpreadsheets">
<xsl:param name="spreadsheets"/>
<xsl:if test="$spreadsheets!=''">
<xsl:variable name="spreadsheet">
<xsl:choose>
<xsl:when test="contains($spreadsheets, ';')">
<xsl:value-of select="substring-before($spreadsheets, ';')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spreadsheets"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="trimmedSpreadsheet">
<xsl:call-template name="trimSpreadsheet">
<xsl:with-param name="spreadsheet" select="$spreadsheet"/>
</xsl:call-template>
</xsl:variable>
<extension xmlns="http://hl7.org/fhir" url="{$spreadsheetExt}">
<valueString value="{$trimmedSpreadsheet}"/>
</extension>
<xsl:if test="concat($spreadsheets, ';')">
<xsl:call-template name="addSpreadsheets">
<xsl:with-param name="spreadsheets" select="substring-after($spreadsheets, ';')"/>
</xsl:call-template>
</xsl:if>
</xsl:if>
</xsl:template>
<xsl:template name="trimSpreadsheet">
<xsl:param name="spreadsheet"/>
<xsl:choose>
<xsl:when test="contains($spreadsheet, '/')">
<xsl:call-template name="trimSpreadsheet">
<xsl:with-param name="spreadsheet" select="substring-after($spreadsheet, '/')"/>
</xsl:call-template>
</xsl:when>
<xsl:when test="contains($spreadsheet, '\')">
<xsl:call-template name="trimSpreadsheet">
<xsl:with-param name="spreadsheet" select="substring-after($spreadsheet, '\')"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$spreadsheet"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="f:definition">
<xsl:copy>
<xsl:apply-templates select="@*|f:id|f:extension"/>
<xsl:if test="$oldFHIR='Y'">
<xsl:apply-templates mode="convertParams" select="f:parameter[f:code[not(@value='apply' or @value='path-resource' or @value='path-pages' or @value='path-tx-cache' or @value='expansion-parameter' or @value='rule-broken-links' or @value='generate-xml'
or @value='generate-json' or @value='generate-turtle' or @value='html-template')]]"/>
<xsl:apply-templates select="." mode="addParameters">
<xsl:with-param name="extensionMode" select="'Y'"/>
</xsl:apply-templates>
</xsl:if>
<xsl:apply-templates select="f:modifierExtension|f:grouping|f:resource|f:page|f:parameter"/>
<xsl:apply-templates select="." mode="addParameters"/>
<xsl:apply-templates select="f:template"/>
</xsl:copy>
</xsl:template>
<xsl:template mode="convertParams" match="f:parameter[f:code/@value='find-other-resources']" priority="10"/>
<xsl:template match="f:parameter[f:code[not(@value='apply' or @value='path-resource' or @value='path-pages' or @value='path-tx-cache' or @value='expansion-parameter' or @value='rule-broken-links' or @value='generate-xml' or @value='generate-json'
or @value='generate-turtle' or @value='html-template')]]">
<xsl:if test="not($oldFHIR='Y')">
<xsl:copy-of select="."/>
</xsl:if>
</xsl:template>
<xsl:template match="f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/ig-parameter' and f:extension[@url='code']/f:valueString/@value='find-other-resources']"/>
<xsl:template match="node()" mode="addParameters">
<xsl:param name="extensionMode"/>
<xsl:if test="$addResources='true'">
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'autoload-resources'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
</xsl:if>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/capabilities'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/examples'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/extensions'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/models'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/operations'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/profiles'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/resources'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/vocabulary'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/maps'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/testing'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/history'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-resource'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'fsh-generated/resources'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-pages'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'template/config'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-pages'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/images'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-liquid'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'template/liquid'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-liquid'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/liquid'"/>
<xsl:with-param name="supplement" select="'Y'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-qa'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'temp/qa'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-temp'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'temp/pages'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-output'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'output'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-tx-cache'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input-cache/txcache'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-suppressed-warnings'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'input/ignoreWarnings.txt'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'path-history'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="concat(substring-before(ancestor::f:ImplementationGuide/f:url/@value, 'ImplementationGuide'), 'history.html')"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'template-html'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'template-page.html'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'template-md'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'template-page-md.html'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-contact'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-context'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-copyright'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-jurisdiction'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-license'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-publisher'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-version'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'apply-wg'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'active-tables'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'fmm-definition'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'http://hl7.org/fhir/versions.html#maturity'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'propagate-status'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'excludelogbinaryformat'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="'tabbed-snapshots'"/>
<xsl:with-param name="system" select="$toolsSystem"/>
<xsl:with-param name="value" select="'true'"/>
<xsl:with-param name="extensionMode" select="$extensionMode"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="getParameter">
<xsl:param name="name"/>
<xsl:choose>
<xsl:when test="f:definition/f:parameter[f:code/@value=$name]">
<xsl:value-of select="f:definition/f:parameter[f:code/@value=$name]/f:value/@value"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="f:definition/f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/ig-parameter'][f:extension[@url='code']/f:valueString/@value=$name]/f:extension[@url='value']/f:valueString/@value"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template mode="convertParams" match="f:parameter">
<xsl:call-template name="setParameter">
<xsl:with-param name="code" select="f:code/@value"/>
<xsl:with-param name="value" select="f:value/@value"/>
<xsl:with-param name="extensionMode" select="'Y'"/>
</xsl:call-template>
</xsl:template>
<xsl:template name="setParameter">
<xsl:param name="system"/>
<xsl:param name="code"/>
<xsl:param name="value"/>
<xsl:param name="supplement"/>
<xsl:param name="extensionMode"/>
<xsl:variable name="oldParam">
<xsl:if test="$code='apply' or $code='path-resource' or $code='path-pages' or $code='path-tx-cache' or $code='expansion-parameter' or $code='rule-broken-links' or $code='generate-xml' or $code='generate-json' or $code='generate-turtle'
or $code='html-template' or $code=''">Y</xsl:if>
</xsl:variable>
<xsl:choose>
<xsl:when test="f:parameter[f:code[@value=$code] and f:value[@value=$value or $supplement!='Y']]">
<!-- Don't add - exists as parameter -->
</xsl:when>
<xsl:when test="f:extension[@url='http://hl7.org/fhir/tools/StructureDefinition/ig-parameter'][f:extension[@url='code']/f:valueString/@value=$code] and f:extension[@url='value']/f:valueString[@value=$value or $supplement!='Y']">
<!-- Don't add - exists as extension -->
</xsl:when>
<xsl:when test="not($extensionMode='Y') and (not($oldFHIR='Y') or $oldParam='Y')">
<parameter xmlns="http://hl7.org/fhir">
<code value="{$code}"/>
<value value="{$value}"/>
</parameter>
</xsl:when>
<xsl:when test="$extensionMode='Y' and $oldFHIR='Y' and not($oldParam='Y')">
<extension xmlns="http://hl7.org/fhir" url="http://hl7.org/fhir/tools/StructureDefinition/ig-parameter">
<extension url="code">
<valueString value="{$code}"/>
</extension>
<extension url="value">
<valueString value="{$value}"/>
</extension>
</extension>
</xsl:when>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>

Binary file not shown.

View File

@@ -0,0 +1,154 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
- This process turns XHTML into simple HTML, ensures anchors defining names have end tags and creates section labels and links on all sections
-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:svg="http://www.w3.org/2000/svg" xmlns:html="http://www.w3.org/1999/xhtml" xmlns="http://www.w3.org/1999/xhtml" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xs="http://www.w3.org/2001/XMLSchema" exclude-result-prefixes="svg xsi xs html">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="no" omit-xml-declaration="yes"/>
<xsl:template match="@*|node()">
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:template>
<xsl:template match="/">
<xsl:if test="not(html:* or svg:*)">
<xsl:message terminate="yes">Only XHTML-namespaced content is permitted</xsl:message>
</xsl:if>
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="comment()[normalize-space(translate(., 'DRAFT','draft'))='draft']">
<blockquote class="stu-note">
<table>
<tbody>
<tr>
<td>
<img src="work-98936_640.png" alt="Work in Progress icon" height="30" width="30"/>
</td>
<td>The content in this section has not undergone work group review and may be significantly revised prior to the next ballot.</td>
</tr>
</tbody>
</table>
</blockquote>
</xsl:template>
<xsl:template match="@xsi:schemaLocation"/>
<xsl:template priority="10" match="/html:div">
<div>
<xsl:apply-templates select="@*"/>
<xsl:if test="count(html:h3)>1">
<div class="markdown-toc">
<p>Contents:</p>
<ul>
<xsl:for-each select="html:h3">
<li>
<xsl:variable name="hierarchy">
<xsl:apply-templates mode="findHierarchy" select="."/>
</xsl:variable>
<xsl:variable name="link">
<xsl:choose>
<xsl:when test="preceding-sibling::*[1][self::html:a[@name]]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$hierarchy"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<a href="#{$link}">
<xsl:value-of select="."/>
</a>
</li>
</xsl:for-each>
</ul>
</div>
</xsl:if>
<xsl:apply-templates select="node()"/>
</div>
</xsl:template>
<xsl:template priority="5" match="*">
<xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="@*|node()"/>
</xsl:element>
</xsl:template>
<xsl:template priority="10" match="html:a[@name]">
<a>
<xsl:apply-templates select="@*|node()"/>
<xsl:text>&#x20;</xsl:text>
</a>
</xsl:template>
<xsl:template priority="10" match="html:h1|html:h2">
<xsl:message terminate="yes">"h1" and "h2" elements are not permitted</xsl:message>
</xsl:template>
<xsl:template priority="10" match="html:h3|html:h4|html:h5">
<xsl:variable name="hierarchy">
<xsl:apply-templates mode="findHierarchy" select="."/>
</xsl:variable>
<xsl:variable name="link">
<xsl:choose>
<xsl:when test="preceding-sibling::*[1][self::html:a[@name]]">
<xsl:value-of select="preceding-sibling::*[1]/@name"/>
</xsl:when>
<xsl:otherwise>
<xsl:message>
<xsl:value-of select="concat('No permalink anchor for heading ', local-name(.), ' - ', .)"/>
</xsl:message>
<xsl:value-of select="$hierarchy"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:if test="not(preceding-sibling::*[1][self::html:a[@name]])">
<a name="{$hierarchy}">&#x20;</a>
</xsl:if>
<xsl:element name="{local-name(.)}" namespace="http://www.w3.org/1999/xhtml">
<xsl:apply-templates select="@*"/>
<xsl:apply-templates select="node()"/>
</xsl:element>
</xsl:template>
<xsl:template mode="findHierarchy" match="html:h2|html:h3|html:h4|html:h5">
<xsl:param name="hierarchyString" select="''"/>
<xsl:param name="prevLevelCount" select="0"/>
<xsl:param name="prevLevel" select="floor(number(substring(local-name(.), 2)))"/>
<xsl:variable name="level" select="floor(number(substring(local-name(.), 2)))"/>
<xsl:variable name="levelCount">
<xsl:choose>
<xsl:when test="$prevLevel = $level">
<xsl:value-of select="$prevLevelCount + 1"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$prevLevelCount"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="newHierarchyString">
<xsl:choose>
<xsl:when test="$hierarchyString!=''">
<xsl:value-of select="concat($levelCount, '.', $hierarchyString)"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$levelCount"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:choose>
<xsl:when test="count(preceding::*[self::html:h1 or self::html:h2 or self::html:h3 or self::html:h4 or self::html:h5])!=0">
<xsl:choose>
<xsl:when test="$level&lt;$prevLevel">
<xsl:apply-templates mode="findHierarchy" select="preceding::*[self::html:h1 or self::html:h2 or self::html:h3 or self::html:h4 or self::html:h5][1]">
<xsl:with-param name="hierarchyString" select="$newHierarchyString"/>
<xsl:with-param name="prevLevelCount" select="1"/>
<xsl:with-param name="prevLevel" select="$level"/>
</xsl:apply-templates>
</xsl:when>
<xsl:otherwise>
<xsl:apply-templates mode="findHierarchy" select="preceding::*[self::html:h1 or self::html:h2 or self::html:h3 or self::html:h4 or self::html:h5][1]">
<xsl:with-param name="hierarchyString" select="$hierarchyString"/>
<xsl:with-param name="prevLevelCount" select="$levelCount"/>
<xsl:with-param name="prevLevel" select="$prevLevel"/>
</xsl:apply-templates>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$newHierarchyString"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>