Mode:

Compact lists

Showing:

Documentation
Parameters
Used by
References
Source

Table of Contents

Group by:

CDA.xsl - main file

Templates
Output
Main stylesheet CDA.xsl
Documentation

Description

Title: CDA R2 StyleSheet

Version: 4.0.1

Maintained by: HL7 Structured Documents Work Group

Purpose: Provide general purpose display of CDA release 2 (Specification: ANSI/HL7 CDAR2) and CDA release 3 (Specification: currently in ballot) documents, and be a starting point for people interested in extending the display. This stylesheet displays all section content, but does not try to render each and every header attribute. For header attributes it tries to be smart in displaying essentials, which is still a lot.

License: Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0

Download link: https://gforge.hl7.org/gf/project/strucdoc/frs/?action=FrsReleaseBrowse&frs_package_id=239 (soon...)

Documentation/manual: https://confluence.hl7.org/display/SD/CDA+R2+Stylesheet

History: This stylesheet stands on the shoulders of giants. The stylesheet is the cumulative work of several developers; the most significant prior milestones were the foundation work from HL7 Germany and Finland (Tyylitiedosto) and HL7 US (Calvin Beebe), and the presentation approach from Tony Schaller, medshare GmbH provided at IHIC 2009. The stylesheet has subsequently been maintained/updated by Lantana Group (US) and Nictiz (NL).

TODO

  • Fix for Mobile Safari (iOS 6): doesn't support opening the table of contents
  • Check additional structural vocabulary for CDA 2.1 (RIM 2.35) - NullFlavors already done
  • Fix a problem where the footer div will not be rendered by browsers when an iframe exists (pdf usually)

Revisions

  • 01/17/2019 AH, v4.0.1

    Approved all changes in beta 1 and beta 2 as-is except for the addition of IHE PCC MCV. The StrucDoc WG feels that this addition needs some more thought before a decision on re-adding it can be made.

    • Added support for patient/languageCommunication
    • Added support for patientRole/providerOrganization
    • Added support for informationRecipient/intendedRecipient/receivedOrganization
    • Updated rendering of nonXMLBody and observationMedia to check for Base64 content before checking text/plain. This fixes support for Base64 encoded text/plain.
  • 01/14/2019 AH, v4.0.1 beta 2
    • As requested per GForge#20000, added support for IHE PCC MCV, Revision 1.2, Trial Implementation, November 2, 2018. Implementation coverage is based on AllScripts stylesheet implementation (license Apache License, Version 2.0):
      Table 5.1.X-1: styleCode
      Covered? styleCode Description Suggested Rendering (Hints)
      No. TODO? How? xEmptySection Section is empty When showing other than complete content, do something special to show that the entire section is empty. See Section 3.1.5.3.1 for an example.
      No. TODO? How? xHistoric Content is Historic When showing content that was assessed, these data should be hidden. See Section 3.1.5.3.2 for an example.
      No. TODO? How? xAssessed Content Assessed/Discussed this visit When showing content that was assessed, these data shall be shown. See Section 3.1.5.3.2 for an example.
      No. TODO? How? xDetail Extra Detail – not necessarily for Patients When showing patient related views, this content may be omitted. See Section 3.1.5.3.3 for an example.
      No. TODO? How? xDate Content is a Date Show as a date.
      No. TODO? How? xDateTime Content is a Date with Time Show as a date with time.
      No. TODO? How? xCode Content is a code from some code system. Show as a code.
      No. TODO? How? xPhone Content is a telephone number Show as a phone number.
      No. TODO? How? xEmail Content is an email address Show as an email address.
      No. TODO? How? xAddress Content is a Street Address Shows an address.
      No. TODO? How? xPersonName Content is a person name Show as the name of a person.
      No. TODO? How? xIdentifier Content is an identifier Show as an identifier.
      Yes. Rendered with red font color xAlert The content contains information of importance that needs to be used to alert the reader, for example level of severity considered life threatening. Show in some manner to indicate an Alert.
      Yes. Rendered with red font color xAbnormal The content contains information that may be considered to be not within what are considered to be normal values. Show in some manner to indicate a value that is not normal.
      No. TODO? How? Just display:none or with javascript for unhide? xHidden Content may typically be repetitive and unnecessary to display. Hide the content.
      Yes. Rendered in italics xLabel The content is a label of some data, e.g., Refills: Show content as a label.
      Yes. No specifics xValue The content contains a data that is a value, e.g., 98.6 Show content as a clinical item status value.
      Yes. No specifics xReaction The content represents text about a reaction. Show content as a reaction.
      Yes. No specifics xComment The content is comment text. Show as a comment.
      Yes. text-align: center xCenter Text to be centered Alignment should be centered.
      Yes. text-align: right xRight Text to be right justified Alignment should be right.
      Yes. text-align:left xLeft Text to be left justified Alignment should be left.
      Yes. font-family: monospace xMono Text to be output in a monospace font Render in a monospace font.
      Yes. background-color: yellow; color: black; xHighlight Text to be highlighted Render with highlight.
      Yes. render an hr element xHR A horizontal line is to be drawn Render a horizontal line.
      Yes xRowNormal For example, to indicate an odd numbered row of a table. Render table row as normal.
      Yes xRowAlt For example, to indicate an even numbered row of a table. Render table row as alternate.
      Yes xIndent Render content indented.
      Yes xSecondary This content is of secondary importance. Render in some manner to indicate this content is of secondary importance, for example in a lighter font color.
      Yes xRowGroup This is used on table rows to show that children and parent objects are related Keep lines from appearing between child objects and their parents in a table together
      Yes xContentWrapping This is used to keep the text in the first column from wrapping under the bullets that appear for child objects inside of a table Prevent text from wrapping under child objects
    • Added support for patient/languageCommunication
    • Added support for patientRole/providerOrganization
    • Added support for informationRecipient/intendedRecipient/receivedOrganization
  • 11/13/2018 AH, v4.0.1 beta 1 Updated rendering of nonXMLBody and observationMedia to check for Base64 content before checking text/plain. This fixes support for Base64 encoded text/plain.
  • 10/02/2018 AH, v4.0.0 Administrative rename to final product after StrucDoc committee approval
  • 09/26/2018 AH, v4.0.0 beta 8
    • Fixed an issue that for certain ids would cause a warning "Non-text output nodes are ignored when writing an attribute, comment, or PI" and/or "Cannot write an attribute node when no element start tag is open"
    • Fixed an issue for caption elements under anything but a table, e.g. a list, where the text content would be duplicated
  • 08/31/2018 AH, v4.0.0 beta 7
    • Consistency update. Changed all US English label names to use Camel Casing
    • Added OID labels for SNOMED CT, ICD-10-NL, ICD-10-DE, ICD-10-CM
    • Added support for originalText and translation rendering on coded elements, regardless of nullFlavor status
    • Fixed a bug that would occur when AD.useablePeriod exists and added rendering support when it does
  • 08/27/2018 AH, v4.0.0 beta 6
    • Improved rendering of empty (sub)sections
    • Added various more OID translations like the NHS Number
    • Extended the l10.xsd to include an enumeration for language, and made attributes required
    • Fixed all uppercase language codes in l10n file
    • Improved rendering of confidentialityCode in the title when the code is not from x_BasicConfidentialityKind
    • Removed illegal css instruction "float: top;" on documentheader, documentbody and documentfooter
    • Hide expand/collapse triangle for sections upon print
  • 08/16/2018 AH, v4.0.0 beta 5
    • Added support to switch sectionNumbering on or off (default)
    • Added support for collapsing/expanding all or selected (sub) sections
    • Fix for empty elements causing XHTML grief
    • Improved rendered warning for potential malicious contents
    • Improved rendering of inFulFillment
    • Improved rendering of names by eliminating leading/trailing spaces, and by rendering only the first name in the header. All names are in the footer.
    • Improved rendering of addresses by pulling buildingNumberSuffix into the address line
  • 08/05/2018 AH, v4.0.0 beta 4
    • Added support to mask or skip patient ids based on a comma separated list of @root values. Masking will cause xxx-xxx-xxx to appear with a mouse over that states "masked"
    • Now renders subsection almost the same way as top level sections including any overriding authors/informants/subjects, section numbering. The difference lies in increasing left indenting for every subsection
  • 06/19/2018 AH, v4.0.0 beta 3
    • Fixed a bug in rendering ClinicalDocument/confidentialityCode causing it not to get rendered
    • Based on physician feedback: header labels are now all bold (was normal), header values are now all normal (was italic). This leads to more focus on what's important
    • Based on physician feedback: Patient-IDs now all go on a new line when the view becomes too small to be on one line (was: line wrapped). This is always true for print
    • Based on physician feedback: More space between Patient header parts
    • Based on physician feedback: Updated encounter/code label from "Code" to "Type" as it caused confusion
    • Smarter interval of time rendering: when both low/high are on the same date, renders date only once, so "January 12, 2018 10AM -0500 - 11PM -0500" instead of "from January 12, 2018 10AM -0500 to January 12, 2018 11PM -0500"
    • Now renders id/@assigningAuthorityName as title on an id. This was not rendered at all before. May need better solutions for that info in future update
    • Smart rendering of addresses. Now skips rendering of streetName, houseNumber, houseNumberNumeric when there is a streetAddressLine. Now renders postalCode next to city (leading/trailing depending on CDA order)
    • Fixed rendering issue in outlining of authenticator and legalAuthenticator in the footer
  • 05/23/2018 AH, v4.0.0 beta 2
    • Rerouted rendering of narrative block renderMultiMedia to rendering of nonXMLBody so there's now one block of logic and security checks on that. At the same time this extends the support for types of renderMultiMedia as originally only gif and jpeg were supported. At least some ELGA examples now render their PDF contents correctly.
    • Fixed rendering of caption elements when not under a table
    • Fixed duplicate rendering of ids for footnotes
    • Updated all @name based anchors to @id based anchors for xhtml alignment
  • 05/09/2018 AH, v4.0.0 beta 1
    • Updates to the color scheme and a few other visual aids for accessibility alignment with American Foundation for the Blind Section 508
    • Added new parameters for color: bgcolor-th and bgcolor-td
    • Added new parameters for skipping the rendering of the CDA header info at the top of the document (dohtmlheader) and/or footer (dohtmlfooter)
    • Fix for visibility in the TOC of empty sections as specified by the StrucDoc WG with section/@nullFlavor
    • Fix in documentationOf: don't render @classCode if ACT as that doesn't hold information, and improved serviceEvent/performer contact detail rendering
    • Fix for missing space in rendering of time intervals
    • Update localization function for the compressed l10n structure
    • Update menu behavior. Now only expands sublevels (if any) when hovering the parent
  • 04/11/2018 Alexander Henket
    • Updated rendering of documentationOf/serviceEvent/@classCode so it does not render if it is 'ACT'
    • Fixed a bug in rendering documentationOf/serviceEvent/code (it was inadvertently not rendered)
    • Added rendering of documentationOf/serviceEvent/performer name in the document header
    • Added rendering of documentationOf/serviceEvent/performer contact details in the document footer
    • Fixed l10n for keys typeCode-PRP, typeCode-PPRP and typeCode-SPRP. Each last P should have been an F.
    • Little tweak to author to avoid rendering of additional commas when certain content is missing
    • Skip timestamp seconds when they are 00. Skip minutes and seconds when they are 00:00. Both for readability.
  • 03/24/2018 Alexander Henket
    • Added parameter menu-depth with min 1, max 3, default 1 (the way it always has been) -- temporarily left on 3 for browser testing
  • 02/16/2018 Alexander Henket
    • Moved header authenticator so it is right above legalAuthenticator instead of just under participant
    • Improved readability. Moved contact details for all header participants (recordTarget, author, informant, authenticator, legalAuthenticator, ...) to the right instead of underneath the participant name.
  • 02/15/2018 Alexander Henket
    • Fixed rendering of serviceEvent/code, location/healthCareFacility/id, order/code, order/priorityCode, consent/code, consent/statusCode
    • Fixed casing of "inFulfillmentOf" and added call to it under documentationOf (GForge#3169)
    • Render recordTarget regardless of nullFlavor in id. (GForge#3590)
    • Added support for encompassingEncounter dischargeDispositionCode, sdtc:admissionReferralSourceCode, encounterParticipant
    • Added support for ClinicalDocument/versionNumber, ClinicalDocument/setId, and relatedDocument (it was not called)
    • (CDA R2.1) Added support for hl7:admissionReferralSourceCode
    • (CDA R2.1) Added support for Person/desc as div under name
    • (CDA R2.1) Added support for Person/birthTime
    • (CDA R2.1) Added support for relatedDocument/@inversionInd
    • (CDA R2.1) Added support for serviceEvent/statusCode
    • (CDA R2.1) Added support for section subject/relatedSubject/subject/birthTime | deceasedTime | deceasedInd | multipleBirthInd | multipleBirthOrderNumber | raceCode | ehtnicGroupCode
  • 12/15/2017 Alexander Henket
    • Reimplemented security fix from Rick Geimer, Lantana, that does full checking on narrative table components
    • Fixed capitals in iframe properties WIDTH and HEIGHT
    • Added support for looking up an author organization name based on orgsanization id
    • Fixed getting the relatedDocument/parentDocument/id
    • Enhanced rendering of date/time. Now renders with AM/PM in English and with h or u on 24h clock otherwise if at least hours are present.
  • 10/20/2014 Alexander Henket
    • Fixed support for recordTarget/patient extensions deceasedInd/deceasedTime and multipleBirthInd/multipleBirthOrderNumber. They were inadvertently called in the HL7 namespace.
  • 10/13/2014 Alexander Henket
    • Fixed @ID by adding it to whatever in scope element (div, sup, sub, a, etc.) as @id. To this end the separate calls were replaced by a central call in mode 'handleSectionTextAttributes'.
  • 10/02/2014 Alexander Henket
    • Fixed linkHtml support as it was calling the wrong named template and thus would not render at all.
  • 08/28/2014 Alexander Henket
    • Adjusted time zone in formatDateTime representation so it just displays as-is when available. The number2name conversion, e.g. PST or CET, would fail part of the year due to daylight savings
  • 17/04/2014 Alexander Henket
  • 09/04/2014 Alexander Henket
    • Implemented minimal mitigation for the security risk in rendering iframes for an arbritrary reference/@value
    • Note that this cda.xsl does not copy arbritrary attributes from section text. The noted risk on calling external images thereby sending HTTP Referer URL is not mitigated
  • 05/30/2013 Alexander Henket
    • Made parameters out of font-family and font-sizes for the main font, h1-h6, and footers
    • Font-sizes are now all in points rather than pixels and points so more reliable in rendering
    • Fixed getLocalizedString so it now does a lowercase comparison of the language
    • Fixed getLocalizedString for language only situations (without region)
    • Added German translations for Table of Contents and Show/Hide revisions
  • 05/29/2013 Alexander Henket
    • Internet Explorer update: disabled the use of textEncoding, otherwise it would not render
    • Fixed font-size problem for Internet Explorer 8 - it doesn't inherit size in td tags
    • Fixed table of contents problem for Internet Explorer 8 - wouldn't open
    • Fixed #documentfooter style
    • Pulled bgcolor in the header and footer part into CSS so it may be overridden
  • 05/28/2013 Alexander Henket
    • Redesigned the setup. Now has three main divs.
      • #documentheader contains basic Patient and Author info
      • #documentbody contains section content
      • #documentfooter contains all relevant CDA header info
    • Updated for CDA release 3 as of Ballot May 2013. Includes datatypes awareness in alle relevant places This update is largely about feature parity
    • Added <oXygen/> style documentation tags to facilitate HTML documentation
  • 05/22/2013 Alexander Henket
    • Added parameter for external css if so desired
  • 06/28/2011 Alexander Henket
    • Improved show-id by diplaying nullFlavor where applicable
  • 05/31/2011 Alexander Henket
    • Improved show-code to return translated codes, and finally the original code if originalText and @displayName fail
    • Improved label on bottom participant to include translated assignedEntity/code if available
    • Improved readability of participant/assignedEntity
  • 05/30/2011 Alexander Henket
    • Participant codes are now displayed by default instead of only when the name is omitted
    • Fixed translation of patientIdLong, by using the literal string instead treating it as a node
    • Improved title on ids in fixed top header by adding a newline between multiple ids
    • Changed behavior of "Waarschuwingen" and "Behandelaanwijzigingen" to display "Er zijn geen ..." if they are not applicable, instead of showing nothing
    • Changed "Behandelaanwijzingen into "Behandelrestricties"
  • 05/03/2011 Alexander Henket
    • Added language file and a template getLocalizedString to deal with it
    • Added parameter textLang to feed the desired language. Does not work with just a browser, so textLang needs to be set in any environment
    • Replaced all current text in the stylesheet with calls to getLocalizedString
    • Improved layout of page so there's now a fixed header. Shrunk the TOC into a button with hover to open so it doesn't always take up all screen space. The layout is enforced using div with an id To avoid lots of scrolling in the header area this part needed to be predictable and small. All header info except recordTarget is now to the bottom of the document Also the document title was made less big
    • Added support for every styleCode in CDA release 2, not just bold/italics/underline, but also all list styles and e.g. Botrule
    • Added support for footnotes/footnoteRefs
    • Added support for multiple section authors (used to be just one, and support was bugged)
    • Added support for (multiple) section informants
    • Added support for section subject
    • Added support for @ID, @IDREF, @language, and all other style properties from CDA release 2
    • Added support for the display of nonXMLBody with text/plain content
    • Added support for Narrative block <linkHtml/>
    • Added support for revisions. Deletions will get a strikethrough, Insertions an underline and overline Both get a title saying 'delete' or 'insert'. This feature is off by default, but above the TOC there's a toggle to switch revisions marks on or off. A little Javascript was used for that.
    • Added confidentiality to the title of the document if present and other than N (Normal). If someone took the effort to send the confidentiality it should be 'in your face' as recipient.
    • Added support for multiple section authors (used to be just one, and support was bugged)
    • Added support for (multiple) section informants
    • Added support for section subject
    • Added a switch to diable Javascript in case the environment requires that
    • Improved support for data type II when there's only a root and no extension
    • Improved support for the author organization which not displayed
    • Improved support for telecom and addr use codes. Now supports multiples
    • Improved support for names. Now gets out every node, supporting mixed mode too.
    • Improved readability for the support for lists by combining the two templates
    • Improved support for observationMedia by removing the limitation of just gif and jpeg. If the browser does not support a given type, then at least a question mark is displayed. Before there was nothing
    • Improved support for observationMedia by adding the id (if available) to the alt and title of the image
    • Added support for inline base64 images. HTML actually can deal with that too
    • Improved handling of addresses so it now walks through all nodes, support mixed content. Also, the elements are now handled in the order of the instance and not just US order
    • Improved support for dates by including a language switch. Now just handles en-US and nl-NL, but could handle more Likely more sophisticated support is in order, but this works for our purposes while leaving US conventions intact
    • Improved handling of names, addresses and telecom. The templates gave incorrect results for multiples of these, mixing the contents of the latter with the first. Added name use code to the display of names if available.
    • Fixed the author string in the main document info. It used to '-', but is now "Author" in any supported language
  • ---------------------------------------------------

    Below is here the list of changes in the versions of the stylesheet up to version 3.1.1. This version of the stylesheet implements all changes done up to version 3.1.1.

    ---------------------------------------------------
  • 05/14/2018 Alexander Henket Better use of variables (GForge#15683)
  • 02/15/2018 Alexander Henket Render recordTarget regardless of nullFlavor in id. Updated rendering of ids with nullFlavors (GForge#3590)
  • 02/15/2018 Alexander Henket Minor formatting fix to table/caption and ul captions. (GForge#3185)
  • 02/15/2018 Alexander Henket Fixed casing of "inFulfillmentOf" and added call to it under documentationOf (GForge#3169)
  • 09/19/2016 Rick Geimer Fixed some iframe issues (attribute typos). Added datauri support for nonXMLBody docs with B64 PDFs (does not work in IE or Edge as of this time, but does work in Chrome and FireFox).
  • 11/12/2014 Rick Geimer Minor formatting fix to authenticator.
  • 04/13/2014 Rick Geimer more security fixes. Added sandbox attribute to iframe. Added td to the list of elements with restricted table attributes (missed that one previously). Fixed some typos. Cleaned up CSS styles. Merged the table templates since they all use the same code. Fixed a bug with styleCode processing that could result in lost data. Added external-image-whitelist param.
  • 04/07/2014 Rick Geimer more security fixes. Limited copy of only legal CDA table attributes to XHTML output.
  • 04/07/2014 Rick Geimer more security fixes. Fixed some bugs from the hot fix on 4/6 ($uc and $lc swapped during some translates). Added limit-external-images param that defaults to yes. When set to yes, no URIs with colons (protocol URLs) or beginning with double slashes (protocol relative URLs) are allowed in observation media. I'll revise later to add a whitelist capability.
  • 04/06/2014 Rick Geimer security hot fixes: Addressed javascript in nonXMLBody/text/reference/@value and non-sanitized copy of all table attributes.
  • 01/05/2011 Jingdong Li updated.
  • 09/17/2010 Jingdong Li updated.
  • 08/25/2010 Jingdong Li updated.
  • 03/30/2010 Jingdong Li updated.
  • 12/11/2009 Kai Heitmann updated.
  • 08/12/2008 Jingdong Li updated.

Stylesheet version 1.0
Extension functions reliance
Namespace
Functions
http://exslt.org/common node-set
[ top ]
Template /
Documentation

Description

Main template. Triggers on all top level ClinicalDocument elements

Namespace No namespace
Match /
Mode #default
Import precedence 0
Source
<xsl:template match="/">
  <xsl:apply-templates select="/hl7:ClinicalDocument"/>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:ClinicalDocument[not(ancestor::hl7:ClinicalDocument)]
Documentation

Description

Starts an HTML document containing a rendering of the ClinicalDocument

Namespace No namespace
Match hl7:ClinicalDocument[not(ancestor::hl7:ClinicalDocument)]
Mode #default
References
Import precedence 0
Source
<xsl:template match="hl7:ClinicalDocument[not(ancestor::hl7:ClinicalDocument)]">
  <xsl:comment>Do NOT edit this HTML directly: it was generated via an XSLT transformation from a CDA Release 2 or 3 XML document.</xsl:comment>
  <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="{substring($textLangLowerCase,1,2)}">
    <head>
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
      <title>
        <xsl:call-template name="show-title"/>
      </title>
      <xsl:comment> General CSS </xsl:comment>
      <style type="text/css" media="all">
                    *{
                        font-family: <xsl:value-of select="$font-family"/>;
                        font-size: <xsl:value-of select="$font-size-main"/>;
                    }
                    body{
                        padding: 2px;
                        color: #003366;
                        background-color: white;
                        font-size: <xsl:value-of select="$font-size-main"/>;
                    }
                    #documentheader,
                    #documentbody,
                    #documentfooter{
                        width: 100%;
                    }
                    #documentheader{
                        border-bottom: 1px solid grey;
                        margin-bottom: 1em;
                    }
                    #documentfooter{
                        border-top: 1px solid grey;
                        margin-top: 1em;
                    }
                    a{
                        color: #003366;
                        background-color: white;
                    }
                    h1{
                        font-size: <xsl:value-of select="$font-size-h1"/>;
                        font-weight: bold;
                    }
                    h1.title{
                        text-align: center;
                    }
                    h2{
                        font-size: <xsl:value-of select="$font-size-h2"/>;
                        font-weight: bold;
                    }
                    h3{
                        font-size: <xsl:value-of select="$font-size-h3"/>;
                        font-weight: bold;
                    }
                    h4{
                        font-size: <xsl:value-of select="$font-size-h4"/>;
                        font-weight: bold;
                    }
                    h5{
                        font-size: <xsl:value-of select="$font-size-h5"/>;
                        font-weight: bold;
                    }
                    h6{
                        font-size: <xsl:value-of select="$font-size-h6"/>;
                        font-weight: bold;
                    }
                    hr{
                        width: 100%;
                    }
                    span {
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        display: inline; /* IE8 hack: would go to next line otherwise */
                    }
                    table{
                        line-height: 10pt;
                        width: 100%;
                    }
                    thead tr, th{
                        background-color: <xsl:value-of select="$bgcolor-th"/>;
                    }
                    tbody tr{
                        background-color: <xsl:value-of select="$bgcolor-td"/>;
                    }
                    td{
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        padding: 0.1cm 0.2cm;
                        vertical-align: top;
                    }
                    .table_simple{
                        width: auto;
                        color: inherit;
                        background-color: inherit;
                    }
                    .table_simple td{
                        padding: 0;
                    }
                    .table_simple td.td_label{
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        font-weight: inherit;
                        font-style: italic;
                        padding-right: 0.2cm;
                    }
                    .header_table{
                        border: 1pt solid #00008b;
                    }
                    .narr_table{
                        width: 100%;
                        margin: 0.3em 0;
                    }
                    .narr_tr{
                        //background-color: #ffffcc;
                    }
                    .narr_th{
                        background-color: <xsl:value-of select="$bgcolor-th"/>;
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                    }
                    .narr_footnote{
                        font-size: <xsl:value-of select="$font-size-footnote"/>;
                        font-style: italic;
                    }
                    .td_label{
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        font-weight: bold;
                        background-color: <xsl:value-of select="$bgcolor-th"/>;
                    }
                    .td_label_width{
                        width: 20%;
                    }
                    .span_label{
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        font-weight: bold;
                    }
                    .span_value{
                        font-size: <xsl:value-of select="$font-size-main"/>; /* IE8 hack: doesn't understand inheritance */
                        font-weight: normal;
                    }
                    .revision_insert{
                        text-decoration: underline overline;
                    }
                    .revision_insert_final{
                    }
                    .revision_delete{
                        text-decoration: line-through;
                    }
                    .revision_delete_final{
                        display: none;
                    }
                    .span_button {
                        display: table-cell;
                        cursor: pointer;
                        border: 2pt inset #585858;
                        border-radius: 15px;
                        -moz-border-radius: 15px;
                        padding: 0.1cm 0.2cm;
                        background-color: <xsl:value-of select="$bgcolor-td"/>;
                        font-weight: bold;
                        vertical-align: baseline;
                        width: 150px;
                    }
                    div.separator {
                        height: 1em;
                    }
                    div.caption {
                        font-weight: bold;
                        text-align: center;
                    }
                </style>
      <xsl:comment> Stylecode CSS </xsl:comment>
      <style type="text/css" media="all">
                    .Bold{
                        font-weight: bold;
                    }
                    .Italics{
                        font-style: italic;
                    }
                    .Underline{
                        text-decoration: underline;
                    }
                    .Emphasis{
                        font-weight: bold;
                        font-style: italic;
                    }
                    .Lrule{
                        border-left-width: 2px;
                        border-left-style: solid;
                    }
                    .Rrule{
                        border-right-width: 2px;
                        border-right-style: solid;
                    }
                    .Toprule{
                        border-top-width: 2px;
                        border-top-style: solid;
                    }
                    .Botrule{
                        border-bottom-width: 2px;
                        border-bottom-style: solid;
                    }
                    .Arabic{
                        list-style: arabic;
                    }
                    .LittleRoman{
                        list-style: lower-roman;
                    }
                    .BigRoman{
                        list-style: upper-roman;
                    }
                    .LittleAlpha{
                        list-style: lower-alpha;
                    }
                    .BigAlpha{
                        list-style: upper-alpha
                    }
                    .Disc{
                        list-style: disc;
                    }
                    .Circle{
                        list-style: circle;
                    }
                    .Square{
                        list-style: square;
                    }</style>
      <!--<xsl:comment> Stylecode CSS IHE PCC MCV, Revision 1.2, Trial Implementation, November 2, 2018</xsl:comment>
                <style type="text/css" media="all">
                    .xOrganizerRow > td, .organizer-row > td {
                        padding-bottom: 4px;
                    }
                    .xOrganizerRow, .organizer-row {
                        border-bottom: none;
                    }
                    .xWhitespace {
                        padding-left: 4px;
                    }
                    .xContentSpacing {
                        padding-left: 2.5em;
                    }
                    .xRowGroup > tr {
                        border-bottom: none;
                    }
                    table:first-of-type > tbody:first-of-type {
                        border-top: none;
                    }           
                    .xRowGroup {
                        border-top: 1px dotted #222;
                    }
                    .xSectionComments {
                        text-decoration: underline;
                    }
                    .xSectionComments, .xReconciliation {
                        margin-top: 15px;
                    }
                    .xLabel {
                        font-style:italic;
                    }
                    .xAlert, .xReaction{
                        color: red;
                    }
                    tr.xAlert {
                        background-color: #FDE7EC
                    }
                    tr.xAlert > td:first-of-type:before {
                        content: "\25B2";
                    } 
                    .xContentWrapping {
                        display: table-cell;
                        padding-left: 5px;
                    }
                    .xIndent, .xIndention{
                        white-space: pre;
                        vertical-align: top;
                        display: table-cell;
                    }
                    .xlistForTable {
                        list-style: none;
                        padding: 0;
                    }
                    .xtableWithinTable > tr > td {
                        margin: 0;
                        padding: 0;
                    }
                    xCenter {
                        text-align: center;
                    }
                    xRight {
                        text-align: right;
                    }
                    xLeft {
                        text-align: left;
                    }
                    xMono {
                        font-family: monospace;
                    }
                    xHighlight {
                        background-color: yellow;
                        color: black;
                    }
                </style>-->
      <xsl:comment> Section Button Toggle CSS </xsl:comment>
      <style type="text/css" media="screen">
                    div.button.expandCollapse {
                        float: left;
                        margin-right: 10px;
                        cursor: pointer;
                    }
                </style>
      <xsl:comment> Revision Toggle CSS </xsl:comment>
      <style type="text/css" media="print">
                    button, 
                    div.button,
                    #buttontable {
                        display: none;
                    }
                    div.section-content {
                        display: block !important;
                    }
                    .print_visible {
                        display: block;
                        float: none;
                        margin-right: 0;
                    }
                </style>
      <xsl:comment> Table of Contents CSS </xsl:comment>
      <style type="text/css" media="screen">
        <xsl:text disable-output-escaping="yes">
                    #nav, #nav ul {
                        padding: 0;
                        margin: 0;
                        list-style: none;
                    }
                    
                    #nav li {
                        float: left;
                        width: 300px;
                    }
                    #nav ul {
                        position: absolute;
                        width: 300px;
                        left: -1000px;
                    }
                    #nav li ul li ul {
                        display: none;
                    }
                    
                    #nav li ul li:hover > ul {
                        display: block;
                        position: absolute;
                        left: 50px !important;
                    }
                    #nav li ul li:hover > ul > li > a {
                        border: 1px solid #585858;
                    }
                    
                    #nav li:hover ul, #nav li.ie_does_hover ul {
                        left: auto;
                        background-position: 0 0;
                    }
                    
                    #nav * a {
                        display: block;
                        padding: 2px 8px;
                        text-decoration: none;
                        font-weight: bold;
                        font-size: 11px;
                    }
                    </xsl:text>
                    #nav ul * a {
                        font-weight: bold;
                        color: #585858;
                        background-color: <xsl:value-of select="$bgcolor-td"/>;
                        cursor: pointer;
                    }
                    
                    #nav ul ul a:link, #nav ul ul a:visited {
                        font-weight: normal;
                        color: #585858;
                        background-color: <xsl:value-of select="$bgcolor-td"/>;
                        cursor: pointer;
                    }
                    
                    #nav * li a:hover, #nav * li a:active,
                    #nav * li * li a:hover, #nav * li * li a:active {
                        /*font-weight: normal;*/
                        color: white;
                        background-color: #585858;
                        cursor: pointer;
                    }
                    
                    #nav * li {
                        border-left: 2px solid white;
                    }
                    
                    #nav * ul li {
                        border-top: 2px solid white;
                        border-left: 0;
                    }
                    
                    /* IE only hack */
                    * html ul li, * html ul ul li{
                        border-bottom: 2px solid white;
                    }
                    
                    * html ul ul li{
                        border-top: 0;
                    }
                    /* End IE only hack */
                </style>
      <xsl:if test="string-length($externalCss)>0">
        <xsl:comment> External CSS </xsl:comment>
        <link type="text/css" rel="stylesheet" href="{$externalCss}"/>
      </xsl:if>
      <xsl:if test="string($useJavascript)='true'">
        <xsl:comment> Javascript for Revisions switch </xsl:comment>
        <script type="text/javascript">
          <xsl:text>var gStringCollapse = "</xsl:text>
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Collapse'"/>
          </xsl:call-template>
          <xsl:text>"; </xsl:text>
          <xsl:text>var gStringExpand = "</xsl:text>
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Expand'"/>
          </xsl:call-template>
          <xsl:text>";</xsl:text>
          <xsl:text>
                        function expandAllSections() {
                            var toggleButtons = document.getElementsByClassName("expandCollapse");
                            if (toggleButtons != null) {
                                var i = 0;
                                while (i != toggleButtons.length) {
                                    expandSection(toggleButtons[i]);
                                    i++;
                                }
                            }
                            toggle('sectionsToggleExpand');
                            toggle('sectionsToggleCollapse');
                        }
                        function expandSection(sectionTitleButton) {
                            sectionTitleButton.title = gStringCollapse;
                            sectionTitleButton.innerText = '▼';
                            sectionTitleButton.onclick = function (){collapseSection(this);};
                            var sectionContent = sectionTitleButton.parentElement.parentElement.children[1]
                            if (sectionContent != null) {
                                sectionContent.style.display = '';
                            }
                        }
                        function collapseAllSections() {
                            var toggleButtons = document.getElementsByClassName("expandCollapse");
                            if (toggleButtons != null) {
                                var i = 0;
                                while (i != toggleButtons.length) {
                                    collapseSection(toggleButtons[i]);
                                    i++;
                                }
                            }
                            toggle('sectionsToggleExpand');
                            toggle('sectionsToggleCollapse');
                        }
                        function collapseSection(sectionTitleButton) {
                            sectionTitleButton.title = gStringExpand;
                            sectionTitleButton.innerText = '▶';
                            sectionTitleButton.onclick = function (){expandSection(this);};
                            var sectionContent = sectionTitleButton.parentElement.parentElement.children[1]
                            if (sectionContent != null) {
                                sectionContent.style.display = 'none';
                            }
                        }
                        function showReviewMarks() {
                            var allHTMLTags=document.getElementsByTagName("*");
                            for (i in allHTMLTags) {
                                //Get all tags with the specified class name.
                                if (allHTMLTags[i].className=='revision_insert_final') {
                                    allHTMLTags[i].className = 'revision_insert';
                                }
                                if (allHTMLTags[i].className=='revision_delete_final') {
                                    allHTMLTags[i].className = 'revision_delete';
                                }
                            }
                            toggle('revisionToggleOn');
                            toggle('revisionToggleOff');
                        }
                        function hideReviewMarks() {
                            var allHTMLTags=document.getElementsByTagName("*");
                            for (i in allHTMLTags) {
                                //Get all tags with the specified class name.
                                if (allHTMLTags[i].className=='revision_insert') {
                                    allHTMLTags[i].className = 'revision_insert_final';
                                }
                                if (allHTMLTags[i].className=='revision_delete') {
                                    allHTMLTags[i].className = 'revision_delete_final';
                                }
                            }
                            toggle('revisionToggleOn');
                            toggle('revisionToggleOff');
                        }
                        function toggle(obj) {
                            var el = document.getElementById(obj);
                            el.style.display = (el.style.display != 'none' ? 'none' : '' );
                        }
                        </xsl:text>
        </script>
        <xsl:comment> Javascript for Table of Contents menu </xsl:comment>
        <script type="text/javascript">
                        sfHover = function() {
                            var sfEls = document.getElementById("nav").getElementsByTagName("li");
                            for (i in sfEls) {
                                sfEls[i].onmouseover=function() {
                                    this.className+=" ie_does_hover";
                                }
                                sfEls[i].onmouseout=function() {
                                    this.className=this.className.replace(new RegExp(" ie_does_hover"), "");
                                }
                            }
                        }
                        if (window.attachEvent) window.attachEvent("onload", sfHover);
                    </script>
      </xsl:if>
    </head>
    <body>
      <div id="documentheader">
        <a id="_toc"> </a>
        <xsl:if test="$dohtmlheader = 'true'">
          <h1 class="title">
            <xsl:call-template name="show-title"/>
          </h1>
          <xsl:call-template name="show-header"/>
        </xsl:if>
        <!-- START TOC and Revision toggle -->
        <xsl:if test="string($useJavascript)='true'">
          <xsl:if test="//hl7:content[@revised] or count(hl7:component/hl7:structuredBody/hl7:component[hl7:section]) > 1">
            <div id="buttontable">
              <table border="0" cellpadding="0" cellspacing="0">
                <tbody>
                  <tr>
                    <xsl:call-template name="make-tableofcontents"/>
                    <xsl:call-template name="make-revisiontoggle"/>
                    <xsl:call-template name="make-sectiontoggle"/>
                  </tr>
                </tbody>
              </table>
            </div>
          </xsl:if>
        </xsl:if>
        <!-- END TOC and Revision toggle -->
      </div>
      <div id="documentbody">
        <xsl:apply-templates select="hl7:component/hl7:structuredBody | hl7:component/hl7:nonXMLBody"/>
      </div>
      <xsl:if test="$dohtmlfooter = 'true'">
        <div id="documentfooter">
          <xsl:call-template name="documentGeneral"/>
          <xsl:call-template name="relatedDocument"/>
          <xsl:call-template name="custodian"/>
          <div class="separator"> </div>
          <xsl:call-template name="recordTarget"/>
          <xsl:call-template name="authorization"/>
          <div class="separator"> </div>
          <xsl:call-template name="documentationOf"/>
          <xsl:call-template name="inFulfillmentOf"/>
          <xsl:call-template name="componentOf"/>
          <div class="separator"> </div>
          <xsl:call-template name="author"/>
          <xsl:call-template name="participant"/>
          <!--xsl:call-template name="participant1"/-->
          <!--xsl:call-template name="participant2"/-->
          <xsl:call-template name="dataEnterer"/>
          <xsl:call-template name="informant"/>
          <xsl:call-template name="informationRecipient"/>
          <xsl:call-template name="authenticator"/>
          <xsl:call-template name="legalAuthenticator"/>
        </div>
      </xsl:if>
    </body>
  </html>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:component/hl7:structuredBody
Documentation

Description

Handle structuredBody

Namespace No namespace
Match hl7:component/hl7:structuredBody
Mode #default
References
Template
Import precedence 0
Source
<xsl:template match="hl7:component/hl7:structuredBody">
  <xsl:for-each select="hl7:component/hl7:section">
    <xsl:call-template name="section">
      <xsl:with-param name="level" select="3"/>
    </xsl:call-template>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:component/hl7:nonXMLBody | hl7:observationMedia
Documentation

Description

Handle nonXMLBody

Parameters

usemap
Namespace No namespace
Match hl7:component/hl7:nonXMLBody | hl7:observationMedia
Mode #default
References
Parameters
QName Namespace
usemap No namespace
Import precedence 0
Source
<xsl:template match="hl7:component/hl7:nonXMLBody | hl7:observationMedia">
  <xsl:param name="usemap"/>
  <xsl:variable name="renderID">
    <xsl:choose>
      <xsl:when test="@ID">
        <xsl:value-of select="@ID"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="concat(generate-id(.), '_', local-name(.))"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="renderAltText">
    <xsl:variable name="i18nid">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'id'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:if test="hl7:id">
      <xsl:value-of select="concat($i18nid, ' = ',hl7:id[1]/@root, ' ', hl7:id[1]/@extension)"/>
    </xsl:if>
  </xsl:variable>
  <xsl:variable name="renderElement" select="self::hl7:nonXMLBody/hl7:text | self::hl7:observationMedia/hl7:value"/>
  <xsl:choose>
    <!-- Minimal mitigation for security risk based on malicious input -->
    <xsl:when test="$renderElement/hl7:reference[starts-with(translate(normalize-space(@value),'JAVASCRIPT','javascript'),'javascript')]">
      <pre title="{$renderAltText}">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'securityRiskURLLabel'"/>
        </xsl:call-template>
        <b>
          <i>
            <xsl:value-of select="$renderElement/hl7:reference/@value"/>
          </i>
        </b>
      </pre>
    </xsl:when>
    <!-- if there is a reference, use that in an iframe -->
    <xsl:when test="$renderElement/hl7:reference">
      <xsl:variable name="source" select="string($renderElement/hl7:reference/@value)"/>
      <xsl:variable name="lcSource" select="translate($source, $uc, $lc)"/>
      <xsl:variable name="scrubbedSource" select="translate($source, $simple-sanitizer-match, $simple-sanitizer-replace)"/>
      <xsl:message>
        <xsl:value-of select="$source"/>,
        <xsl:value-of select="$lcSource"/>
      </xsl:message>
      <xsl:choose>
        <xsl:when test="contains($lcSource,'javascript')">
          <p>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'javascript-injection-warning'"/>
            </xsl:call-template>
          </p>
          <xsl:message>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'javascript-injection-warning'"/>
            </xsl:call-template>
          </xsl:message>
        </xsl:when>
        <xsl:when test="not($source = $scrubbedSource)">
          <p>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'malicious-content-warning'"/>
            </xsl:call-template>
          </p>
          <xsl:message>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'malicious-content-warning'"/>
            </xsl:call-template>
          </xsl:message>
        </xsl:when>
        <xsl:when test="$renderElement[starts-with(@mediaType, 'image/')]">
          <img alt="{$renderAltText}" title="{$renderAltText}" src="{$scrubbedSource}">
            <xsl:if test="string-length($usemap) > 0">
              <xsl:attribute name="usemap">
                <xsl:value-of select="$usemap"/>
              </xsl:attribute>
            </xsl:if>
          </img>
        </xsl:when>
        <xsl:otherwise>
          <iframe name="{$renderID}" id="{$renderID}" width="100%" height="600" src="{$source}" title="{$renderAltText}" sandbox=""/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <!-- This is an image of some sort -->
    <xsl:when test="$renderElement[starts-with(@mediaType,'image/')]">
      <img alt="{$renderAltText}" title="{$renderAltText}">
        <xsl:if test="string-length($usemap) > 0">
          <xsl:attribute name="usemap">
            <xsl:value-of select="$usemap"/>
          </xsl:attribute>
        </xsl:if>
        <xsl:attribute name="src">
          <xsl:value-of select="concat('data:',$renderElement/@mediaType,';base64,',$renderElement/text())"/>
        </xsl:attribute>
      </img>
    </xsl:when>
    <!-- This is something base64 -->
    <xsl:when test="$renderElement[@representation = 'B64']">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'If the contents are not displayed here, it may be offered as a download.'"/>
      </xsl:call-template>
      <iframe name="{$renderID}" id="{$renderID}" width="100%" height="600" title="{$renderAltText}">
        <xsl:attribute name="src">
          <xsl:value-of select="concat('data:', $renderElement/@mediaType, ';base64,', $renderElement/text())"/>
        </xsl:attribute>
      </iframe>
    </xsl:when>
    <!-- This is plain text -->
    <xsl:when test="$renderElement[not(@mediaType) or @mediaType='text/plain']">
      <pre title="{$renderAltText}">
        <xsl:value-of select="$renderElement/text()"/>
      </pre>
    </xsl:when>
    <xsl:otherwise>
      <pre title="{$renderAltText}">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'Cannot display the text'"/>
        </xsl:call-template>
      </pre>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section
Documentation

Description

component/section: display title and text, and process any nested component/sections increasing margin-left as we go deeper

Parameters

level Header level element to call, e.g. h1, h2 or h3
margin Margin defined in em
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
level No namespace 3
margin No namespace 0
Import precedence 0
Source
<xsl:template name="section">
  <xsl:param name="level" select="3"/>
  <xsl:param name="margin" select="0"/>
  <div style="margin-left: {$margin}em;" class="section">
    <div class="section-title">
      <xsl:if test="string($useJavascript)='true'">
        <div class="button expandCollapse" onclick="collapseSection(this)">
          <xsl:attribute name="title">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Collapse'"/>
            </xsl:call-template>
          </xsl:attribute>
          <xsl:text></xsl:text>
        </div>
      </xsl:if>
      <xsl:call-template name="section-title">
        <xsl:with-param name="level" select="$level"/>
      </xsl:call-template>
    </div>
    <div class="section-content">
      <xsl:if test="hl7:author | hl7:informant | hl7:subject">
        <div class="section-meta">
          <xsl:call-template name="section-author"/>
          <xsl:call-template name="section-informant"/>
          <xsl:call-template name="section-subject"/>
        </div>
      </xsl:if>
      <div class="section-body">
        <xsl:if test="hl7:text">
          <xsl:call-template name="section-text"/>
        </xsl:if>
        <xsl:for-each select="hl7:component/hl7:section">
          <xsl:call-template name="section">
            <xsl:with-param name="margin" select="$margin + 2"/>
          </xsl:call-template>
        </xsl:for-each>
        <xsl:if test="not(hl7:text | hl7:component/hl7:section)">
          <xsl:text> </xsl:text>
        </xsl:if>
      </div>
    </div>
  </div>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section-title
Documentation

Description

Produces a section title with at least an anchor based on relative position in the document (for the Table of Contents), and a second anchor if the section has the @ID tag

Parameters

level Header level element to call, e.g. h1, h2 or h3
Namespace No namespace
Used by
Template
References
Template
Parameters
QName Namespace Select
level No namespace 3
Import precedence 0
Source
<xsl:template name="section-title">
  <xsl:param name="level" select="3"/>
  <!--<xsl:if test="@ID">
            <a name="{@ID}"/>
        </xsl:if>-->
  <xsl:element name="{concat('h', $level)}">
    <xsl:attribute name="id">
      <xsl:choose>
        <xsl:when test="@ID">
          <xsl:value-of select="@ID"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:apply-templates select="." mode="getAnchorName"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:attribute>
    <xsl:if test="hl7:code">
      <xsl:attribute name="title">
        <xsl:call-template name="show-code-set">
          <xsl:with-param name="in" select="hl7:code"/>
          <xsl:with-param name="sep" select="', '"/>
        </xsl:call-template>
      </xsl:attribute>
    </xsl:if>
    <xsl:choose>
      <xsl:when test="count(hl7:component/hl7:structuredBody/hl7:component[hl7:section]) > 1">
        <!-- Add link to go back to top if the document has more than one section, otherwise superfluous -->
        <a href="#_toc">
          <xsl:apply-templates select="." mode="getTitleName"/>
        </a>
      </xsl:when>
      <xsl:otherwise>
        <xsl:apply-templates select="." mode="getTitleName"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:element>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:sectiongetNumbering
Documentation

Description

Produces a legal style of numbering for a section. E.g. 1.1, 1.2.1, 1.2.2 etc.

Namespace No namespace
Match hl7:section
Mode getNumbering
Import precedence 0
Source
<xsl:template match="hl7:section" mode="getNumbering">
  <xsl:for-each select="ancestor-or-self::hl7:section">
    <xsl:value-of select="count(parent::hl7:component/preceding-sibling::hl7:component) + 1"/>
    <xsl:if test="position() != last()">
      <xsl:text>.</xsl:text>
    </xsl:if>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:sectiongetAnchorName
Documentation

Description

Produces an anchor name suitable for the HTML <a/> tag

Namespace No namespace
Match hl7:section
Mode getAnchorName
Import precedence 0
Source
<xsl:template match="hl7:section" mode="getAnchorName">
  <xsl:value-of select="'section_'"/>
  <xsl:apply-templates select="." mode="getNumbering"/>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:sectiongetTitleName
Documentation

Description

Produces a human readable section title based on its title, or code as fallback

Namespace No namespace
Match hl7:section
Mode getTitleName
References
Import precedence 0
Source
<xsl:template match="hl7:section" mode="getTitleName">
  <xsl:if test="$dosectionnumbering = 'true'">
    <xsl:apply-templates select="." mode="getNumbering"/>
    <xsl:text> </xsl:text>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="hl7:title">
      <xsl:call-template name="show-text-set">
        <xsl:with-param name="in" select="hl7:title"/>
        <xsl:with-param name="sep" select="', '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="hl7:code">
      <xsl:call-template name="show-code-set">
        <xsl:with-param name="in" select="hl7:code"/>
        <xsl:with-param name="sep" select="', '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="hl7:id">
      <xsl:call-template name="show-id-set">
        <xsl:with-param name="in" select="hl7:id"/>
        <xsl:with-param name="sep" select="', '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'section'"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section-author
Documentation

Description

Handle section author

Namespace No namespace
Used by
Template
References
Import precedence 0
Source
<xsl:template name="section-author">
  <xsl:if test="hl7:author">
    <div>
      <b>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'sectionAuthor'"/>
          <xsl:with-param name="post" select="': '"/>
        </xsl:call-template>
      </b>
      <div>
        <ul>
          <xsl:for-each select="hl7:author">
            <li>
              <xsl:choose>
                <xsl:when test="hl7:assignedAuthor/hl7:assignedPerson">
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:assignedPerson/hl7:name"/>
                  </xsl:call-template>
                  <xsl:if test="hl7:assignedAuthor/hl7:assignedPerson/hl7:desc">
                    <div>
                      <xsl:value-of select="hl7:assignedAuthor/hl7:assignedPerson/hl7:desc"/>
                    </div>
                  </xsl:if>
                  <xsl:if test="hl7:assignedAuthor/hl7:assignedPerson/hl7:birthTime">
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'birthTimeLong'"/>
                    </xsl:call-template>
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="show-timestamp">
                      <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:assignedPerson/hl7:birthTime"/>
                    </xsl:call-template>
                  </xsl:if>
                </xsl:when>
                <xsl:when test="hl7:assignedAuthor/hl7:assignedAuthoringDevice">
                  <xsl:value-of select="hl7:assignedAuthor/hl7:assignedAuthoringDevice/hl7:softwareName"/>
                </xsl:when>
                <xsl:when test="hl7:assignedAuthor/hl7:assignedDevice/hl7:softwareName">
                  <xsl:value-of select="hl7:assignedAuthor/hl7:assignedDevice/hl7:softwareName/@value"/>
                </xsl:when>
                <xsl:when test="hl7:assignedAuthor/hl7:id">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'id'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                  <xsl:call-template name="show-id-set">
                    <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:id"/>
                  </xsl:call-template>
                </xsl:when>
              </xsl:choose>
              <xsl:if test="hl7:assignedAuthor/hl7:code">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="pre" select="' - '"/>
                  <xsl:with-param name="key" select="'code'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:code"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:choose>
                <xsl:when test="hl7:assignedAuthor/hl7:representedOrganization/hl7:name">
                  <xsl:text>, </xsl:text>
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'organization'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:representedOrganization/hl7:name"/>
                  </xsl:call-template>
                </xsl:when>
                <xsl:when test="hl7:assignedAuthor/hl7:representedOrganization/hl7:id">
                  <xsl:text>, </xsl:text>
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'organization'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                  <xsl:call-template name="show-id-set">
                    <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:representedOrganization/hl7:id"/>
                  </xsl:call-template>
                </xsl:when>
              </xsl:choose>
              <xsl:if test="hl7:assignedAuthor/hl7:telecom">
                <br/>
                <xsl:call-template name="show-telecom-set">
                  <xsl:with-param name="in" select="hl7:assignedAuthor/hl7:telecom"/>
                </xsl:call-template>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </div>
    </div>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section-informant
Documentation

Description

Handle section informant

Namespace No namespace
Used by
Template
References
Import precedence 0
Source
<xsl:template name="section-informant">
  <xsl:if test="hl7:informant">
    <div>
      <b>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'sectionInformant'"/>
          <xsl:with-param name="post" select="': '"/>
        </xsl:call-template>
      </b>
      <div>
        <ul>
          <xsl:for-each select="hl7:informant">
            <li>
              <xsl:choose>
                <xsl:when test="hl7:relatedEntity">
                  <xsl:choose>
                    <xsl:when test="hl7:relatedEntity/hl7:code">
                      <xsl:text>(</xsl:text>
                      <xsl:call-template name="show-code-set">
                        <xsl:with-param name="in" select="hl7:relatedEntity/hl7:code"/>
                      </xsl:call-template>
                      <xsl:text>) </xsl:text>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:text>(</xsl:text>
                      <xsl:call-template name="getLocalizedString">
                        <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.110-',hl7:relatedEntity/@classCode)"/>
                      </xsl:call-template>
                      <xsl:text>) </xsl:text>
                    </xsl:otherwise>
                  </xsl:choose>
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:relatedEntity/hl7:relatedPerson/hl7:name"/>
                  </xsl:call-template>
                  <xsl:if test="hl7:relatedEntity/hl7:relatedPerson/hl7:desc">
                    <div>
                      <xsl:value-of select="hl7:relatedEntity/hl7:relatedPerson/hl7:desc"/>
                    </div>
                  </xsl:if>
                  <xsl:if test="hl7:relatedEntity/hl7:relatedPerson/hl7:birthTime">
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'birthTimeLong'"/>
                    </xsl:call-template>
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="show-timestamp">
                      <xsl:with-param name="in" select="hl7:relatedEntity/hl7:relatedPerson/hl7:birthTime"/>
                    </xsl:call-template>
                  </xsl:if>
                </xsl:when>
                <xsl:when test="hl7:assignedEntity">
                  <xsl:choose>
                    <xsl:when test="hl7:assignedEntity/hl7:assignedPerson/hl7:name">
                      <xsl:call-template name="show-name-set">
                        <xsl:with-param name="in" select="hl7:assignedEntity/hl7:assignedPerson/hl7:name"/>
                      </xsl:call-template>
                      <xsl:if test="hl7:assignedEntity/hl7:assignedPerson/hl7:desc">
                        <div>
                          <xsl:value-of select="hl7:assignedEntity/hl7:assignedPerson/hl7:desc"/>
                        </div>
                      </xsl:if>
                      <xsl:if test="hl7:assignedEntity/hl7:assignedPerson/hl7:birthTime">
                        <xsl:text> </xsl:text>
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="key" select="'birthTimeLong'"/>
                        </xsl:call-template>
                        <xsl:text> </xsl:text>
                        <xsl:call-template name="show-timestamp">
                          <xsl:with-param name="in" select="hl7:assignedEntity/hl7:assignedPerson/hl7:birthTime"/>
                        </xsl:call-template>
                      </xsl:if>
                    </xsl:when>
                    <xsl:when test="hl7:assignedEntity/hl7:id">
                      <xsl:call-template name="getLocalizedString">
                        <xsl:with-param name="key" select="'id'"/>
                        <xsl:with-param name="post" select="': '"/>
                      </xsl:call-template>
                      <xsl:call-template name="show-id-set">
                        <xsl:with-param name="in" select="hl7:assignedEntity/hl7:id"/>
                        <xsl:with-param name="sep" select="', '"/>
                      </xsl:call-template>
                    </xsl:when>
                  </xsl:choose>
                  <xsl:if test="hl7:assignedEntity/hl7:representedOrganization">
                    <xsl:text>, </xsl:text>
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'organization'"/>
                      <xsl:with-param name="post" select="': '"/>
                    </xsl:call-template>
                    <xsl:call-template name="show-name-set">
                      <xsl:with-param name="in" select="hl7:assignedEntity/hl7:representedOrganization/hl7:name"/>
                      <xsl:with-param name="sep" select="', '"/>
                    </xsl:call-template>
                  </xsl:if>
                  <xsl:if test="hl7:assignedEntity/hl7:representedOrganization/hl7:telecom">
                    <xsl:text>, </xsl:text>
                    <xsl:call-template name="show-telecom-set">
                      <xsl:with-param name="in" select="hl7:assignedEntity/hl7:representedOrganization/hl7:telecom"/>
                      <xsl:with-param name="sep" select="', '"/>
                    </xsl:call-template>
                  </xsl:if>
                </xsl:when>
              </xsl:choose>
              <xsl:if test="hl7:relatedEntity/hl7:telecom | hl7:assignedEntity/hl7:telecom">
                <br/>
                <xsl:call-template name="show-telecom-set">
                  <xsl:with-param name="in" select="hl7:relatedEntity/hl7:telecom | hl7:assignedEntity/hl7:telecom"/>
                </xsl:call-template>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </div>
    </div>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section-subject
Documentation

Description

Handle section subject

Namespace No namespace
Used by
Template
References
Import precedence 0
Source
<xsl:template name="section-subject">
  <xsl:if test="hl7:subject">
    <div>
      <b>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'sectionSubject'"/>
          <xsl:with-param name="post" select="': '"/>
        </xsl:call-template>
      </b>
      <div>
        <ul>
          <xsl:for-each select="hl7:subject">
            <li>
              <xsl:if test="hl7:relatedSubject/hl7:subject/hl7:name">
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:subject/hl7:name"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:code">
                <xsl:text> - </xsl:text>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'code'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:code"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:subject[*[local-name() = 'birthTime'] | *[local-name() = 'deceasedInd'] | *[local-name() = 'birthdeceasedTime'] | *[local-name() = 'multipleBirthInd'] | *[local-name() = 'multipleBirthOrderNumber']]">
                <xsl:text>, </xsl:text>
                <xsl:call-template name="show-birthDeathTime-multipleBirth">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:subject"/>
                  <xsl:with-param name="clinicalDocumentEffectiveTime" select="ancestor-or-self::hl7:ClinicalDocument/hl7:effectiveTime/@value"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:subject/hl7:administrativeGenderCode">
                <xsl:text>, </xsl:text>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'administrativeGenderCode'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:subject/hl7:administrativeGenderCode"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:subject/hl7:raceCode">
                <xsl:text>, </xsl:text>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Race'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:subject/hl7:raceCode"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:subject/hl7:ethnicGroupCode">
                <xsl:text>, </xsl:text>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Ethnicity'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:relatedSubject/hl7:subject/hl7:ethnicGroupCode"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:relatedSubject/hl7:telecom">
                <div>
                  <xsl:call-template name="show-telecom-set">
                    <xsl:with-param name="in" select="hl7:relatedSubject/hl7:telecom"/>
                  </xsl:call-template>
                </div>
              </xsl:if>
            </li>
          </xsl:for-each>
        </ul>
      </div>
    </div>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template section-text
Documentation

Description

Puts a div around the Section.text and hands it off to other templates

Namespace No namespace
Used by
Template
Import precedence 0
Source
<xsl:template name="section-text">
  <div>
    <xsl:apply-templates select="hl7:text"/>
  </div>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:paragraph
Documentation

Description

Handle paragraph

Namespace No namespace
Match hl7:paragraph
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:paragraph">
  <p>
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <!--<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-->
    <xsl:apply-templates/>
  </p>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:linkHtml
Documentation

Description

Handle linkHtml

Namespace No namespace
Match hl7:linkHtml
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:linkHtml">
  <xsl:element name="a">
    <xsl:apply-templates select="." mode="handleSectionTextAttributes">
      <xsl:with-param name="class">linkHtml</xsl:with-param>
    </xsl:apply-templates>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:pre
Documentation

Description

Handle pre

Namespace No namespace
Match hl7:pre
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:pre">
  <pre>
    <xsl:apply-templates/>
  </pre>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:content
Documentation

Description

Handle content. Content w/ deleted text is hidden

Namespace No namespace
Match hl7:content
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:content">
  <span>
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <!--<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-->
    <!-- IHE PCC MCV -->
    <!--<xsl:if test="@styleCode = 'xHR' or starts-with(@styleCode, 'xHR ')">
                <hr class="xHR"/>
            </xsl:if>-->
    <xsl:apply-templates/>
  </span>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:br
Documentation

Description

Handle line break

Namespace No namespace
Match hl7:br
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:br">
  <xsl:element name="br">
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:list
Documentation

Description

Handle list

Namespace No namespace
Match hl7:list
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:list">
  <!-- caption -->
  <xsl:if test="hl7:caption">
    <div style="font-weight:bold; ">
      <xsl:apply-templates select="hl7:caption"/>
    </div>
  </xsl:if>
  <!-- item -->
  <xsl:choose>
    <xsl:when test="@listType='ordered'">
      <ol>
        <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
        <!--<xsl:if test="@ID">
                        <a name="{@ID}"/>
                    </xsl:if>-->
        <xsl:for-each select="hl7:item">
          <li>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!--<xsl:if test="@ID">
                                <a name="{@ID}"/>
                            </xsl:if>-->
            <xsl:apply-templates/>
          </li>
        </xsl:for-each>
      </ol>
    </xsl:when>
    <xsl:otherwise>
      <!-- list is unordered -->
      <ul>
        <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
        <!--<xsl:if test="@ID">
                        <a name="{@ID}"/>
                    </xsl:if>-->
        <xsl:for-each select="hl7:item">
          <li>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!--<xsl:if test="@ID">
                                <a name="{@ID}"/>
                            </xsl:if>-->
            <xsl:apply-templates/>
          </li>
        </xsl:for-each>
      </ul>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:caption
Documentation

Description

Handle caption

Namespace No namespace
Match hl7:caption
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:caption">
  <xsl:choose>
    <xsl:when test="parent::hl7:table">
      <caption>
        <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
        <!--<xsl:if test="@ID">
                        <a name="{@ID}"/>
                    </xsl:if>-->
        <xsl:apply-templates/>
      </caption>
    </xsl:when>
    <xsl:otherwise>
      <div class="caption">
        <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
        <!--<xsl:if test="@ID">
                        <a name="{@ID}"/>
                    </xsl:if>-->
        <xsl:apply-templates/>
      </div>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:footnote
Documentation

Description

Handle footnote

Namespace No namespace
Match hl7:footnote
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:footnote">
  <xsl:variable name="id" select="@ID"/>
  <xsl:variable name="footNoteNum">
    <xsl:for-each select="//hl7:footnote">
      <xsl:if test="@ID = $id">
        <xsl:value-of select="position()"/>
      </xsl:if>
    </xsl:for-each>
  </xsl:variable>
  <div>
    <xsl:apply-templates select="." mode="handleSectionTextAttributes">
      <xsl:with-param name="class" select="'narr_footnote'"/>
    </xsl:apply-templates>
    <xsl:text>[</xsl:text>
    <xsl:value-of select="$footNoteNum"/>
    <xsl:text>]. </xsl:text>
    <xsl:apply-templates/>
  </div>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:footnoteRef
Documentation

Description

Handle footnoteRef. Produces a superscript [n] where n is the occurence number of this ref in the whole document. Also adds a title with the first 50 characters of th footnote on the number so you don't have to navigate to the footnote and just continue to read.

Namespace No namespace
Match hl7:footnoteRef
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:footnoteRef">
  <xsl:variable name="idref" select="@IDREF"/>
  <xsl:variable name="footNoteNum">
    <xsl:for-each select="//hl7:footnote">
      <xsl:if test="@ID = $idref">
        <xsl:value-of select="position()"/>
      </xsl:if>
    </xsl:for-each>
  </xsl:variable>
  <xsl:variable name="footNoteText">
    <xsl:copy-of select="//hl7:footnote[@ID = $idref]//text()"/>
  </xsl:variable>
  <sup>
    <xsl:text>[</xsl:text>
    <a href="#{$idref}">
      <!-- Render footnoteref with the first 50 characters of the text -->
      <xsl:attribute name="title">
        <xsl:value-of select="substring($footNoteText, 1, 50)"/>
        <xsl:if test="string-length($footNoteText) > 50">
          <xsl:text>...</xsl:text>
        </xsl:if>
      </xsl:attribute>
      <xsl:value-of select="$footNoteNum"/>
    </a>
    <xsl:text>]</xsl:text>
  </sup>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:table | hl7:thead | hl7:tfoot | hl7:tbody | hl7:colgroup | hl7:col | hl7:tr | hl7:th | hl7:td
Documentation

Description

Handle table and constituents of table
Namespace No namespace
Match hl7:table | hl7:thead | hl7:tfoot | hl7:tbody | hl7:colgroup | hl7:col | hl7:tr | hl7:th | hl7:td
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:table | hl7:thead | hl7:tfoot | hl7:tbody | hl7:colgroup | hl7:col | hl7:tr | hl7:th | hl7:td">
  <xsl:element name="{local-name()}">
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <!--<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-->
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template check-external-image-whitelist
Documentation

Description

Security measure. Only process images on the image whitelist

Parameters

current-whitelist
image-uri
altTitleText

Description

<xd:doc>
        <xd:desc>
            <xd:p>Handle table</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:table">
        <table>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes">
                <xsl:with-param name="class" select="'narr_table'"/>
            </xsl:apply-templates>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </table>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle thead</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:thead">
        <thead>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </thead>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle tfoot</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:tfoot">
        <tfoot>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </tfoot>
    </xsl:template>
    
    <xd:doc>
        <xd:desc>
            <xd:p>Handle tbody</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:tbody">
        <tbody>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </tbody>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle colgroup</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:colgroup">
        <colgroup>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </colgroup>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle col</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:col">
        <col>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </col>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle tr</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:tr">
        <tr>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes">
                <xsl:with-param name="class" select="'narr_tr'"/>
            </xsl:apply-templates>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </tr>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle th</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:th">
        <th>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes">
                <xsl:with-param name="class" select="'narr_th'"/>
            </xsl:apply-templates>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </th>
    </xsl:template>

    <xd:doc>
        <xd:desc>
            <xd:p>Handle td</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:td">
        <td>
            <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
            <!-\-<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-\->
            <xsl:apply-templates/>
        </td>
    </xsl:template>
Namespace No namespace
Used by
References
Parameters
QName Namespace
altTitleText No namespace
current-whitelist No namespace
image-uri No namespace
Import precedence 0
Source
<xsl:template name="check-external-image-whitelist">
  <xsl:param name="current-whitelist"/>
  <xsl:param name="image-uri"/>
  <xsl:param name="altTitleText"/>
  <xsl:choose>
    <xsl:when test="string-length($current-whitelist) > 0">
      <xsl:variable name="whitelist-item">
        <xsl:choose>
          <xsl:when test="contains($current-whitelist,'|')">
            <xsl:value-of select="substring-before($current-whitelist,'|')"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$current-whitelist"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="starts-with($image-uri,$whitelist-item)">
          <br clear="all"/>
          <img src="{$image-uri}" alt="{$altTitleText}" title="{$altTitleText}"/>
          <xsl:message>
            <xsl:value-of select="$image-uri"/>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'is-in-the-whitelist'"/>
            </xsl:call-template>
          </xsl:message>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="check-external-image-whitelist">
            <xsl:with-param name="current-whitelist" select="substring-after($current-whitelist,'|')"/>
            <xsl:with-param name="image-uri" select="$image-uri"/>
            <xsl:with-param name="altTitleText" select="$altTitleText"/>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:otherwise>
      <p>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'non-local-image-found-1'"/>
        </xsl:call-template>
        <xsl:value-of select="$image-uri"/>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'non-local-image-found-2'"/>
        </xsl:call-template>
      </p>
      <xsl:message>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'non-local-image-found-1'"/>
        </xsl:call-template>
        <xsl:value-of select="$image-uri"/>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'non-local-image-found-2'"/>
        </xsl:call-template>
      </xsl:message>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:renderMultiMedia
Documentation

Description

Handle RenderMultiMedia. This currently only handles GIF's and JPEG's. It could, however, be extended by including other image MIME types in the predicate and/or by generating <object> or <applet> tag with the correct params depending on the media type @ID =$imageRef referencedObject

Namespace No namespace
Match hl7:renderMultiMedia
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:renderMultiMedia">
  <xsl:variable name="imageRefs" select="@referencedObject"/>
  <!--<xsl:variable name="imageRefs">
            <xsl:call-template name="tokenize">
                <xsl:with-param name="string" select="@referencedObject"/>
                <xsl:with-param name="delimiters" select="' '"/>
            </xsl:call-template>
        </xsl:variable>-->
  <xsl:variable name="referencedObjects" select="ancestor::hl7:ClinicalDocument//hl7:regionOfInterest[@ID = $imageRefs] | ancestor::hl7:ClinicalDocument//hl7:observationMedia[@ID = $imageRefs]"/>
  <br/>
  <span>
    <xsl:apply-templates select="hl7:caption"/>
    <xsl:for-each select="$referencedObjects">
      <xsl:choose>
        <xsl:when test="self::hl7:regionOfInterest">
          <!-- What we actually would want is an svg with fallback to just the image that renders the ROI on top of image
                            The only example (in the CDA standard itself) that we've seen so far has unusable coordinates. That for now
                            is not very encouraging to put in the effort, so we just render the images for now
                        -->
          <xsl:apply-templates select=".//hl7:observationMedia">
            <!--<xsl:with-param name="usemap" select="@ID"/>-->
          </xsl:apply-templates>
          <!--<xsl:variable name="coords">
                            <xsl:variable name="tcoords">
                                <xsl:for-each select="hl7:value/@value">
                                    <xsl:value-of select="."/>
                                    <xsl:text> </xsl:text>
                                </xsl:for-each>
                            </xsl:variable>
                            <xsl:value-of select="translate(normalize-space($tcoords),' ',',')"/>
                        </xsl:variable>-->
          <!--<svg id="graph" width="100%" height="400px" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="https://www.w3.org/1999/xlink">
                            <!-\- pattern -\->
                            <defs>
                                <pattern id="image" x="0%" y="0%" height="100%" width="100%" viewBox="0 0 512 512">
                                    <image x="0%" y="0%" width="512" height="512" xlink:href="https://cdn3.iconfinder.com/data/icons/people-professions/512/Baby-512.png"/>
                                </pattern>
                            </defs>
                            <circle id="sd" class="medium" cx="5%" cy="40%" r="5%" fill="url(#image)" stroke="lightblue" stroke-width="0.5%"/>
                        </svg>-->
          <!--<map id="{@ID}" name="{@ID}">
                            <xsl:choose>
                                <!-\- A circle defined by two (column,row) pairs. The first point is the center of the circle and the second point is a point on the perimeter of the circle. -\->
                                <xsl:when test="hl7:code/@code = 'CIRCLE'">
                                    <area shape="circle" coords="{$coords}" alt="Computer" href="computer.htm"/>
                                </xsl:when>
                                <!-\- An ellipse defined by four (column,row) pairs, the first two points specifying the endpoints of the major axis and the second two points specifying the endpoints of the minor axis. -\->
                                <xsl:when test="hl7:code/@code = 'ELLIPSE'">
                                    <area shape="poly" coords="{$coords}" alt="Computer" href="computer.htm"/>
                                </xsl:when>
                                <!-\- A single point denoted by a single (column,row) pair, or multiple points each denoted by a (column,row) pair. -\->
                                <xsl:when test="hl7:code/@code = 'POINT'">
                                    <area shape="poly" coords="{$coords}" alt="Computer" href="computer.htm"/>
                                </xsl:when>
                                <!-\- A series of connected line segments with ordered vertices denoted by (column,row) pairs; if the first and last vertices are the same, it is a closed polygon. -\->
                                <xsl:when test="hl7:code/@code = 'POLY'">
                                    <area shape="poly" coords="{$coords}" alt="Computer" href="computer.htm"/>
                                </xsl:when>
                            </xsl:choose>
                        </map>-->
        </xsl:when>
        <!-- Here is where the direct MultiMedia image referencing goes -->
        <xsl:when test="self::hl7:observationMedia">
          <xsl:apply-templates select="."/>
        </xsl:when>
      </xsl:choose>
    </xsl:for-each>
  </span>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:sup
Documentation

Description

Handle superscript

Namespace No namespace
Match hl7:sup
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:sup">
  <sup>
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <!--<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-->
    <xsl:apply-templates/>
  </sup>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:sub
Documentation

Description

Handle subscript

Namespace No namespace
Match hl7:sub
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:sub">
  <sub>
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <!--<xsl:if test="@ID">
                <a name="{@ID}"/>
            </xsl:if>-->
    <xsl:apply-templates/>
  </sub>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template *handleSectionTextAttributes
Documentation

Description

Attribute processing for CDAr2 and CDAr3

Parameters

class If valued then this gets added to potential other class codes
Namespace No namespace
Match *
Mode handleSectionTextAttributes
References
Parameters
QName Namespace
class No namespace
Import precedence 0
Source
<xsl:template match="*" mode="handleSectionTextAttributes">
  <xsl:param name="class">
    <xsl:choose>
      <xsl:when test="local-name() = 'table'">narr_table</xsl:when>
      <xsl:when test="local-name() = 'tr'">narr_tr</xsl:when>
      <xsl:when test="local-name() = 'th'">narr_th</xsl:when>
    </xsl:choose>
  </xsl:param>
  <xsl:variable name="classes">
    <xsl:if test="string-length($class)">
      <xsl:value-of select="$class"/>
    </xsl:if>
    <xsl:if test="@revised">
      <xsl:text> </xsl:text>
      <xsl:text>revision_</xsl:text>
      <xsl:value-of select="@revised"/>
      <xsl:text>_final</xsl:text>
    </xsl:if>
    <xsl:if test="@styleCode">
      <xsl:text> </xsl:text>
      <xsl:value-of select="@styleCode"/>
    </xsl:if>
    <xsl:if test="@class">
      <xsl:text> </xsl:text>
      <xsl:value-of select="@class"/>
    </xsl:if>
  </xsl:variable>
  <xsl:variable name="elem-name" select="local-name(.)"/>
  <!-- Write @class attribute if there's data for it -->
  <xsl:if test="string-length(normalize-space($classes))>0">
    <xsl:attribute name="class">
      <xsl:value-of select="normalize-space($classes)"/>
    </xsl:attribute>
  </xsl:if>
  <!-- Write title with @revised (CDAr1 / CDAr2) prefixing to @title if one exists already -->
  <xsl:if test="@revised">
    <xsl:attribute name="title">
      <xsl:value-of select="normalize-space(concat(@revised,' ',@title))"/>
    </xsl:attribute>
  </xsl:if>
  <!-- Write default table cellspacing / cellpadding -->
  <xsl:if test="self::hl7:table">
    <xsl:if test="not(@cellspacing)">
      <xsl:attribute name="cellspacing">
        <xsl:value-of select="'1'"/>
      </xsl:attribute>
    </xsl:if>
    <xsl:if test="not(@cellpadding)">
      <xsl:attribute name="cellpadding">
        <xsl:value-of select="'1'"/>
      </xsl:attribute>
    </xsl:if>
  </xsl:if>
  <xsl:for-each select="@*">
    <xsl:sort select="local-name()" order="descending"/>
    <xsl:variable name="attr-name" select="local-name(.)"/>
    <xsl:variable name="attr-value" select="."/>
    <xsl:variable name="lcSource" select="translate($attr-value, $uc, $lc)"/>
    <xsl:variable name="scrubbedSource" select="translate($attr-value, $simple-sanitizer-match, $simple-sanitizer-replace)"/>
    <xsl:choose>
      <xsl:when test="contains($lcSource,'javascript')">
        <xsl:variable name="warningText">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'javascript-injection-warning'"/>
            <xsl:with-param name="post" select="': '"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:message terminate="yes">
          <xsl:value-of select="$warningText"/>
          <xsl:value-of select="$attr-value"/>
        </xsl:message>
        <xsl:if test="$attr-name = 'href'">
          <xsl:attribute name="title">
            <xsl:value-of select="concat(normalize-space(concat(../@title, ' ', $warningText)), ' ', $attr-value)"/>
          </xsl:attribute>
        </xsl:if>
      </xsl:when>
      <xsl:when test="not($attr-value = $scrubbedSource)">
        <xsl:variable name="warningText">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'malicious-content-warning'"/>
            <xsl:with-param name="post" select="': '"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:message>
          <xsl:value-of select="$warningText"/>
          <xsl:value-of select="$attr-value"/>
        </xsl:message>
        <xsl:if test="$attr-name = 'href'">
          <xsl:attribute name="title">
            <xsl:value-of select="concat(normalize-space(concat(../@title, ' ', $warningText)), ' ', $attr-value)"/>
          </xsl:attribute>
        </xsl:if>
      </xsl:when>
      <xsl:when test="exslt:node-set($table-elem-attrs)/elem[@name = $elem-name] and                                  not(exslt:node-set($table-elem-attrs)//elem[@name = $elem-name]/attr[@name = $attr-name])">
        <xsl:message>
          <xsl:value-of select="$attr-name"/>is not legal in
          <xsl:value-of select="$elem-name"/>
        </xsl:message>
      </xsl:when>
      <!-- Regular handling from here -->
      <xsl:when test="$attr-name = 'ID'">
        <xsl:attribute name="id">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'class'">
        <!-- Already handled -->
      </xsl:when>
      <xsl:when test="$attr-name = 'revised'">
        <!-- Already handled -->
      </xsl:when>
      <xsl:when test="$attr-name = 'styleCode'">
        <!-- Already handled -->
      </xsl:when>
      <xsl:when test="$attr-name = 'ID'">
        <!-- @ID should be handled in a name tag, so don't add here -->
      </xsl:when>
      <xsl:when test="$attr-name = 'IDREF'">
        <!-- @IDREF doubtful. Should be in an href attribute, but doesn't hurt to add here -->
        <xsl:attribute name="idref">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'language'">
        <xsl:attribute name="lang">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <!-- Table stuff -->
      <xsl:when test="$attr-name = 'border'">
        <xsl:attribute name="border">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'frame'">
        <xsl:attribute name="frame">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'rules'">
        <xsl:attribute name="rules">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'cellpadding'">
        <xsl:attribute name="cellpadding">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'cellspacing'">
        <xsl:attribute name="cellspacing">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'span'">
        <xsl:attribute name="span">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'summary'">
        <xsl:attribute name="summary">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'width'">
        <xsl:attribute name="width">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'align'">
        <xsl:attribute name="align">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'valign'">
        <xsl:attribute name="valign">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'char'">
        <xsl:attribute name="char">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'charoff'">
        <xsl:attribute name="charoff">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'abbr'">
        <xsl:attribute name="abbr">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'scope'">
        <xsl:attribute name="scope">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'headers'">
        <xsl:attribute name="headers">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'axis'">
        <xsl:attribute name="axis">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'colspan'">
        <xsl:attribute name="colspan">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'rowspan'">
        <xsl:attribute name="rowspan">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <!-- LinkHTML stuff -->
      <xsl:when test="$attr-name = 'name'">
        <xsl:attribute name="name">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'rel'">
        <xsl:attribute name="rel">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'href'">
        <xsl:attribute name="href">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'title'">
        <xsl:attribute name="title">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:when test="$attr-name = 'rev'">
        <xsl:attribute name="rev">
          <xsl:value-of select="."/>
        </xsl:attribute>
      </xsl:when>
      <xsl:otherwise>
        <!-- For CDAr3 we might get a slew of attributes not catered for explicitly, 
                        but supposedly HTML compatible so just could add them as-is -->
        <!-- However... CDAr3 never happened and this poses a security risk, so ignore -->
        <!--<xsl:attribute name="{$attr-name}">
                        <xsl:value-of select="."/>
                    </xsl:attribute>-->
      </xsl:otherwise>
    </xsl:choose>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template hl7:a | hl7:dd | hl7:dl | hl7:img | hl7:ins | hl7:span | hl7:p | hl7:ol | hl7:ul| hl7:li
Documentation

Description

Handle HTML like CDAr3 style Section.text elements that are not handled already above


Description

 
        ====================================
        START CDAr3 NarrativeBlock specifics
        ====================================
    
Namespace No namespace
Match hl7:a | hl7:dd | hl7:dl | hl7:img | hl7:ins | hl7:span | hl7:p | hl7:ol | hl7:ul| hl7:li
Mode #default
Import precedence 0
Source
<xsl:template match="hl7:a | hl7:dd | hl7:dl | hl7:img | hl7:ins | hl7:span | hl7:p | hl7:ol | hl7:ul| hl7:li">
  <xsl:element name="{local-name()}" namespace="http://www.w3.org/1999/xhtml">
    <xsl:apply-templates select="." mode="handleSectionTextAttributes"/>
    <xsl:apply-templates/>
  </xsl:element>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-title
Documentation

Description

Handle the document title based on the ClinicalDocument.title, ClinicalDocument.code or finally just 'Clinical Document'


Description

 
        ==================================
        END CDAr3 NarrativeBlock specifics
        ==================================
    
Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="show-title">
  <xsl:variable name="documentEffectiveTime">
    <xsl:call-template name="show-timestamp">
      <xsl:with-param name="in" select="hl7:effectiveTime"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:choose>
    <!-- CDAr2 DTr1 -->
    <xsl:when test="string-length(hl7:title) > 0">
      <xsl:value-of select="hl7:title"/>
    </xsl:when>
    <!-- CDAr3 DTr2 -->
    <xsl:when test="string-length(hl7:title/@value) > 0">
      <xsl:value-of select="hl7:title/@value"/>
    </xsl:when>
    <!-- CDAr2 DTr1 -->
    <xsl:when test="hl7:code/@displayName">
      <xsl:value-of select="hl7:code/@displayName"/>
    </xsl:when>
    <!-- CDAr3 DTr2 -->
    <xsl:when test="hl7:code/hl7:displayName/@value">
      <xsl:value-of select="hl7:code/hl7:displayName/@value"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'Clinical Document'"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
  <xsl:text> (</xsl:text>
  <xsl:value-of select="normalize-space($documentEffectiveTime)"/>
  <xsl:if test="hl7:confidentialityCode[@code[not(. = 'N')]]">
    <xsl:text> </xsl:text>
    <xsl:call-template name="show-code-set">
      <xsl:with-param name="in" select="hl7:confidentialityCode"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:text>)</xsl:text>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-header
Documentation

Description

Show patients, guardians, consents, encounters, serviceEvents, orders and authors

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="show-header">
  <table class="header_table">
    <tbody>
      <!-- Patient row -->
      <xsl:for-each select="hl7:recordTarget/hl7:patientRole">
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'recordTarget'"/>
            </xsl:call-template>
          </td>
          <td>
            <!-- IE8 hack: without this span with float, IE8 will render the span with float right on a new line -->
            <span class="span_value">
              <xsl:call-template name="show-name-set">
                <xsl:with-param name="in" select="hl7:patient/hl7:name[1]"/>
              </xsl:call-template>
            </span>
            <span style="float: right; margin-left: 1em;">
              <xsl:if test="hl7:patient/hl7:birthTime[@value]">
                <span>
                  <span class="span_label">
                    <xsl:choose>
                      <xsl:when test="hl7:patient/*[local-name() = 'deceasedInd'][@value = 'true' or @nullFlavor] | hl7:patient/*[local-name() = 'deceasedTime']">
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="key" select="'birthTimeLongDeceased'"/>
                        </xsl:call-template>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="key" select="'birthTimeLong'"/>
                        </xsl:call-template>
                      </xsl:otherwise>
                    </xsl:choose>
                    <xsl:text>: </xsl:text>
                  </span>
                  <span class="span_value">
                    <xsl:call-template name="show-timestamp">
                      <xsl:with-param name="in" select="hl7:patient/hl7:birthTime"/>
                    </xsl:call-template>
                    <xsl:if test="hl7:patient/*[local-name() = 'deceasedInd'][@value = 'true' or @nullFlavor] | hl7:patient/*[local-name() = 'deceasedTime']">
                      <xsl:text> - † </xsl:text>
                      <xsl:choose>
                        <xsl:when test="hl7:patient/*[local-name() = 'deceasedTime'][@value]">
                          <xsl:call-template name="show-timestamp">
                            <xsl:with-param name="in" select="hl7:patient/*[local-name() = 'deceasedTime']"/>
                          </xsl:call-template>
                        </xsl:when>
                        <xsl:when test="hl7:patient/*[local-name() = 'deceasedInd'][@nullFlavor]">
                          <xsl:call-template name="show-nullFlavor">
                            <xsl:with-param name="in" select="hl7:patient/*[local-name() = 'deceasedInd']/@nullFlavor"/>
                          </xsl:call-template>
                        </xsl:when>
                        <xsl:otherwise>
                          <xsl:call-template name="getLocalizedString">
                            <xsl:with-param name="key" select="'date_unknown'"/>
                          </xsl:call-template>
                        </xsl:otherwise>
                      </xsl:choose>
                    </xsl:if>
                    <xsl:variable name="comparedate">
                      <xsl:choose>
                        <xsl:when test="hl7:patient/*[local-name() = 'deceasedTime'][@value]">
                          <xsl:value-of select="hl7:patient/*[local-name() = 'deceasedTime']/@value"/>
                        </xsl:when>
                        <xsl:when test="not(hl7:patient/*[local-name() = 'deceasedInd'] or hl7:patient/*[local-name() = 'deceasedInd'][@value = 'true' or @nullFlavor] or hl7:patient/*[local-name() = 'deceasedTime'])">
                          <xsl:value-of select="$currentDate"/>
                        </xsl:when>
                      </xsl:choose>
                    </xsl:variable>
                    <xsl:if test="string-length($comparedate) > 0">
                      <span>
                        <xsl:attribute name="title">
                          <xsl:choose>
                            <xsl:when test="hl7:patient/*[local-name() = 'deceasedTime'][@value]">
                              <xsl:call-template name="getLocalizedString">
                                <xsl:with-param name="key" select="'At the time of death'"/>
                              </xsl:call-template>
                            </xsl:when>
                            <xsl:otherwise>
                              <xsl:call-template name="getLocalizedString">
                                <xsl:with-param name="key" select="'At document creation time'"/>
                              </xsl:call-template>
                            </xsl:otherwise>
                          </xsl:choose>
                        </xsl:attribute>
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="pre">
                            <xsl:text> (</xsl:text>
                            <xsl:call-template name="getAge">
                              <xsl:with-param name="comparedate" select="$comparedate"/>
                              <xsl:with-param name="date" select="hl7:patient/hl7:birthTime/@value"/>
                            </xsl:call-template>
                          </xsl:with-param>
                          <xsl:with-param name="key" select="'yr'"/>
                          <xsl:with-param name="post" select="')'"/>
                        </xsl:call-template>
                      </span>
                    </xsl:if>
                    <xsl:if test="hl7:patient/*[local-name() = 'multipleBirthInd'][@value = 'true'] | hl7:patient/*[local-name() = 'multipleBirthOrderNumber']">
                      <i>
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="pre" select="' '"/>
                          <xsl:with-param name="key" select="'partOfMultipleBirth'"/>
                        </xsl:call-template>
                      </i>
                    </xsl:if>
                  </span>
                </span>
              </xsl:if>
              <xsl:if test="hl7:patient/hl7:administrativeGenderCode[@code]">
                <span class="span_label">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'administrativeGenderCode'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                </span>
                <span class="span_value">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:patient/hl7:administrativeGenderCode"/>
                  </xsl:call-template>
                </span>
              </xsl:if>
            </span>
            <xsl:if test="hl7:id[not(contains($skip-ids-var, concat(',',@root,',')))]">
              <span style="float: right;" class="print_visible">
                <span class="span_label">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'patientIdLong'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                </span>
                <span class="span_value">
                  <xsl:call-template name="show-id-set">
                    <xsl:with-param name="in" select="hl7:id[not(contains($skip-ids-var, concat(',', @root, ',')))]"/>
                    <xsl:with-param name="sep" select="', '"/>
                  </xsl:call-template>
                </span>
              </span>
            </xsl:if>
          </td>
        </tr>
        <xsl:if test="hl7:patient/hl7:guardian">
          <tr>
            <td class="td_label">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Guardian'"/>
              </xsl:call-template>
            </td>
            <td>
              <span class="span_value">
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:patient/hl7:guardian/*/hl7:name[1]"/>
                </xsl:call-template>
                <xsl:if test="hl7:patient/hl7:guardian/hl7:code">
                  <xsl:text> - </xsl:text>
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:patient/hl7:guardian/hl7:code"/>
                  </xsl:call-template>
                </xsl:if>
              </span>
            </td>
          </tr>
        </xsl:if>
      </xsl:for-each>
      <!-- Authorization -->
      <xsl:for-each select="hl7:authorization/hl7:consent">
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'consent'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:id">
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'id'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:id"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:code">
              <xsl:if test="hl7:id">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'code'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:code"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:statusCode">
              <xsl:if test="hl7:id | hl7:code">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'statusCode'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-code">
                  <xsl:with-param name="in" select="hl7:statusCode"/>
                </xsl:call-template>
              </span>
            </xsl:if>
          </td>
        </tr>
      </xsl:for-each>
      <!-- Encounter row -->
      <xsl:for-each select="hl7:componentOf/hl7:encompassingEncounter">
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Encounter'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:id">
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'id'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:id"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:code">
              <xsl:if test="hl7:id">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'type'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:code"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:effectiveTime">
              <xsl:if test="hl7:id | hl7:code">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'effectiveTime'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-ivlts">
                  <xsl:with-param name="in" select="hl7:effectiveTime"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:location/hl7:healthCareFacility/hl7:code">
              <div>
                <span class="span_label">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'location'"/>
                    <xsl:with-param name="post" select="': '"/>
                  </xsl:call-template>
                </span>
                <span class="span_value">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:code"/>
                  </xsl:call-template>
                </span>
              </div>
            </xsl:if>
          </td>
        </tr>
      </xsl:for-each>
      <!-- DocumentationOf -->
      <xsl:for-each select="hl7:documentationOf/hl7:serviceEvent">
        <xsl:variable name="displayName">
          <xsl:if test="@classCode[not(. = 'ACT')]">
            <xsl:call-template name="show-actClassCode">
              <xsl:with-param name="clsCode" select="@classCode"/>
            </xsl:call-template>
          </xsl:if>
        </xsl:variable>
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'documentationOf'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="string-length($displayName) > 0">
              <xsl:call-template name="firstCharCaseUp">
                <xsl:with-param name="data" select="$displayName"/>
              </xsl:call-template>
            </xsl:if>
            <xsl:if test="hl7:code">
              <xsl:if test="string-length($displayName) > 0">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_value">
                <xsl:call-template name="show-code">
                  <xsl:with-param name="in" select="hl7:code"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:effectiveTime">
              <xsl:if test="string-length($displayName) > 0 or hl7:code">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'effectiveTime'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-ivlts">
                  <xsl:with-param name="in" select="hl7:effectiveTime"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:for-each select="hl7:performer/hl7:assignedEntity/hl7:assignedPerson[hl7:name]">
              <xsl:if test="string-length($displayName) > 0 or ancestor::hl7:serviceEvent[1]/hl7:code or ancestor::hl7:serviceEvent[1]/hl7:effectiveTime">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="concat('typeCode-', ancestor::hl7:performer[1]/@typeCode)"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-name">
                  <xsl:with-param name="in" select="hl7:name[1]"/>
                </xsl:call-template>
              </span>
            </xsl:for-each>
          </td>
        </tr>
      </xsl:for-each>
      <!-- InFulfillmentOf -->
      <xsl:for-each select="hl7:inFulfillmentOf/hl7:order">
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-FLFS'"/>
            </xsl:call-template>
          </td>
          <td>
            <span class="span_label">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'order'"/>
              </xsl:call-template>
              <xsl:text> </xsl:text>
            </span>
            <xsl:if test="hl7:id">
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'id'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:id"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:code">
              <xsl:if test="hl7:id">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'code'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:code"/>
                </xsl:call-template>
              </span>
            </xsl:if>
            <xsl:if test="hl7:priorityCode">
              <xsl:if test="hl7:id | hl7:code">
                <xsl:text>, </xsl:text>
              </xsl:if>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'priorityCode'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:priorityCode"/>
                </xsl:call-template>
              </span>
            </xsl:if>
          </td>
        </tr>
      </xsl:for-each>
      <!-- Author row -->
      <xsl:for-each select="hl7:author/hl7:assignedAuthor">
        <tr>
          <td class="td_label">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'author'"/>
            </xsl:call-template>
          </td>
          <td>
            <span class="span_value">
              <xsl:choose>
                <xsl:when test="hl7:assignedPerson/hl7:name">
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:assignedPerson/hl7:name[1]"/>
                  </xsl:call-template>
                  <xsl:if test="hl7:assignedPerson/hl7:desc">
                    <div>
                      <xsl:value-of select="hl7:assignedPerson/hl7:desc"/>
                    </div>
                  </xsl:if>
                  <xsl:if test="hl7:assignedPerson/hl7:birthTime">
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'birthTimeLong'"/>
                    </xsl:call-template>
                    <xsl:text> </xsl:text>
                    <xsl:call-template name="show-timestamp">
                      <xsl:with-param name="in" select="hl7:assignedPerson/hl7:birthTime"/>
                    </xsl:call-template>
                  </xsl:if>
                </xsl:when>
                <xsl:when test="hl7:assignedAuthoringDevice/hl7:softwareName">
                  <xsl:value-of select="hl7:assignedAuthoringDevice/hl7:softwareName"/>
                </xsl:when>
                <xsl:when test="hl7:assignedDevice/hl7:softwareName">
                  <xsl:value-of select="hl7:assignedDevice/hl7:softwareName/@value"/>
                </xsl:when>
              </xsl:choose>
            </span>
            <xsl:if test="hl7:representedOrganization">
              <xsl:variable name="organizationName">
                <xsl:choose>
                  <xsl:when test="hl7:representedOrganization/hl7:name">
                    <xsl:call-template name="show-name-set">
                      <xsl:with-param name="in" select="hl7:representedOrganization/hl7:name[1]"/>
                    </xsl:call-template>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:variable name="id-root" select="(hl7:representedOrganization/hl7:id[not(@nullFlavor)])[1]/@root"/>
                    <xsl:variable name="id-ext" select="(hl7:representedOrganization/hl7:id[not(@nullFlavor)])[1]/@extension"/>
                    <xsl:choose>
                      <xsl:when test="$id-ext">
                        <xsl:call-template name="show-name-set">
                          <xsl:with-param name="in" select="(ancestor::hl7:ClinicalDocument//*[hl7:id[@root = $id-root][@extension = $id-ext]][hl7:name])[1]/hl7:name[1]"/>
                        </xsl:call-template>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:call-template name="show-name-set">
                          <xsl:with-param name="in" select="(ancestor::hl7:ClinicalDocument//*[hl7:id[@root = $id-root][not(@extension)]][hl7:name])[1]/hl7:name[1]"/>
                        </xsl:call-template>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:otherwise>
                </xsl:choose>
              </xsl:variable>
              <xsl:text>, </xsl:text>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'organization'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:choose>
                  <xsl:when test="string-length(normalize-space($organizationName)) > 0">
                    <xsl:value-of select="normalize-space($organizationName)"/>
                  </xsl:when>
                  <xsl:otherwise>
                    <xsl:call-template name="show-id-set">
                      <xsl:with-param name="in" select="hl7:representedOrganization/hl7:id"/>
                    </xsl:call-template>
                  </xsl:otherwise>
                </xsl:choose>
              </span>
            </xsl:if>
            <xsl:if test="../hl7:time[@value | *]">
              <xsl:text>, </xsl:text>
              <span class="span_label">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Authored_on'"/>
                  <xsl:with-param name="post" select="': '"/>
                </xsl:call-template>
              </span>
              <span class="span_value">
                <xsl:call-template name="show-timestamp">
                  <xsl:with-param name="in" select="../hl7:time"/>
                </xsl:call-template>
              </span>
            </xsl:if>
          </td>
        </tr>
      </xsl:for-each>
    </tbody>
  </table>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template documentGeneral
Documentation

Description

Handle general document propreties (id + creation time)

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="documentGeneral">
  <table class="header_table">
    <tbody>
      <tr>
        <td class="td_label td_label_width">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Document'"/>
          </xsl:call-template>
        </td>
        <td style="width: 30%;">
          <xsl:call-template name="idVersionSetId"/>
        </td>
        <td class="td_label td_label_width">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Created_on'"/>
          </xsl:call-template>
        </td>
        <td>
          <xsl:call-template name="show-timestamp">
            <xsl:with-param name="in" select="hl7:effectiveTime"/>
          </xsl:call-template>
        </td>
      </tr>
    </tbody>
  </table>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template confidentiality
Documentation

Description

Handle confidentiality

Namespace No namespace
References
Import precedence 0
Source
<xsl:template name="confidentiality">
  <table class="header_table">
    <tbody>
      <td class="td_label">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'Confidentiality'"/>
        </xsl:call-template>
      </td>
      <td style="width: 80%;">
        <xsl:call-template name="show-code-set">
          <xsl:with-param name="in" select="hl7:confidentialityCode"/>
        </xsl:call-template>
      </td>
    </tbody>
  </table>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template author
Documentation

Description

Handle CDA Header author

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="author">
  <xsl:for-each select="hl7:author/hl7:assignedAuthor">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:if test="hl7:representedOrganization/hl7:addr | hl7:representedOrganization/hl7:telecom">
              <xsl:attribute name="rowspan">2</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'author'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:choose>
              <xsl:when test="hl7:addr | hl7:telecom">
                <xsl:attribute name="style">width: 30%;</xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="colspan">3</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:if test="hl7:representedOrganization/hl7:addr | hl7:representedOrganization/hl7:telecom">
              <xsl:attribute name="rowspan">2</xsl:attribute>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="hl7:assignedPerson/hl7:name">
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:assignedPerson/hl7:name"/>
                </xsl:call-template>
                <xsl:if test="hl7:assignedPerson/hl7:desc">
                  <div>
                    <xsl:value-of select="hl7:assignedPerson/hl7:desc"/>
                  </div>
                </xsl:if>
                <xsl:if test="hl7:assignedPerson/hl7:birthTime">
                  <xsl:text> </xsl:text>
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'birthTimeLong'"/>
                  </xsl:call-template>
                  <xsl:text> </xsl:text>
                  <xsl:call-template name="show-timestamp">
                    <xsl:with-param name="in" select="hl7:assignedPerson/hl7:birthTime"/>
                  </xsl:call-template>
                </xsl:if>
              </xsl:when>
              <xsl:when test="hl7:assignedAuthoringDevice/hl7:softwareName">
                <xsl:value-of select="hl7:assignedAuthoringDevice/hl7:softwareName"/>
              </xsl:when>
              <xsl:when test="hl7:assignedDevice/hl7:softwareName">
                <xsl:value-of select="hl7:assignedDevice/hl7:softwareName/@value"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:in"/>
                  <xsl:with-param name="sep" select="'br'"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:if test="hl7:code">
              <xsl:text> - </xsl:text>
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'code'"/>
                <xsl:with-param name="post" select="': '"/>
              </xsl:call-template>
              <xsl:call-template name="show-code-set">
                <xsl:with-param name="in" select="hl7:code"/>
                <xsl:with-param name="sep" select="'br'"/>
              </xsl:call-template>
            </xsl:if>
            <xsl:if test="hl7:representedOrganization">
              <xsl:text>, </xsl:text>
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'organization'"/>
                <xsl:with-param name="post" select="': '"/>
              </xsl:call-template>
            </xsl:if>
            <xsl:variable name="name-set">
              <xsl:choose>
                <xsl:when test="hl7:representedOrganization/hl7:name">
                  <xsl:copy-of select="hl7:representedOrganization/hl7:name"/>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:variable name="id-root" select="(hl7:representedOrganization/hl7:id[not(@nullFlavor)])[1]/@root"/>
                  <xsl:variable name="id-ext" select="(hl7:representedOrganization/hl7:id[not(@nullFlavor)])[1]/@extension"/>
                  <xsl:choose>
                    <xsl:when test="$id-ext">
                      <xsl:copy-of select="(ancestor::hl7:ClinicalDocument//*[hl7:id[@root = $id-root][@extension = $id-ext]][hl7:name])[1]/hl7:name"/>
                    </xsl:when>
                    <xsl:otherwise>
                      <xsl:copy-of select="(ancestor::hl7:ClinicalDocument//*[hl7:id[@root = $id-root][not(@extension)]][hl7:name])[1]/hl7:name"/>
                    </xsl:otherwise>
                  </xsl:choose>
                </xsl:otherwise>
              </xsl:choose>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="exslt:node-set($name-set)">
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="exslt:node-set($name-set)"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:representedOrganization/hl7:id"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
          </td>
          <xsl:if test="hl7:addr | hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="."/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
        <xsl:if test="hl7:representedOrganization/hl7:addr | hl7:representedOrganization/hl7:telecom">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
              <xsl:text> (</xsl:text>
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'organization'"/>
              </xsl:call-template>
              <xsl:text>)</xsl:text>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:representedOrganization"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template authenticator
Documentation

Description

Handle CDA Header authenticator

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="authenticator">
  <xsl:for-each select="hl7:authenticator">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-AUTHEN'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="show-assignedEntity">
              <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
            </xsl:call-template>
            <xsl:text> </xsl:text>
            <xsl:call-template name="show-code-set">
              <xsl:with-param name="in" select="hl7:signatureCode"/>
            </xsl:call-template>
            <xsl:if test="hl7:time/@value">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="pre" select="' '"/>
                <xsl:with-param name="key" select="'at'"/>
                <xsl:with-param name="post" select="' '"/>
              </xsl:call-template>
              <xsl:call-template name="show-timestamp">
                <xsl:with-param name="in" select="hl7:time"/>
              </xsl:call-template>
            </xsl:if>
          </td>
          <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template legalAuthenticator
Documentation

Description

Handle CDA Header legalAuthenticator

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="legalAuthenticator">
  <xsl:for-each select="hl7:legalAuthenticator">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-LA'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="show-assignedEntity">
              <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
            </xsl:call-template>
            <xsl:text> </xsl:text>
            <xsl:call-template name="show-code-set">
              <xsl:with-param name="in" select="hl7:signatureCode"/>
            </xsl:call-template>
            <xsl:if test="hl7:time/@value">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="pre" select="' '"/>
                <xsl:with-param name="key" select="'at'"/>
                <xsl:with-param name="post" select="' '"/>
              </xsl:call-template>
              <xsl:call-template name="show-timestamp">
                <xsl:with-param name="in" select="hl7:time"/>
              </xsl:call-template>
            </xsl:if>
          </td>
          <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template dataEnterer
Documentation

Description

Handle CDA Header dataEnterer

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="dataEnterer">
  <xsl:for-each select="hl7:dataEnterer">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-ENT'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:dataEnterer/hl7:assignedEntity/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="show-assignedEntity">
              <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
            </xsl:call-template>
          </td>
          <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:dataEnterer/hl7:assignedEntity/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template componentOf
Documentation

Description

Handle CDA Header componentOf

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="componentOf">
  <xsl:for-each select="hl7:componentOf/hl7:encompassingEncounter">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Encounter'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:choose>
              <xsl:when test="hl7:effectiveTime">
                <xsl:attribute name="style">width: 30%;</xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="colspan">3</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <table class="table_simple">
              <tbody>
                <tr>
                  <td class="td_label">
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'id'"/>
                    </xsl:call-template>
                  </td>
                  <td>
                    <xsl:call-template name="show-id-set">
                      <xsl:with-param name="in" select="hl7:id"/>
                    </xsl:call-template>
                  </td>
                </tr>
                <xsl:if test="hl7:code">
                  <tr>
                    <td class="td_label">
                      <xsl:call-template name="getLocalizedString">
                        <xsl:with-param name="key" select="'type'"/>
                      </xsl:call-template>
                    </td>
                    <td>
                      <xsl:call-template name="show-code-set">
                        <xsl:with-param name="in" select="hl7:code"/>
                      </xsl:call-template>
                    </td>
                  </tr>
                </xsl:if>
              </tbody>
            </table>
          </td>
          <xsl:if test="hl7:effectiveTime">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Encounter Date'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-ivlts">
                <xsl:with-param name="in" select="hl7:effectiveTime"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
        <xsl:if test="hl7:dischargeDispositionCode | sdtc:admissionReferralSourceCode | hl7:admissionReferralSourceCode">
          <tr>
            <xsl:choose>
              <xsl:when test="sdtc:admissionReferralSourceCode | hl7:admissionReferralSourceCode">
                <td class="td_label td_label_width">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'Encounter Admission Referral Source'"/>
                  </xsl:call-template>
                </td>
                <td style="width: 30%;">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="sdtc:admissionReferralSourceCode | hl7:admissionReferralSourceCode"/>
                  </xsl:call-template>
                </td>
                <td class="td_label td_label_width">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'Encounter Discharge Disposition'"/>
                  </xsl:call-template>
                </td>
                <td style="width: 30%;">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:dischargeDispositionCode"/>
                  </xsl:call-template>
                </td>
              </xsl:when>
              <xsl:otherwise>
                <td class="td_label td_label_width">
                  <xsl:call-template name="getLocalizedString">
                    <xsl:with-param name="key" select="'Encounter Discharge Disposition'"/>
                  </xsl:call-template>
                </td>
                <td colspan="3">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:dischargeDispositionCode"/>
                  </xsl:call-template>
                </td>
              </xsl:otherwise>
            </xsl:choose>
          </tr>
        </xsl:if>
        <xsl:if test="hl7:location">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Encounter Location'"/>
              </xsl:call-template>
            </td>
            <td colspan="3">
              <xsl:choose>
                <!-- FIXME: playingPlace is CDAr3 May Ballot specific. This is unlikely to remain this way -->
                <!-- FIXME: scopingOrganization is CDAr3 May Ballot specific. This is unlikely to remain this way -->
                <xsl:when test="hl7:location/hl7:healthCareFacility/hl7:*[local-name() = 'location' or local-name() = 'playingPlace']/hl7:name">
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:*[local-name() = 'location' or local-name() = 'playingPlace']/hl7:name"/>
                  </xsl:call-template>
                  <xsl:if test="hl7:location/hl7:healthCareFacility/hl7:*[local-name() = 'location' or local-name() = 'playingPlace']/hl7:addr">
                    <xsl:text> (</xsl:text>
                    <xsl:call-template name="show-address-set">
                      <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:*[local-name() = 'location' or local-name() = 'playingPlace']/hl7:addr"/>
                      <xsl:with-param name="sep" select="', '"/>
                    </xsl:call-template>
                    <xsl:text>)</xsl:text>
                  </xsl:if>
                  <xsl:for-each select="                                                 hl7:location/hl7:healthCareFacility/hl7:serviceProviderOrganization/hl7:name |                                                 hl7:location/hl7:healthCareFacility/hl7:scopingOrganization/hl7:name">
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="pre" select="' '"/>
                      <xsl:with-param name="key" select="'of'"/>
                      <xsl:with-param name="post" select="' '"/>
                    </xsl:call-template>
                    <xsl:call-template name="show-name-set">
                      <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:serviceProviderOrganization/hl7:name"/>
                    </xsl:call-template>
                  </xsl:for-each>
                </xsl:when>
                <xsl:when test="hl7:location/hl7:healthCareFacility/hl7:code">
                  <xsl:call-template name="show-code-set">
                    <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:code"/>
                  </xsl:call-template>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:if test="hl7:location/hl7:healthCareFacility/hl7:id">
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'id'"/>
                      <xsl:with-param name="post" select="':'"/>
                    </xsl:call-template>
                    <xsl:call-template name="show-id-set">
                      <xsl:with-param name="in" select="hl7:location/hl7:healthCareFacility/hl7:id"/>
                    </xsl:call-template>
                  </xsl:if>
                </xsl:otherwise>
              </xsl:choose>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="hl7:responsibleParty">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'responsibleParty'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:choose>
                <xsl:when test="hl7:responsibleParty/hl7:assignedEntity/hl7:addr | hl7:responsibleParty/hl7:assignedEntity/hl7:telecom">
                  <xsl:attribute name="style">width: 30%;</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="colspan">3</xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:call-template name="show-assignedEntity">
                <xsl:with-param name="asgnEntity" select="hl7:responsibleParty/hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
            <xsl:if test="hl7:responsibleParty/hl7:assignedEntity/hl7:addr | hl7:responsibleParty/hl7:assignedEntity/hl7:telecom">
              <td class="td_label td_label_width">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Contact_details'"/>
                </xsl:call-template>
              </td>
              <td>
                <xsl:call-template name="show-contactInfo">
                  <xsl:with-param name="contact" select="hl7:responsibleParty/hl7:assignedEntity"/>
                </xsl:call-template>
              </td>
            </xsl:if>
          </tr>
        </xsl:if>
        <xsl:for-each select="hl7:encounterParticipant">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="show-participationTypeOrCode">
                <xsl:with-param name="typeCode" select="@typeCode"/>
              </xsl:call-template>
              <xsl:if test="hl7:time">
                <xsl:text> (</xsl:text>
                <xsl:call-template name="show-ivlts">
                  <xsl:with-param name="in" select="hl7:time"/>
                </xsl:call-template>
                <xsl:text>)</xsl:text>
              </xsl:if>
            </td>
            <td>
              <xsl:choose>
                <xsl:when test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
                  <xsl:attribute name="style">width: 30%;</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="colspan">3</xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:call-template name="show-assignedEntity">
                <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
              <td class="td_label td_label_width">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Contact_details'"/>
                </xsl:call-template>
              </td>
              <td>
                <xsl:call-template name="show-contactInfo">
                  <xsl:with-param name="contact" select="hl7:assignedEntity"/>
                </xsl:call-template>
              </td>
            </xsl:if>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template custodian
Documentation

Description

Handle CDA Header custodian

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="custodian">
  <xsl:for-each select="hl7:custodian">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'custodian'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:addr | hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:choose>
              <xsl:when test="hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:name">
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:name"/>
                  <xsl:with-param name="sep" select="'br'"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="show-id-set">
                  <xsl:with-param name="in" select="hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:id"/>
                  <xsl:with-param name="sep" select="'br'"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
          </td>
          <xsl:if test="hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:addr | hl7:custodian/hl7:assignedCustodian/hl7:representedCustodianOrganization/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:assignedCustodian/hl7:representedCustodianOrganization"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template documentationOf
Documentation

Description

Handle CDA Header documentationOf

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="documentationOf">
  <xsl:for-each select="hl7:documentationOf">
    <table class="header_table">
      <tbody>
        <xsl:if test="hl7:serviceEvent[@classCode | hl7:code]">
          <xsl:variable name="displayName">
            <xsl:if test="hl7:serviceEvent/@classCode[not(. = 'ACT')]">
              <xsl:call-template name="show-actClassCode">
                <xsl:with-param name="clsCode" select="hl7:serviceEvent/@classCode"/>
              </xsl:call-template>
            </xsl:if>
          </xsl:variable>
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'documentationOf'"/>
              </xsl:call-template>
              <xsl:if test="string-length($displayName) > 0">
                <xsl:text> - </xsl:text>
                <xsl:value-of select="$displayName"/>
              </xsl:if>
            </td>
            <td style="width: 80%;" colspan="3">
              <xsl:call-template name="show-code">
                <xsl:with-param name="in" select="hl7:serviceEvent/hl7:code"/>
              </xsl:call-template>
              <xsl:call-template name="show-ivlts">
                <xsl:with-param name="in" select="hl7:serviceEvent/hl7:effectiveTime"/>
              </xsl:call-template>
              <xsl:call-template name="show-code">
                <xsl:with-param name="in" select="hl7:serviceEvent/hl7:statusCode"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
        <xsl:for-each select="hl7:serviceEvent/hl7:performer">
          <xsl:variable name="displayName">
            <xsl:call-template name="show-participationType">
              <xsl:with-param name="ptype" select="@typeCode"/>
            </xsl:call-template>
            <xsl:text> - </xsl:text>
            <xsl:if test="hl7:functionCode//@code">
              <xsl:call-template name="show-code-set">
                <xsl:with-param name="in" select="hl7:functionCode"/>
              </xsl:call-template>
            </xsl:if>
          </xsl:variable>
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="firstCharCaseUp">
                <xsl:with-param name="data" select="$displayName"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:choose>
                <xsl:when test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
                  <xsl:attribute name="style">width: 30%;</xsl:attribute>
                </xsl:when>
                <xsl:otherwise>
                  <xsl:attribute name="colspan">3</xsl:attribute>
                </xsl:otherwise>
              </xsl:choose>
              <xsl:call-template name="show-assignedEntity">
                <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
              <td class="td_label td_label_width">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Contact_details'"/>
                </xsl:call-template>
              </td>
              <td>
                <xsl:call-template name="show-contactInfo">
                  <xsl:with-param name="contact" select="hl7:assignedEntity"/>
                </xsl:call-template>
              </td>
            </xsl:if>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template inFulfillmentOf
Documentation

Description

Handle CDA Header inFulfillmentOf

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="inFulfillmentOf">
  <xsl:for-each select="hl7:inFulfillmentOf">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-FLFS'"/>
            </xsl:call-template>
          </td>
          <td style="width: 80%;">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'order'"/>
            </xsl:call-template>
            <xsl:text>: </xsl:text>
            <xsl:for-each select="hl7:order">
              <xsl:call-template name="show-id-set">
                <xsl:with-param name="in" select="hl7:id"/>
              </xsl:call-template>
              <xsl:if test="hl7:code">
                <xsl:text> </xsl:text>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:code"/>
                </xsl:call-template>
              </xsl:if>
              <xsl:if test="hl7:priorityCode">
                <xsl:text> </xsl:text>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:priorityCode"/>
                </xsl:call-template>
              </xsl:if>
            </xsl:for-each>
          </td>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template informant
Documentation

Description

Handle CDA Header informant

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="informant">
  <xsl:for-each select="hl7:informant">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-INF'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom | hl7:relatedEntity/hl7:addr | hl7:relatedEntity/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:if test="hl7:assignedEntity">
              <xsl:call-template name="show-assignedEntity">
                <xsl:with-param name="asgnEntity" select="hl7:assignedEntity"/>
              </xsl:call-template>
            </xsl:if>
            <xsl:if test="hl7:relatedEntity">
              <xsl:call-template name="show-relatedEntity">
                <xsl:with-param name="relatedEntity" select="hl7:relatedEntity"/>
              </xsl:call-template>
            </xsl:if>
          </td>
          <xsl:choose>
            <xsl:when test="hl7:assignedEntity/hl7:addr | hl7:assignedEntity/hl7:telecom">
              <td class="td_label td_label_width">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Contact_details'"/>
                </xsl:call-template>
              </td>
              <td>
                <xsl:if test="hl7:assignedEntity">
                  <xsl:call-template name="show-contactInfo">
                    <xsl:with-param name="contact" select="hl7:assignedEntity"/>
                  </xsl:call-template>
                </xsl:if>
              </td>
            </xsl:when>
            <xsl:when test="hl7:relatedEntity/hl7:addr | hl7:relatedEntity/hl7:telecom">
              <td class="td_label td_label_width">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'Contact_details'"/>
                </xsl:call-template>
              </td>
              <td>
                <xsl:if test="hl7:relatedEntity">
                  <xsl:call-template name="show-contactInfo">
                    <xsl:with-param name="contact" select="hl7:relatedEntity"/>
                  </xsl:call-template>
                </xsl:if>
              </td>
            </xsl:when>
          </xsl:choose>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template informationRecipient
Documentation

Description

Handle CDA Header informationRecipient

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="informationRecipient">
  <xsl:for-each select="hl7:informationRecipient">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'typeCode-PRCP'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:choose>
              <xsl:when test="hl7:intendedRecipient/hl7:addr | hl7:intendedRecipient/hl7:telecom">
                <xsl:attribute name="style">width: 30%;</xsl:attribute>
              </xsl:when>
              <xsl:otherwise>
                <xsl:attribute name="colspan">3</xsl:attribute>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:choose>
              <xsl:when test="hl7:intendedRecipient/hl7:informationRecipient/hl7:name">
                <xsl:for-each select="hl7:intendedRecipient/hl7:informationRecipient">
                  <xsl:call-template name="show-name-set">
                    <xsl:with-param name="in" select="hl7:name"/>
                    <xsl:with-param name="sep" select="'br'"/>
                  </xsl:call-template>
                </xsl:for-each>
              </xsl:when>
              <xsl:otherwise>
                <xsl:for-each select="hl7:intendedRecipient">
                  <xsl:call-template name="show-id-set">
                    <xsl:with-param name="in" select="hl7:id"/>
                    <xsl:with-param name="sep" select="'br'"/>
                  </xsl:call-template>
                  <br/>
                </xsl:for-each>
              </xsl:otherwise>
            </xsl:choose>
          </td>
          <xsl:if test="hl7:intendedRecipient/hl7:addr | hl7:intendedRecipient/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:intendedRecipient"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
        <xsl:for-each select="hl7:intendedRecipient/hl7:receivedOrganization">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="pre" select="''"/>
                <xsl:with-param name="key" select="'Organization'"/>
                <xsl:with-param name="post" select="''"/>
              </xsl:call-template>
            </td>
            <td style="width: 30%;">
              <div>
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:name"/>
                </xsl:call-template>
              </div>
              <xsl:if test="hl7:id">
                <table class="table_simple">
                  <tbody>
                    <tr>
                      <td class="td_label">
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="key" select="'id'"/>
                        </xsl:call-template>
                      </td>
                      <td>
                        <xsl:call-template name="show-id-set">
                          <xsl:with-param name="in" select="hl7:id"/>
                        </xsl:call-template>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </xsl:if>
            </td>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
              <xsl:text> (</xsl:text>
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'organization'"/>
              </xsl:call-template>
              <xsl:text>)</xsl:text>
            </td>
            <td style="width: 30%;">
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="."/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template participant
Documentation

Description

Handle CDA Header participant

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="participant">
  <xsl:for-each select="hl7:participant">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:variable name="participtRole">
              <xsl:call-template name="show-participationTypeOrCode">
                <xsl:with-param name="typeCode" select="@typeCode"/>
                <xsl:with-param name="classCode" select="hl7:associatedEntity/@classCode"/>
                <xsl:with-param name="code" select="hl7:associatedEntity/hl7:code"/>
              </xsl:call-template>
            </xsl:variable>
            <xsl:choose>
              <xsl:when test="string-length($participtRole) > 0">
                <xsl:call-template name="firstCharCaseUp">
                  <xsl:with-param name="data" select="$participtRole"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'participant'"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
          </td>
          <td>
            <xsl:if test="hl7:associatedEntity/hl7:addr | hl7:associatedEntity/hl7:telecom">
              <xsl:attribute name="style">width: 30%;</xsl:attribute>
            </xsl:if>
            <xsl:if test="hl7:functionCode">
              <xsl:call-template name="show-code-set">
                <xsl:with-param name="in" select="hl7:functionCode"/>
              </xsl:call-template>
              <xsl:text>, </xsl:text>
            </xsl:if>
            <xsl:call-template name="show-associatedEntity">
              <xsl:with-param name="assoEntity" select="hl7:associatedEntity"/>
            </xsl:call-template>
            <xsl:call-template name="show-ivlts">
              <xsl:with-param name="in" select="hl7:time"/>
            </xsl:call-template>
          </td>
          <xsl:if test="hl7:associatedEntity/hl7:addr | hl7:associatedEntity/hl7:telecom">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:associatedEntity"/>
              </xsl:call-template>
            </td>
          </xsl:if>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template recordTarget
Documentation

Description

Handle CDA Header recordTarget

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="recordTarget">
  <xsl:for-each select="hl7:recordTarget/hl7:patientRole">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="pre" select="''"/>
              <xsl:with-param name="key" select="'recordTarget'"/>
              <xsl:with-param name="post" select="''"/>
            </xsl:call-template>
          </td>
          <td style="width: 30%;">
            <xsl:call-template name="show-name-set">
              <xsl:with-param name="in" select="hl7:patient/hl7:name"/>
            </xsl:call-template>
          </td>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Contact_details'"/>
            </xsl:call-template>
          </td>
          <td style="width: 30%;">
            <xsl:call-template name="show-contactInfo">
              <xsl:with-param name="contact" select="."/>
            </xsl:call-template>
          </td>
        </tr>
        <tr>
          <td class="td_label td_label_width">
            <xsl:choose>
              <xsl:when test="hl7:patient/*[local-name() = 'deceasedInd'][@value = 'true' or @nullFlavor] | hl7:patient/*[local-name() = 'deceasedTime']">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'birthTimeLongDeceased'"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'birthTimeLong'"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
          </td>
          <td style="width: 30%;">
            <xsl:call-template name="show-birthDeathTime-multipleBirth">
              <xsl:with-param name="in" select="hl7:patient"/>
              <xsl:with-param name="clinicalDocumentEffectiveTime" select="ancestor-or-self::hl7:ClinicalDocument/hl7:effectiveTime/@value"/>
            </xsl:call-template>
          </td>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'administrativeGenderCode'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:call-template name="show-code-set">
              <xsl:with-param name="in" select="hl7:patient/hl7:administrativeGenderCode"/>
            </xsl:call-template>
          </td>
        </tr>
        <xsl:if test="hl7:patient/hl7:raceCode | hl7:patient/hl7:ethnicGroupCode">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Race'"/>
              </xsl:call-template>
            </td>
            <td style="width: 30%;">
              <xsl:call-template name="show-code-set">
                <xsl:with-param name="in" select="hl7:patient/hl7:raceCode"/>
              </xsl:call-template>
            </td>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Ethnicity'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-code-set">
                <xsl:with-param name="in" select="hl7:patient/hl7:ethnicGroupCode"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'patientIdsLong'"/>
            </xsl:call-template>
          </td>
          <td>
            <xsl:if test="not(hl7:patient/hl7:languageCommunication)">
              <xsl:attribute name="colspan">3</xsl:attribute>
            </xsl:if>
            <xsl:call-template name="show-id-set">
              <xsl:with-param name="in" select="hl7:id[not(contains($skip-ids-var, concat(',',@root,',')))]"/>
              <xsl:with-param name="sep" select="'br'"/>
            </xsl:call-template>
          </td>
          <xsl:if test="hl7:patient/hl7:languageCommunication">
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'languageCommunication'"/>
              </xsl:call-template>
            </td>
            <td colspan="3">
              <xsl:for-each select="hl7:patient/hl7:languageCommunication">
                <div>
                  <xsl:value-of select="hl7:languageCode/@code"/>
                  <xsl:if test="hl7:modeCode">
                    <xsl:text>, </xsl:text>
                    <xsl:call-template name="show-code-set">
                      <xsl:with-param name="in" select="hl7:modeCode"/>
                      <xsl:with-param name="sep" select="' '"/>
                    </xsl:call-template>
                  </xsl:if>
                  <xsl:if test="hl7:proficiencyLevelCode">
                    <xsl:text>, </xsl:text>
                    <xsl:call-template name="show-code-set">
                      <xsl:with-param name="in" select="hl7:proficiencyLevelCode"/>
                      <xsl:with-param name="sep" select="' '"/>
                    </xsl:call-template>
                  </xsl:if>
                  <xsl:if test="hl7:preferenceInd">
                    <xsl:text>, </xsl:text>
                    <xsl:call-template name="getLocalizedString">
                      <xsl:with-param name="key" select="'preferredLanguage'"/>
                      <xsl:with-param name="post" select="': '"/>
                    </xsl:call-template>
                    <xsl:call-template name="show-boolean">
                      <xsl:with-param name="in" select="hl7:preferenceInd"/>
                    </xsl:call-template>
                  </xsl:if>
                </div>
              </xsl:for-each>
            </td>
          </xsl:if>
        </tr>
        <xsl:if test="hl7:patient/hl7:guardian">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Guardian'"/>
              </xsl:call-template>
            </td>
            <td style="width: 30%;">
              <xsl:call-template name="show-name-set">
                <xsl:with-param name="in" select="hl7:patient/hl7:guardian/*/hl7:name"/>
              </xsl:call-template>
              <xsl:if test="hl7:patient/hl7:guardian/hl7:code">
                <xsl:text> - </xsl:text>
                <xsl:call-template name="show-code-set">
                  <xsl:with-param name="in" select="hl7:patient/hl7:guardian/hl7:code"/>
                </xsl:call-template>
              </xsl:if>
            </td>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="hl7:patient/hl7:guardian"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
        <xsl:for-each select="hl7:providerOrganization">
          <tr>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="pre" select="''"/>
                <xsl:with-param name="key" select="'providerOrganization'"/>
                <xsl:with-param name="post" select="''"/>
              </xsl:call-template>
            </td>
            <td style="width: 30%;">
              <div>
                <xsl:call-template name="show-name-set">
                  <xsl:with-param name="in" select="hl7:name"/>
                </xsl:call-template>
              </div>
              <xsl:if test="hl7:id">
                <table class="table_simple">
                  <tbody>
                    <tr>
                      <td class="td_label">
                        <xsl:call-template name="getLocalizedString">
                          <xsl:with-param name="key" select="'id'"/>
                        </xsl:call-template>
                      </td>
                      <td>
                        <xsl:call-template name="show-id-set">
                          <xsl:with-param name="in" select="hl7:id"/>
                        </xsl:call-template>
                      </td>
                    </tr>
                  </tbody>
                </table>
              </xsl:if>
            </td>
            <td class="td_label td_label_width">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'Contact_details'"/>
              </xsl:call-template>
              <xsl:text> (</xsl:text>
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'organization'"/>
              </xsl:call-template>
              <xsl:text>)</xsl:text>
            </td>
            <td style="width: 30%;">
              <xsl:call-template name="show-contactInfo">
                <xsl:with-param name="contact" select="."/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:for-each>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template relatedDocument
Documentation

Description

Handle CDA Header relatedDocument

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="relatedDocument">
  <xsl:for-each select="hl7:relatedDocument">
    <xsl:variable name="parentCDACode" select="ancestor::hl7:ClinicalDocument[1]/hl7:code"/>
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:choose>
              <xsl:when test="@inversionInd = 'true'">
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'relatingDocumentInverted'"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="getLocalizedString">
                  <xsl:with-param name="key" select="'relatingDocument'"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:text> (</xsl:text>
            <xsl:call-template name="show-actRelationship">
              <xsl:with-param name="ptype" select="@typeCode"/>
            </xsl:call-template>
            <xsl:text>)</xsl:text>
          </td>
          <td style="width: 80%;">
            <xsl:for-each select="hl7:parentDocument">
              <xsl:call-template name="idVersionSetId"/>
            </xsl:for-each>
          </td>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template authorization
Documentation

Description

Handle CDA Header authorization

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="authorization">
  <xsl:for-each select="hl7:authorization">
    <table class="header_table">
      <tbody>
        <tr>
          <td class="td_label td_label_width">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'consent'"/>
            </xsl:call-template>
          </td>
          <td style="width: 80%;">
            <xsl:choose>
              <xsl:when test="hl7:consent/hl7:code">
                <xsl:call-template name="show-code">
                  <xsl:with-param name="in" select="hl7:consent/hl7:code"/>
                </xsl:call-template>
              </xsl:when>
              <xsl:otherwise>
                <xsl:call-template name="show-code">
                  <xsl:with-param name="in" select="hl7:consent/hl7:statusCode"/>
                </xsl:call-template>
              </xsl:otherwise>
            </xsl:choose>
            <br/>
          </td>
        </tr>
      </tbody>
    </table>
  </xsl:for-each>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-assignedEntity
Documentation

Description

Handle CDA Header assignedEntity

Parameters

asgnEntity Contains the assignedEntity element
Namespace No namespace
Used by
References
Parameters
QName Namespace
asgnEntity No namespace
Import precedence 0
Source
<xsl:template name="show-assignedEntity">
  <xsl:param name="asgnEntity"/>
  <xsl:choose>
    <xsl:when test="$asgnEntity/hl7:assignedPerson/hl7:name">
      <xsl:call-template name="show-name-set">
        <xsl:with-param name="in" select="$asgnEntity/hl7:assignedPerson/hl7:name"/>
      </xsl:call-template>
      <xsl:if test="$asgnEntity/hl7:assignedPerson/hl7:desc">
        <div>
          <xsl:value-of select="$asgnEntity/hl7:assignedPerson/hl7:desc"/>
        </div>
      </xsl:if>
      <xsl:if test="$asgnEntity/hl7:assignedPerson/hl7:birthTime">
        <xsl:text> </xsl:text>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'birthTimeLong'"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$asgnEntity/hl7:assignedPerson/hl7:birthTime"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:if test="$asgnEntity/hl7:representedOrganization/hl7:name">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="pre" select="' '"/>
          <xsl:with-param name="key" select="'of'"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-name-set">
          <xsl:with-param name="in" select="$asgnEntity/hl7:representedOrganization/hl7:name"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:when>
    <xsl:when test="$asgnEntity/hl7:representedOrganization">
      <xsl:value-of select="$asgnEntity/hl7:representedOrganization/hl7:name"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="show-id-set">
        <xsl:with-param name="in" select="$asgnEntity/hl7:id"/>
        <xsl:with-param name="sep" select="'br'"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-relatedEntity
Documentation

Description

Handle CDA Header relatedEntity

Parameters

relatedEntity Contains the relatedEntity element
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
relatedEntity No namespace
Import precedence 0
Source
<xsl:template name="show-relatedEntity">
  <xsl:param name="relatedEntity"/>
  <xsl:choose>
    <xsl:when test="$relatedEntity/hl7:relatedPerson/hl7:name">
      <xsl:call-template name="show-name-set">
        <xsl:with-param name="in" select="$relatedEntity/hl7:relatedPerson/hl7:name"/>
      </xsl:call-template>
      <xsl:if test="$relatedEntity/hl7:relatedPerson/hl7:desc">
        <div>
          <xsl:value-of select="$relatedEntity/hl7:relatedPerson/hl7:desc"/>
        </div>
      </xsl:if>
      <xsl:if test="$relatedEntity/hl7:relatedPerson/hl7:birthTime">
        <xsl:text> </xsl:text>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'birthTimeLong'"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$relatedEntity/hl7:relatedPerson/hl7:birthTime"/>
        </xsl:call-template>
      </xsl:if>
    </xsl:when>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-associatedEntity
Documentation

Description

Handle CDA Header associatedEntity

Parameters

assoEntity Contains the associatedEntity element
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
assoEntity No namespace
Import precedence 0
Source
<xsl:template name="show-associatedEntity">
  <xsl:param name="assoEntity"/>
  <xsl:if test="$assoEntity/hl7:associatedPerson">
    <xsl:call-template name="show-name-set">
      <xsl:with-param name="in" select="$assoEntity/hl7:associatedPerson/hl7:name"/>
      <xsl:with-param name="sep" select="'br'"/>
    </xsl:call-template>
    <xsl:if test="$assoEntity/hl7:assignedPerson/hl7:desc">
      <div>
        <xsl:value-of select="$assoEntity/hl7:assignedPerson/hl7:desc"/>
      </div>
    </xsl:if>
    <xsl:if test="$assoEntity/hl7:assignedPerson/hl7:birthTime">
      <xsl:text> </xsl:text>
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'birthTimeLong'"/>
      </xsl:call-template>
      <xsl:text> </xsl:text>
      <xsl:call-template name="show-timestamp">
        <xsl:with-param name="in" select="$assoEntity/hl7:assignedPerson/hl7:birthTime"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:if>
  <xsl:if test="$assoEntity/hl7:code">
    <xsl:if test="$assoEntity/hl7:associatedPerson/hl7:name or $assoEntity/hl7:associatedPerson/hl7:id">
      <xsl:text>, </xsl:text>
    </xsl:if>
    <xsl:call-template name="show-code-set">
      <xsl:with-param name="in" select="$assoEntity/hl7:code"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="$assoEntity/hl7:id">
    <xsl:if test="$assoEntity/hl7:associatedPerson/hl7:name">
      <xsl:text>, </xsl:text>
    </xsl:if>
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="'id'"/>
      <xsl:with-param name="post" select="': '"/>
    </xsl:call-template>
    <xsl:call-template name="show-id-set">
      <xsl:with-param name="in" select="$assoEntity/hl7:id"/>
      <xsl:with-param name="sep" select="'br'"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="$assoEntity/hl7:scopingOrganization">
    <br/>
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="'organization'"/>
      <xsl:with-param name="post" select="': '"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:choose>
    <xsl:when test="$assoEntity/hl7:scopingOrganization/hl7:name">
      <xsl:call-template name="show-name-set">
        <xsl:with-param name="in" select="$assoEntity/hl7:scopingOrganization/hl7:name"/>
      </xsl:call-template>
      <xsl:if test="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode">
        <xsl:value-of select="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode/@displayName"/>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="pre" select="' '"/>
          <xsl:with-param name="key" select="'code'"/>
          <xsl:with-param name="post" select="':'"/>
        </xsl:call-template>
        <xsl:call-template name="show-code-set">
          <xsl:with-param name="in" select="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode/@code"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:text>, </xsl:text>
    </xsl:when>
    <xsl:when test="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode">
      <xsl:value-of select="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode/@displayName"/>
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="pre" select="' '"/>
        <xsl:with-param name="key" select="'code'"/>
        <xsl:with-param name="post" select="':'"/>
      </xsl:call-template>
      <xsl:call-template name="show-code-set">
        <xsl:with-param name="in" select="$assoEntity/hl7:scopingOrganization/hl7:standardIndustryClassCode/@code"/>
      </xsl:call-template>
      <xsl:text>, </xsl:text>
    </xsl:when>
  </xsl:choose>
  <xsl:if test="$assoEntity/hl7:scopingOrganization/hl7:id">
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="'id'"/>
      <xsl:with-param name="post" select="': '"/>
    </xsl:call-template>
    <xsl:call-template name="show-id-set">
      <xsl:with-param name="in" select="$assoEntity/hl7:scopingOrganization/hl7:id"/>
      <xsl:with-param name="sep" select="'br'"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template idVersionSetId
Documentation

Description

Handle id, setId and versionNumber

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="idVersionSetId">
  <xsl:if test="hl7:id | hl7:setId | hl7:versionNumber">
    <table class="table_simple">
      <tbody>
        <xsl:if test="hl7:id">
          <tr>
            <td class="td_label">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'id'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-id-set">
                <xsl:with-param name="in" select="hl7:id"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="hl7:versionNumber">
          <tr>
            <td class="td_label">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'versionNumber'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:value-of select="hl7:versionNumber/@value"/>
            </td>
          </tr>
        </xsl:if>
        <xsl:if test="hl7:setId">
          <tr>
            <td class="td_label">
              <xsl:call-template name="getLocalizedString">
                <xsl:with-param name="key" select="'setId'"/>
              </xsl:call-template>
            </td>
            <td>
              <xsl:call-template name="show-id-set">
                <xsl:with-param name="in" select="hl7:setId"/>
              </xsl:call-template>
            </td>
          </tr>
        </xsl:if>
      </tbody>
    </table>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-contactInfo
Documentation

Description

Handle contactInfo. Address and telecom

Parameters

contact Element containing addr and or telecom element
Namespace No namespace
Used by
References
Parameters
QName Namespace
contact No namespace
Import precedence 0
Source
<xsl:template name="show-contactInfo">
  <xsl:param name="contact"/>
  <xsl:call-template name="show-address-set">
    <xsl:with-param name="in" select="$contact/hl7:addr"/>
    <xsl:with-param name="sep" select="'br'"/>
  </xsl:call-template>
  <xsl:if test="$contact/hl7:addr and $contact/hl7:telecom">
    <br/>
  </xsl:if>
  <xsl:call-template name="show-telecom-set">
    <xsl:with-param name="in" select="$contact/hl7:telecom"/>
    <xsl:with-param name="sep" select="', '"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-birthDeathTime-multipleBirth
Documentation

Description

Handle one line of birth/death/multiple birth data

Parameters

in One element with the child elements birthTime, deceasedInd, deceasedTime, multipleBirthInd, multipleBirthOrderNumber. Each of those is optional and may bein the V3 namespace or in another namespace like sdtc
clinicalDocumentEffectiveTime hl7:ClinicalDocument/hl7:effectiveTime/@value
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
clinicalDocumentEffectiveTime No namespace ancestor-or-self::hl7:ClinicalDocument/hl7:effectiveTime/@value
in No namespace
Import precedence 0
Source
<xsl:template name="show-birthDeathTime-multipleBirth">
  <xsl:param name="in"/>
  <xsl:param name="clinicalDocumentEffectiveTime" select="ancestor-or-self::hl7:ClinicalDocument/hl7:effectiveTime/@value"/>
  <xsl:if test="$in">
    <xsl:call-template name="show-timestamp">
      <xsl:with-param name="in" select="$in/*[local-name() = 'birthTime']"/>
    </xsl:call-template>
    <xsl:if test="$in/*[local-name() = 'deceasedInd'][@value = 'true' or @nullFlavor] | $in/*[local-name() = 'deceasedTime']">
      <xsl:text> - </xsl:text>
      <xsl:choose>
        <xsl:when test="$in/*[local-name() = 'deceasedTime'][@value]">
          <xsl:call-template name="show-timestamp">
            <xsl:with-param name="in" select="$in/*[local-name() = 'deceasedTime']"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="$in/*[local-name() = 'deceasedInd'][@nullFlavor]">
          <xsl:call-template name="show-nullFlavor">
            <xsl:with-param name="in" select="$in/*[local-name() = 'deceasedInd']/@nullFlavor"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="pre" select="'†'"/>
            <xsl:with-param name="key" select="'date_unknown'"/>
          </xsl:call-template>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:if>
    <xsl:variable name="comparedate">
      <xsl:choose>
        <xsl:when test="$in/*[local-name() = 'deceasedTime'][@value]">
          <xsl:value-of select="$in/*[local-name() = 'deceasedTime']/@value"/>
        </xsl:when>
        <xsl:when test="not($in/*[local-name() = 'deceasedInd'] or $in/*[local-name() = 'deceasedTime'][@value = 'true' or @nullFlavor] or $in/*[local-name() = 'deceasedTime'])">
          <xsl:value-of select="$clinicalDocumentEffectiveTime"/>
        </xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsl:if test="string-length($comparedate) > 0">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="pre">
          <xsl:text> (</xsl:text>
          <xsl:call-template name="getAge">
            <xsl:with-param name="comparedate" select="$comparedate"/>
            <xsl:with-param name="date" select="$in/hl7:birthTime/@value"/>
          </xsl:call-template>
        </xsl:with-param>
        <xsl:with-param name="key" select="'yr'"/>
        <xsl:with-param name="post" select="')'"/>
      </xsl:call-template>
    </xsl:if>
    <xsl:if test="$in/*[local-name() = 'multipleBirthInd'][@value = 'true'] | $in/*[local-name() = 'multipleBirthOrderNumber']">
      <i>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="pre" select="' '"/>
          <xsl:with-param name="key" select="'partOfMultipleBirth'"/>
        </xsl:call-template>
      </i>
    </xsl:if>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-actClassCode
Documentation

Description

Get localized string for a classCode

Parameters

clsCode Class code string
Namespace No namespace
Used by
References
Parameters
QName Namespace
clsCode No namespace
Import precedence 0
Source
<xsl:template name="show-actClassCode">
  <xsl:param name="clsCode"/>
  <xsl:call-template name="getLocalizedString">
    <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.6-',$clsCode)"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-actRelationship
Documentation

Description

Get localized string for a typeCode from an act relationship

Parameters

ptype ActRelationship type string
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
ptype No namespace
Import precedence 0
Source
<xsl:template name="show-actRelationship">
  <xsl:param name="ptype"/>
  <xsl:call-template name="getLocalizedString">
    <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.1002-',$ptype)"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-participationType
Documentation

Description

Get localized string for a typeCode from a participation

Parameters

ptype Participation type string
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
ptype No namespace
Import precedence 0
Source
<xsl:template name="show-participationType">
  <xsl:param name="ptype"/>
  <xsl:call-template name="getLocalizedString">
    <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.90-',$ptype)"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-participationTypeOrCode
Documentation

Description

Takes the participation typeCode attribute and translates that to a human readable form and adds the Role.code in human readable form if available.

Parameters

typeCode required. Participation typeCode
code optional. Role.code
classCode optional. Class code of the contained class, if any
Namespace No namespace
Used by
References
Parameters
QName Namespace
classCode No namespace
code No namespace
typeCode No namespace
Import precedence 0
Source
<xsl:template name="show-participationTypeOrCode">
  <xsl:param name="typeCode"/>
  <xsl:param name="classCode"/>
  <xsl:param name="code"/>
  <xsl:if test="string-length($typeCode) > 0">
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.90-',$typeCode)"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="string-length($classCode) > 0">
    <xsl:if test="string-length($typeCode) > 0">
      <xsl:text> - </xsl:text>
    </xsl:if>
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="concat('2.16.840.1.113883.5.110-',$classCode)"/>
    </xsl:call-template>
  </xsl:if>
  <xsl:if test="$code">
    <xsl:if test="$code//@code">
      <xsl:text> </xsl:text>
      <xsl:call-template name="show-code-set">
        <xsl:with-param name="in" select="$code"/>
      </xsl:call-template>
    </xsl:if>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-id-set
Documentation

Description

Show elements with datatype II separated with the value in 'sep'. Calls show-id

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag

Description

 ====================================================================== 
                         Datatype based functions                       
 ====================================================================== 
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-id-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-id">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-id">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-id">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-id
Documentation

Description

Show element with datatype II

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-id">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <span>
      <xsl:if test="$in[@assigningAuthorityName]">
        <xsl:attribute name="title">
          <xsl:value-of select="$in/@assigningAuthorityName"/>
        </xsl:attribute>
      </xsl:if>
      <xsl:variable name="extension">
        <xsl:if test="$in[@extension][@root]">
          <xsl:choose>
            <xsl:when test="$in[contains($mask-ids-var, concat(',',@root,','))]">
              <span>
                <xsl:attribute name="title">
                  <xsl:call-template name="show-nullFlavor">
                    <xsl:with-param name="in" select="'MSK'"/>
                  </xsl:call-template>
                </xsl:attribute>
                <xsl:text>xxx-xxx-xxx</xsl:text>
              </span>
            </xsl:when>
            <xsl:otherwise>
              <xsl:value-of select="$in/@extension"/>
            </xsl:otherwise>
          </xsl:choose>
        </xsl:if>
      </xsl:variable>
      <xsl:choose>
        <xsl:when test="$in[@extension][@root]">
          <xsl:copy-of select="$extension"/>
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="pre" select="' ('"/>
            <xsl:with-param name="key" select="$in/@root"/>
            <xsl:with-param name="post" select="')'"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:when test="$in[@root]">
          <xsl:value-of select="$in/@root"/>
        </xsl:when>
        <xsl:when test="$in[@extension]">
          <xsl:copy-of select="$extension"/>
        </xsl:when>
      </xsl:choose>
      <xsl:if test="$in[@nullFlavor]">
        <xsl:text>(</xsl:text>
        <xsl:call-template name="show-nullFlavor">
          <xsl:with-param name="in" select="$in/@nullFlavor"/>
        </xsl:call-template>
        <xsl:text>)</xsl:text>
      </xsl:if>
    </span>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-integer-set
Documentation

Description

Show elements with datatype INT separated with the value in 'sep'. Calls show-integer

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-integer-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-integer">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-integer">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-integer">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-integer
Documentation

Description

Show element with datatype INT

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Template
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-integer">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:choose>
      <xsl:when test="$in[@value]">
        <xsl:value-of select="$in/@value"/>
      </xsl:when>
    </xsl:choose>
    <xsl:if test="$in[@value]">
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:if test="$in[@nullFlavor]">
      <xsl:text>(</xsl:text>
      <xsl:call-template name="show-nullFlavor">
        <xsl:with-param name="in" select="$in/@nullFlavor"/>
      </xsl:call-template>
      <xsl:text>)</xsl:text>
    </xsl:if>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-code-set
Documentation

Description

Show elements with datatype CD, CE, CV, CO separated with the value in 'sep'. Calls show-code

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-code-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-code">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-code">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-code">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-code
Documentation

Description

Show elements with datatype CD, CE, CV, CO

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-code">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:variable name="codeSystem">
      <xsl:choose>
        <xsl:when test="@codeSystem">
          <xsl:value-of select="$in/@codeSystem"/>
        </xsl:when>
        <xsl:when test="$in/self::hl7:signatureCode[not(@codeSystem)]">2.16.840.1.113883.5.89</xsl:when>
      </xsl:choose>
    </xsl:variable>
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="$in[@code] and string-length($codeSystem) > 0">
        <xsl:variable name="key" select="concat($codeSystem, '-', $in/@code)"/>
        <xsl:variable name="displayName">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="$key"/>
          </xsl:call-template>
        </xsl:variable>
        <xsl:choose>
          <xsl:when test="$displayName = $key and $in[@displayName]">
            <xsl:value-of select="$in/@displayName"/>
          </xsl:when>
          <xsl:when test="$displayName = $key and $in[hl7:displayName/@value]">
            <xsl:value-of select="($in/hl7:displayName/@value)[1]"/>
          </xsl:when>
          <xsl:when test="$displayName = $key">
            <xsl:value-of select="$in/@code"/>
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="pre" select="' ('"/>
              <xsl:with-param name="key" select="$codeSystem"/>
              <xsl:with-param name="post" select="')'"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$displayName"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
      <!-- DTr1 -->
      <xsl:when test="$in[@displayName]">
        <xsl:value-of select="$in/@displayName"/>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:displayName/@value]">
        <xsl:value-of select="($in/hl7:displayName/@value)[1]"/>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:when test="$in[@code]">
        <xsl:value-of select="$in/@code"/>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:when test="$in[@nullFlavor]">
        <xsl:call-template name="show-nullFlavor">
          <xsl:with-param name="in" select="$in/@nullFlavor"/>
        </xsl:call-template>
      </xsl:when>
    </xsl:choose>
    <!-- DTr1 | DTr2 -->
    <xsl:for-each select="$in/*[local-name() = 'originalText'] | $in/*[local-name() = 'originalText']/*[local-name() = 'xml']">
      <xsl:text> - </xsl:text>
      <xsl:value-of select="."/>
    </xsl:for-each>
    <xsl:for-each select="$in/*[local-name() = 'translation']">
      <div style="margin-left: 2em;">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="local-name()"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-code-set">
          <xsl:with-param name="in" select="."/>
        </xsl:call-template>
      </div>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-name-set
Documentation

Description

Show elements with datatype EN, ON, PN or TN separated with the value in 'sep'. Calls show-name

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-name-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-name">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-name">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-name">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-name
Documentation

Description

Show element with datatype EN, ON, PN, or TN

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-name">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:if test="$in/@use">
      <xsl:call-template name="tokenize">
        <xsl:with-param name="prefix" select="'nameUse_'"/>
        <xsl:with-param name="string" select="$in/@use"/>
        <xsl:with-param name="delimiters" select="' '"/>
      </xsl:call-template>
      <xsl:text>: </xsl:text>
    </xsl:if>
    <xsl:if test="$in[@use][@nullFlavor]">
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:call-template name="show-nullFlavor">
      <xsl:with-param name="in" select="$in/@nullFlavor"/>
    </xsl:call-template>
    <xsl:for-each select="$in/node()">
      <!-- 
                        Except for prefix, suffix and delimiter name parts, every name part is surrounded by implicit whitespace.
                        Leading and trailing explicit whitespace is insignificant in all those name parts. 
                    -->
      <xsl:if test="self::hl7:given[string-length(normalize-space(.)) > 0] | self::hl7:family[string-length(normalize-space(.)) > 0] | self::hl7:part[@type='GIV' or @type='FAM'][string-length(normalize-space(@value)) > 0]">
        <xsl:if test="preceding-sibling::node()[string-length(normalize-space(.)) > 0]">
          <xsl:text> </xsl:text>
        </xsl:if>
      </xsl:if>
      <xsl:choose>
        <xsl:when test="self::comment() | self::processing-instruction()"/>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:family">
          <xsl:call-template name="caseUp">
            <xsl:with-param name="data" select="."/>
          </xsl:call-template>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type = 'FAM']">
          <xsl:call-template name="caseUp">
            <xsl:with-param name="data" select="@value"/>
          </xsl:call-template>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:prefix[contains(@qualifier, 'VV')]">
          <xsl:call-template name="caseUp">
            <xsl:with-param name="data" select="."/>
          </xsl:call-template>
          <xsl:text> </xsl:text>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type = 'PFX' and contains(@qualifier, 'VV')]">
          <xsl:call-template name="caseUp">
            <xsl:with-param name="data" select="@value"/>
          </xsl:call-template>
          <xsl:text> </xsl:text>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:prefix | self::hl7:given | self::delimiter">
          <xsl:value-of select="."/>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type = 'PFX' or @type = 'GIV' or @type = 'DEL']">
          <xsl:value-of select="@value"/>
        </xsl:when>
        <xsl:when test="string-length(normalize-space(.)) > 0">
          <xsl:value-of select="."/>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[not(@type)][string-length(normalize-space(@value)) > 0]">
          <xsl:value-of select="@value"/>
        </xsl:when>
      </xsl:choose>
      <xsl:if test="self::hl7:given[string-length(normalize-space(.)) > 0] | self::hl7:family[string-length(normalize-space(.)) > 0] | self::hl7:part[@type='GIV' or @type='FAM'][string-length(normalize-space(@value)) > 0]">
        <xsl:if test="following-sibling::node()[string-length(normalize-space(.)) > 0]">
          <xsl:text> </xsl:text>
        </xsl:if>
      </xsl:if>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-address-set
Documentation

Description

Show elements with datatype AD separated with the value in 'sep'. Calls show-address

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-address-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-address">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-address">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-address">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-address
Documentation

Description

Show element with datatype AD

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-address">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:if test="$in/@use">
      <xsl:call-template name="tokenize">
        <xsl:with-param name="prefix" select="'addressUse_'"/>
        <xsl:with-param name="string" select="$in/@use"/>
        <xsl:with-param name="delimiters" select="' '"/>
      </xsl:call-template>
      <xsl:text>: </xsl:text>
    </xsl:if>
    <xsl:if test="$in[@use][@nullFlavor]">
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:call-template name="show-nullFlavor">
      <xsl:with-param name="in" select="$in/@nullFlavor"/>
    </xsl:call-template>
    <xsl:for-each select="$in/text() | $in/*">
      <xsl:choose>
        <xsl:when test="self::hl7:useablePeriod"/>
        <!-- DTr1 only if not streetAddressLine -->
        <xsl:when test="self::hl7:streetName">
          <xsl:if test="not(../hl7:streetAddressLine)">
            <xsl:variable name="additionalLocator" select="following-sibling::hl7:*[1][local-name() = 'additionalLocator'] |                                                                            following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric' or local-name() = 'houseNumber' or local-name() = 'buildingNumberSuffix']/following-sibling::hl7:*[1][local-name() = 'additionalLocator'] |                                                                             following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric' or local-name() = 'houseNumber']/following-sibling::hl7:*[1][local-name() = 'buildingNumberSuffix']/following-sibling::hl7:*[1][local-name() = 'additionalLocator']"/>
            <xsl:variable name="houseNumber" select="following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric'] |                                                                       following-sibling::hl7:*[1][local-name() = 'houseNumber']"/>
            <xsl:variable name="buildingNumberSuffix" select="following-sibling::hl7:*[1][local-name() = 'buildingNumberSuffix'] |                                                                                following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric' or local-name() = 'houseNumber']/following-sibling::hl7:*[1][local-name() = 'buildingNumberSuffix']"/>
            <!-- 
                                Look for
                                - streetName houseNumber|houseNumberNumeric|buildingNumberSuffix
                                - streetName houseNumber|houseNumberNumeric|buildingNumberSuffix additionalLocator houseNumber|houseNumberNumeric|buildingNumberSuffix
                                - streetName additionalLocator houseNumber|houseNumberNumeric|buildingNumberSuffix
                                in that order and nothing in between.
                            -->
            <xsl:value-of select="."/>
            <xsl:choose>
              <xsl:when test="string-length($houseNumber) > 0">
                <xsl:text> </xsl:text>
                <xsl:value-of select="$houseNumber"/>
                <xsl:if test="string-length($buildingNumberSuffix) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$buildingNumberSuffix"/>
                </xsl:if>
              </xsl:when>
              <xsl:when test="string-length($buildingNumberSuffix) > 0">
                <xsl:text> </xsl:text>
                <xsl:value-of select="$buildingNumberSuffix"/>
              </xsl:when>
            </xsl:choose>
            <xsl:if test="string-length($additionalLocator) > 0">
              <xsl:text> </xsl:text>
              <xsl:value-of select="$additionalLocator"/>
              <xsl:variable name="houseNumber2" select="$additionalLocator/following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric'] |                                                                            $additionalLocator/following-sibling::hl7:*[1][local-name() = 'houseNumber']"/>
              <xsl:variable name="buildingNumberSuffix2" select="$additionalLocator/following-sibling::hl7:*[1][local-name() = 'buildingNumberSuffix'] |                                                                                     $additionalLocator/following-sibling::hl7:*[1][local-name() = 'houseNumberNumeric' or local-name() = 'houseNumber']/following-sibling::hl7:*[1][local-name() = 'buildingNumberSuffix']"/>
              <xsl:choose>
                <xsl:when test="string-length($houseNumber2) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$houseNumber2"/>
                  <xsl:if test="string-length($buildingNumberSuffix2) > 0">
                    <xsl:text> </xsl:text>
                    <xsl:value-of select="$buildingNumberSuffix2"/>
                  </xsl:if>
                </xsl:when>
                <xsl:when test="string-length($buildingNumberSuffix2) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$buildingNumberSuffix2"/>
                </xsl:when>
              </xsl:choose>
            </xsl:if>
            <xsl:if test="following-sibling::*[not(local-name() = 'houseNumber' or local-name() = 'houseNumberNumeric' or local-name() = 'buildingNumberSuffix' or local-name() = 'additionalLocator')][string-length(.) > 0 or @code]">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 only if not streetAddressLine -->
        <xsl:when test="self::hl7:part[@type='STR']">
          <xsl:if test="not(../hl7:part[@type='SAL'])">
            <xsl:variable name="additionalLocator" select="following-sibling::hl7:part[1][@type='ADL'] |                                                                            following-sibling::hl7:part[1][@type='BNN' or @type='BNR' or @type='BNS']/following-sibling::hl7:part[1][@type='ADL'] |                                                                             following-sibling::hl7:part[1][@type='BNN' or @type='BNR' or @type='BNS']/following-sibling::hl7:part[1][@type='BNS']/following-sibling::hl7:part[1][@type='ADL']"/>
            <xsl:variable name="houseNumber" select="following-sibling::hl7:part[1][@type='BNN'] |                                  following-sibling::hl7:part[1][@type='BNR']"/>
            <xsl:variable name="buildingNumberSuffix" select="following-sibling::hl7:part[1][@type='BNS'] |                                  following-sibling::hl7:part[1][@type='BNN' or @type='BNR']/following-sibling::hl7:part[1][@type='BNS']"/>
            <!-- 
                                Look for
                                - streetName houseNumber|houseNumberNumeric|buildingNumberSuffix
                                - streetName houseNumber|houseNumberNumeric|buildingNumberSuffix additionalLocator houseNumber|houseNumberNumeric|buildingNumberSuffix
                                - streetName additionalLocator houseNumber|houseNumberNumeric|buildingNumberSuffix
                                in that order and nothing in between.
                            -->
            <xsl:value-of select="."/>
            <xsl:choose>
              <xsl:when test="string-length($houseNumber) > 0">
                <xsl:text> </xsl:text>
                <xsl:value-of select="$houseNumber"/>
                <xsl:if test="string-length($buildingNumberSuffix) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$buildingNumberSuffix"/>
                </xsl:if>
              </xsl:when>
              <xsl:when test="string-length($buildingNumberSuffix) > 0">
                <xsl:text> </xsl:text>
                <xsl:value-of select="$buildingNumberSuffix"/>
              </xsl:when>
            </xsl:choose>
            <xsl:if test="string-length($additionalLocator) > 0">
              <xsl:text> </xsl:text>
              <xsl:value-of select="$additionalLocator"/>
              <xsl:variable name="houseNumber2" select="$additionalLocator/following-sibling::hl7:part[1][@type='BNN'] |                                      $additionalLocator/following-sibling::hl7:part[1][@type='BNR']"/>
              <xsl:variable name="buildingNumberSuffix2" select="$additionalLocator/following-sibling::hl7:part[1][@type='BNS'] |                                      $additionalLocator/following-sibling::hl7:part[1][@type='BNN' or @type='BNR']/following-sibling::hl7:part[1][@type='BNS']"/>
              <xsl:choose>
                <xsl:when test="string-length($houseNumber2) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$houseNumber2"/>
                  <xsl:if test="string-length($buildingNumberSuffix2) > 0">
                    <xsl:text> </xsl:text>
                    <xsl:value-of select="$buildingNumberSuffix2"/>
                  </xsl:if>
                </xsl:when>
                <xsl:when test="string-length($buildingNumberSuffix2) > 0">
                  <xsl:text> </xsl:text>
                  <xsl:value-of select="$buildingNumberSuffix2"/>
                </xsl:when>
              </xsl:choose>
            </xsl:if>
            <xsl:if test="following-sibling::*[not(@type='BNR' or local-name() = 'houseNumberNumeric' or @type='BNS' or @type='ADL')][string-length(.) > 0 or @code]">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 only if not streetAddressLine -->
        <xsl:when test="self::hl7:houseNumber or self::hl7:houseNumberNumeric or self::hl7:buildingNumberSuffix">
          <xsl:if test="not(../hl7:streetAddressLine)">
            <xsl:if test="not(preceding-sibling::hl7:*[1][local-name() = 'streetName' or local-name() = 'additionalLocator'])">
              <xsl:if test="not(self::hl7:buildingNumberSuffix and preceding-sibling::hl7:*[1][local-name() = 'houseNumberNumeric' or local-name() = 'houseNumber'])">
                <xsl:value-of select="."/>
                <xsl:if test="following-sibling::hl7:*[1][string-length(.) > 0 or @code]">
                  <br/>
                </xsl:if>
              </xsl:if>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 only if not streetAddressLine -->
        <xsl:when test="self::hl7:part[@type='BNN' or @type='BNR' or @type='BNS']">
          <xsl:if test="not(../hl7:part[@type = 'SAL'])">
            <xsl:if test="not(preceding-sibling::hl7:*[1][hl7:part[@type = 'STR' or @type = 'ADL']])">
              <xsl:if test="not(self::hl7:part[@type='BNS'] and preceding-sibling::hl7:*[1][@type='BNN' or @type='BNR'])">
                <xsl:value-of select="@value"/>
                <xsl:if test="following-sibling::hl7:part[1][string-length(@value) > 0 or @code]">
                  <br/>
                </xsl:if>
              </xsl:if>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:additionalLocator">
          <xsl:if test="not(preceding-sibling::hl7:*[1][local-name()='houseNumber' or local-name()='houseNumberNumeric' or local-name()='buildingNumberSuffix'])">
            <xsl:value-of select="."/>
            <xsl:if test="following-sibling::hl7:*[1][local-name()='houseNumberNumeric']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][local-name()='houseNumberNumeric']"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:*[1][local-name()='houseNumber']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][local-name()='houseNumber']"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:*[1][local-name()='buildingNumberSuffix']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][local-name()='buildingNumberSuffix']"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:*[1][string-length(.) > 0 or @code]">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type='ADL']">
          <xsl:if test="not(preceding-sibling::hl7:*[1][@type='BNN' or @type='BNR' or @type='BNS'])">
            <xsl:value-of select="@value"/>
            <xsl:if test="following-sibling::hl7:*[1][@type='BNN']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][@type='BNN']/@value"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:*[1][@type='BNR']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][@type='BNR']/@value"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:*[1][@type='BNS']">
              <xsl:text> </xsl:text>
              <xsl:value-of select="following-sibling::hl7:*[1][@type='BNS']/@value"/>
            </xsl:if>
            <xsl:if test="following-sibling::hl7:part[1][string-length(@value) > 0 or @code]">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:postBox">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Postbox'"/>
            <xsl:with-param name="post" select="' '"/>
          </xsl:call-template>
          <xsl:value-of select="."/>
          <xsl:if test="following-sibling::hl7:*[1][string-length(.) > 0 or @code]">
            <br/>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type='POB']">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'Postbox'"/>
            <xsl:with-param name="post" select="' '"/>
          </xsl:call-template>
          <xsl:value-of select="@value"/>
          <xsl:if test="following-sibling::hl7:part[1][string-length(@value) > 0 or @code]">
            <br/>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 ZIP CITY, STATE or CITY, STATE ZIP depending on addr part contents -->
        <xsl:when test="self::hl7:city">
          <xsl:if test="preceding-sibling::hl7:postalCode[1][string-length(.) > 0 or @code]">
            <xsl:choose>
              <xsl:when test="preceding-sibling::hl7:postalCode[1][string-length(.) > 0]">
                <xsl:value-of select="preceding-sibling::hl7:postalCode[1][string-length(.) > 0]"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="preceding-sibling::hl7:postalCode[1][@code]/@code"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:text> </xsl:text>
          </xsl:if>
          <xsl:value-of select="."/>
          <xsl:if test="../hl7:state[string-length(.)>0]">
            <xsl:text>, </xsl:text>
            <xsl:value-of select="../hl7:state"/>
          </xsl:if>
          <xsl:if test="following-sibling::hl7:postalCode[1][string-length(.) > 0 or @code]">
            <xsl:text> </xsl:text>
            <xsl:choose>
              <xsl:when test="following-sibling::hl7:postalCode[1][string-length(.) > 0]">
                <xsl:value-of select="following-sibling::hl7:postalCode[1][string-length(.) > 0]"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="following-sibling::hl7:postalCode[1][@code]/@code"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
          <xsl:if test="following-sibling::hl7:*[1][string-length(.) > 0 or @code]">
            <br/>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 ZIP CITY, STATE or CITY, STATE ZIP depending on addr part contents -->
        <xsl:when test="self::hl7:part[@type='CTY']">
          <xsl:if test="preceding-sibling::hl7:part[@type='ZIP'][1][string-length(@value) > 0 or @code]">
            <xsl:choose>
              <xsl:when test="preceding-sibling::hl7:postalCode[1][string-length(@value) > 0]">
                <xsl:value-of select="preceding-sibling::hl7:postalCode[1][string-length(@value) > 0]/@value"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="preceding-sibling::hl7:postalCode[1][@code]/@code"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:text> </xsl:text>
          </xsl:if>
          <xsl:value-of select="@value"/>
          <xsl:if test="../hl7:part[@type='STA'][string-length(@value)>0]">
            <xsl:text>, </xsl:text>
            <xsl:value-of select="../hl7:part[@type='STA']/@value"/>
          </xsl:if>
          <xsl:if test="following-sibling::hl7:part[@type='ZIP'][1][string-length(@value) > 0 or @code]">
            <xsl:choose>
              <xsl:when test="following-sibling::hl7:postalCode[1][string-length(@value) > 0]">
                <xsl:value-of select="following-sibling::hl7:postalCode[1][string-length(@value) > 0]/@value"/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="following-sibling::hl7:postalCode[1][@code]/@code"/>
              </xsl:otherwise>
            </xsl:choose>
            <xsl:text> </xsl:text>
          </xsl:if>
          <xsl:if test="following-sibling::hl7:part[1][string-length(@value) > 0 or @code]">
            <br/>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:postalCode and ../hl7:city"/>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type='ZIP'] and ../hl7:part[@type='CTY']"/>
        <!-- DTr1 -->
        <xsl:when test="self::hl7:state">
          <xsl:if test="not(../hl7:city)">
            <xsl:if test="(string-length(preceding-sibling::hl7:*[1]) > 0 or preceding-sibling::*/@code)">
              <br/>
            </xsl:if>
            <xsl:value-of select="."/>
            <xsl:if test="(string-length(following-sibling::hl7:*[1]) > 0 or following-sibling::*/@code)">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="self::hl7:part[@type='STA']">
          <xsl:if test="not(../hl7:part[@type = 'CTY'])">
            <xsl:if test="(string-length(preceding-sibling::hl7:*[1]/@value) > 0 or preceding-sibling::hl7:*/@code)">
              <br/>
            </xsl:if>
            <xsl:value-of select="@value"/>
            <xsl:if test="(string-length(following-sibling::hl7:*[1]/@value) > 0 or following-sibling::hl7:*/@code)">
              <br/>
            </xsl:if>
          </xsl:if>
        </xsl:when>
        <!-- DTr1 -->
        <xsl:when test="string-length(text()) > 0">
          <xsl:value-of select="."/>
          <xsl:if test="(string-length(following-sibling::hl7:*[1]) > 0 or following-sibling::hl7:*/@code)">
            <br/>
          </xsl:if>
        </xsl:when>
        <!-- DTr2 -->
        <xsl:when test="string-length(@value) > 0">
          <xsl:value-of select="@value"/>
          <xsl:if test="(string-length(following-sibling::hl7:*[1]/@value) > 0 or following-sibling::hl7:*/@code)">
            <br/>
          </xsl:if>
        </xsl:when>
        <xsl:otherwise>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:for-each>
    <xsl:for-each select="$in/hl7:useablePeriod">
      <div>
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'Period'"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
        <xsl:call-template name="show-ivlts">
          <xsl:with-param name="in" select="."/>
        </xsl:call-template>
      </div>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-quantity-set
Documentation

Description

Show elements with datatype QTY/PQ separated with the value in 'sep'. Calls show-quantity

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-quantity-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-quantity">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-quantity">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-quantity">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-quantity
Documentation

Description

Show element with datatype QTY/PQ

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-quantity">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:choose>
      <xsl:when test="$in[@value]">
        <xsl:value-of select="$in/@value"/>
        <xsl:text> </xsl:text>
        <xsl:choose>
          <xsl:when test="$in[not(@unit) or @unit = '1'][@value = 1]">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Unit'"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:when test="$in[not(@unit) or @unit = '1'][@value > 1]">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Units'"/>
            </xsl:call-template>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="$in/@unit"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:when>
    </xsl:choose>
    <xsl:if test="$in[@value | @unit]">
      <xsl:text> </xsl:text>
    </xsl:if>
    <xsl:if test="$in[@nullFlavor]">
      <xsl:text>(</xsl:text>
      <xsl:call-template name="show-nullFlavor">
        <xsl:with-param name="in" select="$in/@nullFlavor"/>
      </xsl:call-template>
      <xsl:text>)</xsl:text>
    </xsl:if>
    <xsl:for-each select="$in/*[local-name() = 'translation']">
      <div style="margin-left: 2em;">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="local-name()"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-code-set">
          <xsl:with-param name="in" select="."/>
        </xsl:call-template>
      </div>
    </xsl:for-each>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-ivlts
Documentation

Description

Show element with datatype IVL_TS

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-ivlts">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:variable name="fromDate">
      <xsl:call-template name="show-timestamp">
        <xsl:with-param name="in" select="$in/hl7:low"/>
        <xsl:with-param name="part" select="'date'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="toDate">
      <xsl:call-template name="show-timestamp">
        <xsl:with-param name="in" select="$in/hl7:high"/>
        <xsl:with-param name="part" select="'date'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="fromTime">
      <xsl:call-template name="show-timestamp">
        <xsl:with-param name="in" select="$in/hl7:low"/>
        <xsl:with-param name="part" select="'time'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:variable name="toTime">
      <xsl:call-template name="show-timestamp">
        <xsl:with-param name="in" select="$in/hl7:high"/>
        <xsl:with-param name="part" select="'time'"/>
      </xsl:call-template>
    </xsl:variable>
    <xsl:choose>
      <xsl:when test="$in/@value">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'at'"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:when>
      <!-- Same day, different times -->
      <xsl:when test="$fromDate = $toDate">
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$in/hl7:low"/>
          <xsl:with-param name="part" select="'date'"/>
        </xsl:call-template>
        <xsl:if test="string-length(normalize-space($fromTime)) > 0">
          <xsl:text> </xsl:text>
          <xsl:value-of select="normalize-space($fromTime)"/>
          <xsl:if test="string-length(normalize-space($toTime)) > 0">
            <xsl:text> - </xsl:text>
            <xsl:value-of select="normalize-space($toTime)"/>
          </xsl:if>
        </xsl:if>
      </xsl:when>
      <xsl:when test="$in/hl7:low">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'from'"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$in/hl7:low"/>
        </xsl:call-template>
        <xsl:if test="$in/hl7:high">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="pre" select="' '"/>
            <xsl:with-param name="key" select="'to'"/>
            <xsl:with-param name="post" select="' '"/>
          </xsl:call-template>
          <xsl:call-template name="show-timestamp">
            <xsl:with-param name="in" select="$in/hl7:high"/>
          </xsl:call-template>
        </xsl:if>
      </xsl:when>
      <xsl:when test="$in/hl7:high">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'to'"/>
          <xsl:with-param name="post" select="' '"/>
        </xsl:call-template>
        <xsl:call-template name="show-timestamp">
          <xsl:with-param name="in" select="$in/hl7:high"/>
        </xsl:call-template>
      </xsl:when>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-telecom-set
Documentation

Description

Show elements with datatype TEL or URI separated with the value in 'sep'. Calls show-telecom

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-telecom-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-telecom">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-telecom">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-telecom">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-telecom
Documentation

Description

Show element with datatype TEL or URI

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-telecom">
  <xsl:param name="in"/>
  <xsl:choose>
    <xsl:when test="$in">
      <xsl:for-each select="$in">
        <xsl:if test="position() > 1">
          <br/>
        </xsl:if>
        <xsl:variable name="type" select="substring-before(@value, ':')"/>
        <xsl:variable name="value" select="substring-after(@value, ':')"/>
        <xsl:if test="$type">
          <xsl:call-template name="translateTelecomUriScheme">
            <xsl:with-param name="code" select="$type"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="@use">
          <xsl:text> </xsl:text>
          <xsl:call-template name="tokenize">
            <xsl:with-param name="prefix" select="'addressUse_'"/>
            <xsl:with-param name="string" select="@use"/>
            <xsl:with-param name="delimiters" select="' '"/>
          </xsl:call-template>
        </xsl:if>
        <xsl:if test="$type or @use">
          <xsl:text>: </xsl:text>
        </xsl:if>
        <xsl:choose>
          <xsl:when test="$type">
            <xsl:value-of select="$value"/>
          </xsl:when>
          <xsl:otherwise>
            <xsl:value-of select="@value"/>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:for-each>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'telecom information not available'"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-timestamp
Documentation

Description

Show element with datatype TS

Parameters

in One element, possibly out of a set
part value to tell if we want the full thing 'datetime', date only 'date', or time only 'time'
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
part No namespace 'datetime'
Import precedence 0
Source
<xsl:template name="show-timestamp">
  <xsl:param name="in"/>
  <xsl:param name="part" select="'datetime'"/>
  <xsl:call-template name="formatDateTime">
    <xsl:with-param name="date" select="$in/@value"/>
    <xsl:with-param name="part" select="$part"/>
  </xsl:call-template>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-text-set
Documentation

Description

Show elements with datatype ST separated with the value in 'sep'. Calls show-text

Parameters

in Set of 0 to * elements
sep Separator between output of different elements. Default ', ' and special is 'br' which generates an HTML br tag
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace Select
in No namespace
sep No namespace ', '
Import precedence 0
Source
<xsl:template name="show-text-set">
  <xsl:param name="in"/>
  <xsl:param name="sep" select="', '"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 -->
      <xsl:when test="count($in) > 1">
        <xsl:for-each select="$in">
          <xsl:call-template name="show-text">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[hl7:item]">
        <xsl:for-each select="$in/hl7:item">
          <xsl:call-template name="show-text">
            <xsl:with-param name="in" select="."/>
          </xsl:call-template>
          <xsl:if test="position() != last()">
            <xsl:choose>
              <xsl:when test="$sep = 'br'">
                <br/>
              </xsl:when>
              <xsl:otherwise>
                <xsl:value-of select="$sep"/>
              </xsl:otherwise>
            </xsl:choose>
          </xsl:if>
        </xsl:for-each>
      </xsl:when>
      <!-- DTr1 or DTr2 -->
      <xsl:otherwise>
        <xsl:call-template name="show-text">
          <xsl:with-param name="in" select="$in"/>
        </xsl:call-template>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-text
Documentation

Description

Show element with datatype ST

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Template
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-text">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 and DTr2 -->
      <xsl:when test="$in[@nullFlavor]">
        <xsl:call-template name="show-nullFlavor">
          <xsl:with-param name="in" select="$in/@nullFlavor"/>
        </xsl:call-template>
      </xsl:when>
      <!-- DTr2 -->
      <xsl:when test="$in[@value]">
        <xsl:copy-of select="translate($in/@value, '
', '<br/>')"/>
      </xsl:when>
      <!-- DTr1 -->
      <xsl:otherwise>
        <xsl:copy-of select="translate($in/text(), '
', '<br/>')"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-boolean
Documentation

Description

Show element with datatype BL/BN

Parameters

in One element, possibly out of a set
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-boolean">
  <xsl:param name="in"/>
  <xsl:if test="$in">
    <xsl:choose>
      <!-- DTr1 and DTr2 -->
      <xsl:when test="$in[@value]">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="concat('boolean-', $in/@value)"/>
        </xsl:call-template>
      </xsl:when>
      <!-- DTr1 and DTr2 -->
      <xsl:when test="$in[@nullFlavor]">
        <xsl:call-template name="show-nullFlavor">
          <xsl:with-param name="in" select="$in/@nullFlavor"/>
        </xsl:call-template>
      </xsl:when>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template show-nullFlavor
Documentation

Description

Show a nullFlavor as text

Parameters

in The nullFlavor code, e.g. NI, OTH
Namespace No namespace
Used by
References
Parameters
QName Namespace
in No namespace
Import precedence 0
Source
<xsl:template name="show-nullFlavor">
  <xsl:param name="in"/>
  <xsl:if test="string-length($in) > 0">
    <xsl:call-template name="getLocalizedString">
      <xsl:with-param name="key" select="concat('nullFlavor_', $in)"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template formatMonth
Documentation

Description

Takes the 5th and 6th character from a timestamp, and returns the localized month name

Parameters

date Timestamp string

Description

 ====================================================================== 
                           Supporting functions                         
 ====================================================================== 
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
date No namespace
Import precedence 0
Source
<xsl:template name="formatMonth">
  <xsl:param name="date"/>
  <!-- month -->
  <xsl:variable name="month" select="substring($date, 5, 2)"/>
  <xsl:choose>
    <xsl:when test="$month = '01'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'January'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '02'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'February'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '03'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'March'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '04'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'April'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '05'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'May'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '06'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'June'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '07'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'July'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '08'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'August'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '09'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'September'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '10'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'October'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '11'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'November'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$month = '12'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'December'"/>
        <xsl:with-param name="post" select="' '"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$month"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template formatDateTime
Documentation

Description

Formats a timestamp

Parameters

date
part value to tell if we want the full thing 'datetime', date only 'date', or time only 'time'
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace Select
date No namespace
part No namespace 'datetime'
Import precedence 0
Source
<xsl:template name="formatDateTime">
  <xsl:param name="date"/>
  <xsl:param name="part" select="'datetime'"/>
  <xsl:variable name="yearNum" select="substring ($date, 1, 4)"/>
  <xsl:variable name="monthNum" select="substring ($date, 5, 2)"/>
  <xsl:variable name="monthText">
    <xsl:call-template name="formatMonth">
      <xsl:with-param name="date" select="$date"/>
    </xsl:call-template>
  </xsl:variable>
  <xsl:variable name="dayNum">
    <xsl:choose>
      <xsl:when test="substring($date, 7, 1) = '0'">
        <xsl:value-of select="substring($date, 8, 1)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring($date, 7, 2)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:if test="not($part = 'time')">
    <xsl:choose>
      <xsl:when test="$textLangPartLowerCase = 'nl'">
        <xsl:value-of select="$dayNum"/>
        <xsl:text> </xsl:text>
        <xsl:call-template name="caseDown">
          <xsl:with-param name="data" select="$monthText"/>
        </xsl:call-template>
        <xsl:text> </xsl:text>
        <xsl:value-of select="$yearNum"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:call-template name="firstCharCaseUp">
          <xsl:with-param name="data" select="$monthText"/>
        </xsl:call-template>
        <xsl:if test="string-length($dayNum) > 0">
          <xsl:text> </xsl:text>
          <xsl:value-of select="$dayNum"/>
        </xsl:if>
        <xsl:if test="string-length($yearNum) > 0">
          <xsl:text>, </xsl:text>
          <xsl:value-of select="$yearNum"/>
        </xsl:if>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:if>
  <!-- time and US timezone -->
  <xsl:if test="string-length($date) > 8 and not($part = 'date')">
    <xsl:if test="not($part = 'time')">
      <xsl:text>, </xsl:text>
    </xsl:if>
    <!-- time -->
    <xsl:variable name="time">
      <xsl:value-of select="substring($date, 9, 6)"/>
    </xsl:variable>
    <xsl:variable name="hh">
      <xsl:value-of select="substring($time, 1, 2)"/>
    </xsl:variable>
    <xsl:variable name="mm">
      <xsl:value-of select="substring($time, 3, 2)"/>
    </xsl:variable>
    <xsl:variable name="ss">
      <xsl:value-of select="substring($time, 5, 2)"/>
    </xsl:variable>
    <xsl:if test="string-length($hh) > 1">
      <xsl:choose>
        <xsl:when test="$textLangPartLowerCase = 'en' and number($hh) > 12">
          <xsl:value-of select="number($hh) - 12"/>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$hh"/>
        </xsl:otherwise>
      </xsl:choose>
      <xsl:choose>
        <xsl:when test="string-length($mm) > 1 and not(contains($mm, '-')) and not(contains($mm, '+')) and not($mm = '00' and $ss = '00')">
          <xsl:text>:</xsl:text>
          <xsl:value-of select="$mm"/>
          <xsl:if test="string-length($ss) > 1 and not(contains($ss, '-')) and not(contains($ss, '+')) and not($ss = '00')">
            <xsl:text>:</xsl:text>
            <xsl:value-of select="$ss"/>
          </xsl:if>
        </xsl:when>
        <xsl:when test="$textLangPartLowerCase = 'nl'">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="'h'"/>
          </xsl:call-template>
        </xsl:when>
      </xsl:choose>
      <xsl:if test="$textLangPartLowerCase = 'en'">
        <xsl:choose>
          <xsl:when test="number($hh) > 12">
            <xsl:text>PM</xsl:text>
          </xsl:when>
          <xsl:otherwise>
            <xsl:text>AM</xsl:text>
          </xsl:otherwise>
        </xsl:choose>
      </xsl:if>
    </xsl:if>
    <!-- time zone. Don't try getting a name for it as that will always fail parts of the year due to daylight savings -->
    <xsl:choose>
      <xsl:when test="contains($date, '+')">
        <xsl:text> +</xsl:text>
        <xsl:value-of select="substring-after($date, '+')"/>
      </xsl:when>
      <xsl:when test="contains($date, '-')">
        <xsl:text> -</xsl:text>
        <xsl:value-of select="substring-after($date, '-')"/>
      </xsl:when>
    </xsl:choose>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template getAge
Documentation

Description

Get someones age based on the difference between 'date' and currentDate.

Parameters

date Persons date of birth as HL7 TS
comparedate The date, format yyyymmdd as HL7 TS, that the age should be calculated relative to
Namespace No namespace
Used by
Parameters
QName Namespace
comparedate No namespace
date No namespace
Import precedence 0
Source
<xsl:template name="getAge">
  <xsl:param name="comparedate"/>
  <xsl:param name="date"/>
  <xsl:variable name="yearNum" select="substring($date, 1, 4)"/>
  <xsl:variable name="monthNum" select="substring($date, 5, 2)"/>
  <xsl:variable name="dayNum">
    <xsl:choose>
      <xsl:when test="substring ($date, 7, 1)="0"">
        <xsl:value-of select="substring($date, 8, 1)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring($date, 7, 2)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="yearNumCreate" select="substring($comparedate, 1, 4)"/>
  <xsl:variable name="monthNumCreate" select="substring($comparedate, 5, 2)"/>
  <xsl:variable name="dayNumCreate">
    <xsl:choose>
      <xsl:when test="substring ($comparedate, 7, 1)="0"">
        <xsl:value-of select="substring($comparedate, 8, 1)"/>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring($comparedate, 7, 2)"/>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:variable name="yearDiff" select="number($yearNumCreate) - number($yearNum)"/>
  <xsl:choose>
    <xsl:when test="number($monthNum) < number($monthNumCreate)">
      <xsl:value-of select="$yearDiff"/>
    </xsl:when>
    <xsl:when test="number($monthNum) > number($monthNumCreate)">
      <xsl:value-of select="$yearDiff - 1"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:choose>
        <xsl:when test="number($dayNum) <= number($dayNumCreate)">
          <xsl:value-of select="$yearDiff"/>
        </xsl:when>
        <xsl:when test="number($dayNum) > number($dayNumCreate)">
          <xsl:value-of select="$yearDiff - 1"/>
        </xsl:when>
      </xsl:choose>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template translateTelecomUriScheme
Documentation

Description

Convert Telecom URI scheme (tel, fax, http, mailto) to display text

Parameters

code Scheme string
Namespace No namespace
Used by
Template
References
Parameters
QName Namespace
code No namespace
Import precedence 0
Source
<xsl:template name="translateTelecomUriScheme">
  <xsl:param name="code"/>
  <!--xsl:value-of select="document('voc.xml')/systems/system[@root=$code/@codeSystem]/code[@value=$code/@code]/@displayName"/-->
  <!--xsl:value-of select="document('codes.xml')/*/code[@code=$code]/@display"/-->
  <xsl:choose>
    <!-- lookup table Telecom URI -->
    <xsl:when test="$code = 'tel'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'Tel'"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$code = 'fax'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'Fax'"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$code = 'http' or $code = 'https'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'Web'"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:when test="$code = 'mailto'">
      <xsl:call-template name="getLocalizedString">
        <xsl:with-param name="key" select="'Mail'"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:text>{$code='</xsl:text>
      <xsl:value-of select="$code"/>
      <xsl:text>'?}</xsl:text>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template caseDown
Documentation

Description

Converts Latin characters in input to lower case and returns the result

Parameters

data Input string
Namespace No namespace
Used by
References
Variables
Parameters
QName Namespace
data No namespace
Import precedence 0
Source
<xsl:template name="caseDown">
  <xsl:param name="data"/>
  <xsl:if test="$data">
    <xsl:value-of select="translate($data, $uc, $lc)"/>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template caseUp
Documentation

Description

Converts Latin characters in input to upper case and returns the result

Parameters

data Input string
Namespace No namespace
Used by
References
Variables
Parameters
QName Namespace
data No namespace
Import precedence 0
Source
<xsl:template name="caseUp">
  <xsl:param name="data"/>
  <xsl:if test="$data">
    <xsl:value-of select="translate($data,$lc, $uc)"/>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template firstCharCaseUp
Documentation

Description

Converts first character in input to upper case if it is a Latin character and returns the result

Parameters

data Input string
Namespace No namespace
Used by
References
Template
Parameters
QName Namespace
data No namespace
Import precedence 0
Source
<xsl:template name="firstCharCaseUp">
  <xsl:param name="data"/>
  <xsl:if test="$data">
    <xsl:call-template name="caseUp">
      <xsl:with-param name="data" select="substring($data, 1, 1)"/>
    </xsl:call-template>
    <xsl:value-of select="substring($data, 2)"/>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template tokenize
Documentation

Description

Tokenize based on delimiters, or if no delimiter do character tokenization

Parameters

string String to tokenize
delimiters Optional delimiter string
prefix Optional prefix for every 'array' item
localize Optional parameter to determine if we should just tokenize or also try to localize array items (default)
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
delimiters No namespace ' '
localize No namespace true()
prefix No namespace
string No namespace ''
Import precedence 0
Source
<xsl:template name="tokenize">
  <xsl:param name="string" select="''"/>
  <xsl:param name="delimiters" select="' '"/>
  <xsl:param name="prefix"/>
  <xsl:param name="localize" select="true()"/>
  <xsl:choose>
    <xsl:when test="not($string)"/>
    <xsl:when test="not($delimiters)">
      <xsl:call-template name="_tokenize-characters">
        <xsl:with-param name="string" select="$string"/>
        <xsl:with-param name="prefix" select="$prefix"/>
        <xsl:with-param name="localize" select="$localize"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="_tokenize-delimiters">
        <xsl:with-param name="string" select="$string"/>
        <xsl:with-param name="delimiters" select="$delimiters"/>
        <xsl:with-param name="prefix" select="$prefix"/>
        <xsl:with-param name="localize" select="$localize"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template _tokenize-characters
Documentation

Description

Tokenize every character

Parameters

string String to tokenize
prefix Optional prefix for every 'array' item
localize Optional parameter to determine if we should just tokenize or also try to localize array items (default)
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
localize No namespace true()
prefix No namespace
string No namespace
Import precedence 0
Source
<xsl:template name="_tokenize-characters">
  <xsl:param name="string"/>
  <xsl:param name="prefix"/>
  <xsl:param name="localize" select="true()"/>
  <xsl:if test="$string">
    <xsl:choose>
      <xsl:when test="$localize">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="concat($prefix,substring($string, 1, 1))"/>
        </xsl:call-template>
      </xsl:when>
      <xsl:otherwise>
        <xsl:value-of select="substring($string, 1, 1)"/>
      </xsl:otherwise>
    </xsl:choose>
    <xsl:call-template name="_tokenize-characters">
      <xsl:with-param name="string" select="substring($string, 2)"/>
      <xsl:with-param name="prefix" select="$prefix"/>
      <xsl:with-param name="localize" select="$localize"/>
    </xsl:call-template>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template _tokenize-delimiters
Documentation

Description

Tokenize based on delimiters

Parameters

string String to tokenize
delimiters Required delimiter string
prefix Optional prefix for every 'array' item
localize Optional parameter to determine if we should just tokenize or also try to localize array items (default)
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
delimiters No namespace
localize No namespace true()
prefix No namespace
string No namespace
Import precedence 0
Source
<xsl:template name="_tokenize-delimiters">
  <xsl:param name="string"/>
  <xsl:param name="delimiters"/>
  <xsl:param name="prefix"/>
  <xsl:param name="localize" select="true()"/>
  <xsl:variable name="delimiter" select="substring($delimiters, 1, 1)"/>
  <xsl:choose>
    <xsl:when test="not($delimiter)">
      <xsl:choose>
        <xsl:when test="$localize">
          <xsl:call-template name="getLocalizedString">
            <xsl:with-param name="key" select="concat($prefix, $string)"/>
          </xsl:call-template>
        </xsl:when>
        <xsl:otherwise>
          <xsl:value-of select="$string"/>
        </xsl:otherwise>
      </xsl:choose>
    </xsl:when>
    <xsl:when test="contains($string, $delimiter)">
      <xsl:if test="not(starts-with($string, $delimiter))">
        <xsl:call-template name="_tokenize-delimiters">
          <xsl:with-param name="string" select="substring-before($string, $delimiter)"/>
          <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
          <xsl:with-param name="prefix" select="$prefix"/>
          <xsl:with-param name="localize" select="$localize"/>
        </xsl:call-template>
      </xsl:if>
      <xsl:text> </xsl:text>
      <xsl:call-template name="_tokenize-delimiters">
        <xsl:with-param name="string" select="substring-after($string, $delimiter)"/>
        <xsl:with-param name="delimiters" select="$delimiters"/>
        <xsl:with-param name="prefix" select="$prefix"/>
        <xsl:with-param name="localize" select="$localize"/>
      </xsl:call-template>
    </xsl:when>
    <xsl:otherwise>
      <xsl:call-template name="_tokenize-delimiters">
        <xsl:with-param name="string" select="$string"/>
        <xsl:with-param name="delimiters" select="substring($delimiters, 2)"/>
        <xsl:with-param name="prefix" select="$prefix"/>
        <xsl:with-param name="localize" select="$localize"/>
      </xsl:call-template>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template getLocalizedString
Documentation

Description

Retrieves a language dependant string from our language file such as a label based on a key. Returns string based on textLang, textLangDefault, the first two characters of the textLangDefault, e.g. 'en' in 'en-US' and finally if all else fails just the key text.

Parameters

pre Some text or space to prefix our string with
key The key to find our text with
post Some text like a colon or space to postfix our text with
Namespace No namespace
Used by
References
Parameters
QName Namespace Select
key No namespace
post No namespace ''
pre No namespace ''
Import precedence 0
Source
<xsl:template name="getLocalizedString">
  <xsl:param name="pre" select="''"/>
  <xsl:param name="key"/>
  <xsl:param name="post" select="''"/>
  <xsl:choose>
    <!-- compare 'de-CH' -->
    <xsl:when test="$vocMessages//translation[@key = $key]/value[@lang = $textLangLowerCase]">
      <xsl:value-of select="concat($pre,$vocMessages//translation[@key = $key]/value[@lang=$textLangLowerCase]/text(),$post)"/>
    </xsl:when>
    <!-- compare 'de' in 'de-CH' -->
    <xsl:when test="$vocMessages//translation[@key = $key]/value[substring(@lang, 1, 2)=$textLangPartLowerCase]">
      <xsl:value-of select="concat($pre,$vocMessages//translation[@key = $key]/value[substring(@lang, 1, 2)=$textLangPartLowerCase]/text(),$post)"/>
    </xsl:when>
    <!-- compare 'en-US' -->
    <xsl:when test="$vocMessages//translation[@key = $key]/value[@lang=$textLangDefaultLowerCase]">
      <xsl:value-of select="concat($pre,$vocMessages//translation[@key = $key]/value[@lang=$textLangDefaultLowerCase]/text(),$post)"/>
    </xsl:when>
    <!-- compare 'en' in 'en-US' -->
    <xsl:when test="$vocMessages//translation[@key = $key]/value[substring(@lang, 1, 2)=$textLangDefaultPartLowerCase]">
      <xsl:value-of select="concat($pre,$vocMessages//translation[@key = $key]/value[substring(@lang, 1, 2)=$textLangDefaultPartLowerCase]/text(),$post)"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="concat($pre,$key,$post)"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template raiseFontSize
Documentation

Description

Helper template for calculation of CSS font sizes. Takes font-size-main as base and adds the value in parameter with while retaining the unit.

Parameters

with The value to add to the base value. May be a negative number
Namespace No namespace
Used by
References
Parameter
Parameters
QName Namespace
with No namespace
Import precedence 0
Source
<xsl:template name="raiseFontSize">
  <xsl:param name="with"/>
  <xsl:variable name="mainsize" select="translate($font-size-main,'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz','')"/>
  <xsl:variable name="mainunit" select="translate($font-size-main,'0123456789','')"/>
  <xsl:value-of select="number($mainsize)+number($with)"/>
  <xsl:value-of select="$mainunit"/>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template make-sectiontoggle
Documentation

Description

generate global section toggle


Description

 ====================================================================== 
                             Javascript stuff                           
 ====================================================================== 
Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="make-sectiontoggle">
  <xsl:if test="count(hl7:component/hl7:structuredBody/hl7:component[hl7:section]) > 0">
    <td style="background-color: white;">
      <!-- creates toggle for sections -->
      <div id="sectionsToggleExpand" style="display: none;" class="span_button" onclick="expandAllSections();">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'Expand All'"/>
        </xsl:call-template>
      </div>
      <div id="sectionsToggleCollapse" class="span_button" onclick="collapseAllSections();">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'Collapse All'"/>
        </xsl:call-template>
      </div>
    </td>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template make-revisiontoggle
Documentation

Description

generate revision toggle

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="make-revisiontoggle">
  <xsl:if test="//hl7:content[@revised]">
    <td style="background-color: white;">
      <!-- creates toggle for revisions marks -->
      <div id="revisionToggleOn" class="span_button" onclick="showReviewMarks();">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'show revisions'"/>
        </xsl:call-template>
      </div>
      <div id="revisionToggleOff" style="display: none;" class="span_button" onclick="hideReviewMarks();">
        <xsl:call-template name="getLocalizedString">
          <xsl:with-param name="key" select="'hide revisions'"/>
        </xsl:call-template>
      </div>
    </td>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Template make-tableofcontents
Documentation

Description

generate table of contents

Namespace No namespace
Used by
References
Import precedence 0
Source
<xsl:template name="make-tableofcontents">
  <xsl:variable name="tocid">
    <xsl:choose>
      <xsl:when test="$useJavascript">
        <xsl:text>nav</xsl:text>
      </xsl:when>
      <xsl:otherwise>
        <xsl:text>nonav</xsl:text>
      </xsl:otherwise>
    </xsl:choose>
  </xsl:variable>
  <xsl:if test="count(hl7:component/hl7:structuredBody/hl7:component[hl7:section]) > 1">
    <td style="width: 35%; background-color: white;">
      <!-- produce table of contents -->
      <ul id="{$tocid}">
        <li style="list-style: none;">
          <div class="span_button">
            <xsl:call-template name="getLocalizedString">
              <xsl:with-param name="key" select="'Table of Contents'"/>
            </xsl:call-template>
            <xsl:text> ∇</xsl:text>
          </div>
          <ul>
            <xsl:for-each select="hl7:component/hl7:structuredBody/hl7:component/hl7:section">
              <li>
                <a>
                  <xsl:attribute name="href">
                    <xsl:text>#</xsl:text>
                    <xsl:choose>
                      <xsl:when test="@ID">
                        <xsl:value-of select="@ID"/>
                      </xsl:when>
                      <xsl:otherwise>
                        <xsl:apply-templates select="." mode="getAnchorName"/>
                      </xsl:otherwise>
                    </xsl:choose>
                  </xsl:attribute>
                  <xsl:apply-templates select="." mode="getTitleName"/>
                  <xsl:if test="@nullFlavor">
                    <xsl:text> (</xsl:text>
                    <xsl:call-template name="show-nullFlavor">
                      <xsl:with-param name="in" select="@nullFlavor"/>
                    </xsl:call-template>
                    <xsl:text>)</xsl:text>
                  </xsl:if>
                  <xsl:if test="$menu-depth > 1 and hl7:component/hl7:section">
                    <xsl:text></xsl:text>
                  </xsl:if>
                </a>
                <xsl:if test="$menu-depth > 1 and hl7:component/hl7:section">
                  <ul>
                    <xsl:for-each select="hl7:component/hl7:section">
                      <li style="padding-left: 2em;">
                        <a>
                          <xsl:attribute name="href">
                            <xsl:text>#</xsl:text>
                            <xsl:choose>
                              <xsl:when test="@ID">
                                <xsl:value-of select="@ID"/>
                              </xsl:when>
                              <xsl:otherwise>
                                <xsl:apply-templates select="." mode="getAnchorName"/>
                              </xsl:otherwise>
                            </xsl:choose>
                          </xsl:attribute>
                          <xsl:apply-templates select="." mode="getTitleName"/>
                          <xsl:if test="$menu-depth > 2 and hl7:component/hl7:section">
                            <xsl:text></xsl:text>
                          </xsl:if>
                        </a>
                        <xsl:if test="$menu-depth > 2 and hl7:component/hl7:section">
                          <ul>
                            <xsl:for-each select="hl7:component/hl7:section">
                              <li style="padding-left: 2em;">
                                <a>
                                  <xsl:attribute name="href">
                                    <xsl:text>#</xsl:text>
                                    <xsl:choose>
                                      <xsl:when test="@ID">
                                        <xsl:value-of select="@ID"/>
                                      </xsl:when>
                                      <xsl:otherwise>
                                        <xsl:apply-templates select="." mode="getAnchorName"/>
                                      </xsl:otherwise>
                                    </xsl:choose>
                                  </xsl:attribute>
                                  <xsl:apply-templates select="." mode="getTitleName"/>
                                </a>
                              </li>
                            </xsl:for-each>
                          </ul>
                        </xsl:if>
                      </li>
                    </xsl:for-each>
                  </ul>
                </xsl:if>
              </li>
            </xsl:for-each>
          </ul>
        </li>
      </ul>
    </td>
  </xsl:if>
</xsl:template>
Stylesheet location CDA.xsl
[ top ]
Parameter currentDate
Documentation

Description

XSLT 1.0 does not have date function, so we need something to compare against e.g. to get someones age

Namespace No namespace
Select (/hl7:ClinicalDocument/hl7:effectiveTime/@value)[1]
Used by
Template
Source
<xsl:param name="currentDate" select="(/hl7:ClinicalDocument/hl7:effectiveTime/@value)[1]"/>
Stylesheet location CDA.xsl
[ top ]
Parameter vocFile
Documentation

Description

Vocabulary file containing language dependant strings such as labels

Namespace No namespace
Select 'cda_l10n.xml'
Used by
Variable
Source
<xsl:param name="vocFile" select="'cda_l10n.xml'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter textlangDefault
Documentation

Description

Default language for retrieval of language dependant strings such as labels, e.g. 'en-US'. This is the fallback language in case the string is not available in the actual language. See also textLang.

Namespace No namespace
Select 'en-US'
Used by
Parameter
Variable
Source
<xsl:param name="textlangDefault" select="'en-US'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter textLang
Documentation

Description

Actual language for retrieval of language dependant strings such as labels, e.g. 'en-US'. Unless supplied, this is taken from the ClinicalDocument/language/@code attribute, or in case that is not present from textlangDefault.

Namespace No namespace
Used by
References
Parameter
Source
<xsl:param name="textLang">
  <xsl:choose>
    <xsl:when test="/hl7:ClinicalDocument/hl7:languageCode/@code">
      <xsl:value-of select="/hl7:ClinicalDocument/hl7:languageCode/@code"/>
    </xsl:when>
    <xsl:otherwise>
      <xsl:value-of select="$textlangDefault"/>
    </xsl:otherwise>
  </xsl:choose>
</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter textEncoding
Documentation

Description

Currently unused. Unsupported by Internet Explorer. Text encoding to render the output in. Defaults to UTF-8 which is fine for most environments. Could change into more localized encodings such as cp-1252 (Windows Latin 1), iso-8859-1 (Latin 1), or shift-jis (Japanese Kanji table))

Namespace No namespace
Select 'utf-8'
Source
<xsl:param name="textEncoding" select="'utf-8'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter useJavascript
Documentation

Description

Boolean value for whether the result document may contain JavaScript. Some environments forbid the use of JavaScript. Without JavaScript, certain more dynamic features may not work.

Namespace No namespace
Select 'true'
Used by
Source
<xsl:param name="useJavascript" select="'true'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter externalCss
Documentation

Description

Absolute or relative URI to an external Cascading Stylesheet (CSS) file that contains style attributes for custom markup, e.g. in the @styleCode attribute in Section.text

Namespace No namespace
Used by
Source
<xsl:param name="externalCss"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-family
Documentation

Description

Determines the font family for the whole document unless overruled somewhere

Namespace No namespace
Select 'Verdana, Tahoma, sans-serif'
Used by
Source
<xsl:param name="font-family" select="'Verdana, Tahoma, sans-serif'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-main
Documentation

Description

Determines the font size for all text unless otherwise specified, and is the base value for other font sizes

Namespace No namespace
Select '9pt'
Used by
Source
<xsl:param name="font-size-main" select="'9pt'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h1
Documentation

Description

Determines the font size for text in the h1 tag, defaults to font-size-main + 3

Namespace No namespace
Used by
References
Template
Source
<xsl:param name="font-size-h1">
  <xsl:call-template name="raiseFontSize">
    <xsl:with-param name="with" select="3"/>
  </xsl:call-template>
</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h2
Documentation

Description

Determines the font size for text in the h2 tag, defaults to font-size-main + 2

Namespace No namespace
Used by
References
Template
Source
<xsl:param name="font-size-h2">
  <xsl:call-template name="raiseFontSize">
    <xsl:with-param name="with" select="2"/>
  </xsl:call-template>
</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h3
Documentation

Description

Determines the font size for text in the h3 tag, defaults to font-size-main + 1

Namespace No namespace
Used by
References
Template
Source
<xsl:param name="font-size-h3">
  <xsl:call-template name="raiseFontSize">
    <xsl:with-param name="with" select="1"/>
  </xsl:call-template>
</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h4
Documentation

Description

Determines the font size for text in the h4 tag, defaults to font-size-main

Namespace No namespace
Select $font-size-main
Used by
References
Parameter
Source
<xsl:param name="font-size-h4" select="$font-size-main"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h5
Documentation

Description

Determines the font size for text in the h5 tag, defaults to font-size-main

Namespace No namespace
Select $font-size-main
Used by
References
Parameter
Source
<xsl:param name="font-size-h5" select="$font-size-main"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-h6
Documentation

Description

Determines the font size for text in the h6 tag, defaults to font-size-main

Namespace No namespace
Select $font-size-main
Used by
References
Parameter
Source
<xsl:param name="font-size-h6" select="$font-size-main"/>
Stylesheet location CDA.xsl
[ top ]
Parameter font-size-footnote
Documentation

Description

Determines the font size for footnote text, defaults to font-size-main - 1

Namespace No namespace
Used by
References
Template
Source
<xsl:param name="font-size-footnote">
  <xsl:call-template name="raiseFontSize">
    <xsl:with-param name="with" select="-1"/>
  </xsl:call-template>
</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter bgcolor-th
Documentation

Description

Determines the background-color, as any legal hex, rgb or named color, for header like table elements, e.g. th tags, defaults to "LightGrey".

Namespace No namespace
Used by
Source
<xsl:param name="bgcolor-th">LightGrey</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter bgcolor-td
Documentation

Description

Determines the background-color, as any legal hex, rgb or named color, for body like table elements, e.g. td tags, defaults to "#f2f2f2".

Namespace No namespace
Used by
Source
<xsl:param name="bgcolor-td">#f2f2f2</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter dohtmlheader
Documentation

Description

Determines if the document title and top level summary of header information (patient/guardian/author/encounter/documentationOf, inFulfillmentOf) should be rendered. Defaults to "true", any other value is interpreted as "do not render". Some systems may have a context around the rendering of the document that would make rendering the header superfluous. Note that the footer, which may be switched off separately contains everything that the header does and more.

Namespace No namespace
Used by
Source
<xsl:param name="dohtmlheader">true</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter dohtmlfooter
Documentation

Description

Determines if the document footer containing a listing of everything in the CDA Header should be rendered. Defaults to "true", any other value is interpreted as "do not render". Some systems may have a context around the rendering of the document that would make rendering the footer superfluous, or just want to concentrate on document contents.

Namespace No namespace
Used by
Source
<xsl:param name="dohtmlfooter">true</xsl:param>
Stylesheet location CDA.xsl
[ top ]
Parameter external-image-whitelist
Documentation

Description

Security parameter. May contain a vertical bar separated list of URI prefixes, such as "http://www.example.com|https://www.example.com". See parameter limit-external-images for more detail.

Namespace No namespace
Source
<xsl:param name="external-image-whitelist"/>
Stylesheet location CDA.xsl
[ top ]
Parameter limit-external-images
Documentation

Description

Security parameter. When set to 'yes' limits the URIs to images (if any) to locally attached images and/or images that are on the external-image-whitelist. When set to anything other than 'yes' also allows for arbitrary external images (e.g. through http:// or https://). Default value is 'yes' which is considered defensive against potential security risks that could stem from resources loaded from arbitrary source.

Namespace No namespace
Select 'yes'
Source
<xsl:param name="limit-external-images" select="'yes'"/>
Stylesheet location CDA.xsl
[ top ]
Parameter menu-depth
Documentation

Description

Determines depth of menu at the top of the document. Default is 1, which means just head section. Max is 3 which is head section + 2 levels (if any)
Namespace No namespace
Select 3
Used by
Source
<xsl:param name="menu-depth" select="3"/>
Stylesheet location CDA.xsl
[ top ]
Parameter skip-ids
Documentation

Description

Privacy parameter. Accepts a comma separated list of patient ID root values (normally OID's). When a patient ID is encountered with a root value in this list, then the rendering of the extension will be xxx-xxx-xxx regardless of what the actual value is. This is useful to prevent public display of for example the US SSN. Default is to render any ID as it occurs in the document. Note that this setting only affects human rendering and that it does not affect automated processing of the underlying document. If the same value also occurs in the skip-ids list, then that takes precedence.
Namespace No namespace
Used by
Variable
Source
<xsl:param name="skip-ids"/>
Stylesheet location CDA.xsl
[ top ]
Parameter mask-ids
Documentation

Description

Privacy parameter. Accepts a comma separated list of patient ID root values (normally OID's). When a patient ID is encountered with a root value in this list, then the rendering of this ID will be skipped. This is useful to prevent public display of for example the US SSN. Default is to render any ID as it occurs in the document. Note that this setting only affects human rendering and that it does not affect automated processing of the underlying document.
Namespace No namespace
Used by
Variable
Source
<xsl:param name="mask-ids"/>
Stylesheet location CDA.xsl
[ top ]
Parameter dosectionnumbering
Documentation

Description

Determines if sections will receive numbering according to ClinicalDocument order. Value 'true' activates numbering. Top level sections are 1, 2, 3, 4, sub level sections are 1.1, 1.2, 1.2.1, 1.2.2 etc.
Namespace No namespace
Select 'false'
Used by
Source
<xsl:param name="dosectionnumbering" select="'false'"/>
Stylesheet location CDA.xsl
[ top ]
Variable vocMessages
Documentation

Description

Cache language dependant strings

Namespace No namespace
Select document($vocFile)
Used by
References
Parameter
Source
<xsl:variable name="vocMessages" select="document($vocFile)"/>
Stylesheet location CDA.xsl
[ top ]
Variable skip-ids-var
Namespace No namespace
Select concat(',',$skip-ids,',')
Used by
References
Parameter
Source
<xsl:variable name="skip-ids-var" select="concat(',',$skip-ids,',')"/>
Stylesheet location CDA.xsl
[ top ]
Variable mask-ids-var
Namespace No namespace
Select concat(',',$mask-ids,',')
Used by
Template
References
Parameter
Source
<xsl:variable name="mask-ids-var" select="concat(',',$mask-ids,',')"/>
Stylesheet location CDA.xsl
[ top ]
Variable textLangLowerCase
Documentation

Description

Do lowercase compare of language+region

Namespace No namespace
Used by
References
Template
Parameter
Source
<xsl:variable name="textLangLowerCase">
  <xsl:call-template name="caseDown">
    <xsl:with-param name="data" select="$textLang"/>
  </xsl:call-template>
</xsl:variable>
Stylesheet location CDA.xsl
[ top ]
Variable textLangPartLowerCase
Documentation

Description

Do lowercase compare of language (assume alpha2 not alpha3)

Namespace No namespace
Select substring($textLangLowerCase,1,2)
Used by
References
Source
<xsl:variable name="textLangPartLowerCase" select="substring($textLangLowerCase,1,2)"/>
Stylesheet location CDA.xsl
[ top ]
Variable textLangDefaultLowerCase
Documentation

Description

Do lowercase compare of default language+region

Namespace No namespace
Used by
References
Template
Parameter
Source
<xsl:variable name="textLangDefaultLowerCase">
  <xsl:call-template name="caseDown">
    <xsl:with-param name="data" select="$textlangDefault"/>
  </xsl:call-template>
</xsl:variable>
Stylesheet location CDA.xsl
[ top ]
Variable textLangDefaultPartLowerCase
Documentation

Description

Do lowercase compare of default language (assume alpha2 not alpha3)

Namespace No namespace
Select substring($textLangDefaultLowerCase,1,2)
Used by
References
Source
<xsl:variable name="textLangDefaultPartLowerCase" select="substring($textLangDefaultLowerCase,1,2)"/>
Stylesheet location CDA.xsl
[ top ]
Variable lc
Documentation

Description

String processing variable. Lower-case alphabet

Namespace No namespace
Select 'abcdefghijklmnopqrstuvwxyz'
Used by
Source
<xsl:variable name="lc" select="'abcdefghijklmnopqrstuvwxyz'"/>
Stylesheet location CDA.xsl
[ top ]
Variable uc
Documentation

Description

String processing variable. Upper-case alphabet

Namespace No namespace
Select 'ABCDEFGHIJKLMNOPQRSTUVWXYZ'
Used by
Source
<xsl:variable name="uc" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
Stylesheet location CDA.xsl
[ top ]
Variable simple-sanitizer-match
Documentation

Description

String processing variable. Removes the following characters, in addition to line breaks "':;?`{}“”„‚’

Namespace No namespace
Used by
Source
<xsl:variable name="simple-sanitizer-match">
  <xsl:text>

"':;?`{}“”„‚’</xsl:text>
</xsl:variable>
Stylesheet location CDA.xsl
[ top ]
Variable simple-sanitizer-replace
Documentation

Description

String processing variable.

Namespace No namespace
Select '***************'
Used by
Source
<xsl:variable name="simple-sanitizer-replace" select="'***************'"/>
Stylesheet location CDA.xsl
[ top ]
Variable table-elem-attrs
Documentation

Description

<xd:doc>
        <xd:desc>
            <xd:p>Handle renderMultiMedia. Produces one or more iframes depending on the number of IDREFS in @referencedObject. Can have a caption on all of them.</xd:p>
        </xd:desc>
    </xd:doc>
    <xsl:template match="hl7:renderMultiMedia">
        <xsl:variable name="idrefs">
            <xsl:call-template name="tokenize">
                <xsl:with-param name="string" select="@referencedObject"/>
            </xsl:call-template>
        </xsl:variable>
        
        <xsl:apply-templates select="ancestor::hl7:ClinicalDocument//hl7:observationMedia[@ID = $idrefs]"/>
    </xsl:template>
Namespace No namespace
Used by
Source
<xsl:variable name="table-elem-attrs">
  <tableElems>
    <elem name="table">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="summary"/>
      <attr name="width"/>
      <attr name="border"/>
      <attr name="frame"/>
      <attr name="rules"/>
      <attr name="cellspacing"/>
      <attr name="cellpadding"/>
    </elem>
    <elem name="thead">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="tfoot">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="tbody">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="colgroup">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="span"/>
      <attr name="width"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="col">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="span"/>
      <attr name="width"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="tr">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="th">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="abbr"/>
      <attr name="axis"/>
      <attr name="headers"/>
      <attr name="scope"/>
      <attr name="rowspan"/>
      <attr name="colspan"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
    <elem name="td">
      <attr name="ID"/>
      <attr name="language"/>
      <attr name="styleCode"/>
      <attr name="abbr"/>
      <attr name="axis"/>
      <attr name="headers"/>
      <attr name="scope"/>
      <attr name="rowspan"/>
      <attr name="colspan"/>
      <attr name="align"/>
      <attr name="char"/>
      <attr name="charoff"/>
      <attr name="valign"/>
    </elem>
  </tableElems>
</xsl:variable>
Stylesheet location CDA.xsl
[ top ]
Output (default)
Documentation

Description

Use XHTML 1.0 Strict with UTF-8 encoding. CDAr3 specifies an XHTML subset of tags in Section.text so that makes mapping easier.

Namespace No namespace
Output properties
encoding indent doctype-public doctype-system
utf-8 yes -//W3C//DTD XHTML 1.0 Strict//EN http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd
Source
<xsl:output indent="yes" encoding="utf-8" doctype-public="-//W3C//DTD XHTML 1.0 Strict//EN" doctype-system="http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"/>
Stylesheet location CDA.xsl
[ top ]