Guest User

Untitled

a guest
Mar 5th, 2013
409
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 331.99 KB | None | 0 0
  1. <?xml version="1.0" encoding="UTF-8" standalone="yes"?>
  2. <xsl:stylesheet xmlns:xhtml="http://www.w3.org/1999/xhtml"
  3.                xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
  4.                xmlns:saxon="http://saxon.sf.net/"
  5.                xmlns:xs="http://www.w3.org/2001/XMLSchema"
  6.                xmlns:xsd="http://www.w3.org/2001/XMLSchema"
  7.                xmlns:schold="http://www.ascc.net/xml/schematron"
  8.                xmlns:iso="http://purl.oclc.org/dsdl/schematron"
  9.                xmlns:cda="urn:hl7-org:v3"
  10.                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  11.                xmlns:jdv="http://esante.gouv.fr"
  12.                xmlns:svs="urn:ihe:iti:svs:2008"
  13.                version="2.0"><!--Implementers: please note that overriding process-prolog or process-root is
  14.    the preferred method for meta-stylesheets to use where possible. -->
  15. <xsl:param name="archiveDirParameter"/>
  16.    <xsl:param name="archiveNameParameter"/>
  17.    <xsl:param name="fileNameParameter"/>
  18.    <xsl:param name="fileDirParameter"/>
  19.    <xsl:variable name="document-uri">
  20.       <xsl:value-of select="document-uri(/)"/>
  21.    </xsl:variable>
  22.  
  23.    <!--PHASES-->
  24.  
  25.  
  26. <!--PROLOG-->
  27. <xsl:output xmlns:svrl="http://purl.oclc.org/dsdl/svrl" method="xml"
  28.               omit-xml-declaration="no"
  29.               standalone="yes"
  30.               indent="yes"/>
  31.  
  32.    <!--XSD TYPES FOR XSLT2-->
  33.  
  34.  
  35. <!--KEYS AND FUNCTIONS-->
  36.  
  37.  
  38. <!--DEFAULT RULES-->
  39.  
  40.  
  41. <!--MODE: SCHEMATRON-SELECT-FULL-PATH-->
  42. <!--This mode can be used to generate an ugly though full XPath for locators-->
  43. <xsl:template match="*" mode="schematron-select-full-path">
  44.       <xsl:apply-templates select="." mode="schematron-get-full-path-2"/>
  45.    </xsl:template>
  46.  
  47.    <!--MODE: SCHEMATRON-FULL-PATH-->
  48. <!--This mode can be used to generate an ugly though full XPath for locators-->
  49. <xsl:template match="*" mode="schematron-get-full-path">
  50.       <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
  51.       <xsl:text>/</xsl:text>
  52.       <xsl:choose>
  53.          <xsl:when test="namespace-uri()=''">
  54.             <xsl:value-of select="name()"/>
  55.          </xsl:when>
  56.          <xsl:otherwise>
  57.             <xsl:text>*:</xsl:text>
  58.             <xsl:value-of select="local-name()"/>
  59.             <xsl:text>[namespace-uri()='</xsl:text>
  60.             <xsl:value-of select="namespace-uri()"/>
  61.             <xsl:text>']</xsl:text>
  62.          </xsl:otherwise>
  63.       </xsl:choose>
  64.       <xsl:variable name="preceding"
  65.                    select="count(preceding-sibling::*[local-name()=local-name(current())                                   and namespace-uri() = namespace-uri(current())])"/>
  66.       <xsl:text>[</xsl:text>
  67.       <xsl:value-of select="1+ $preceding"/>
  68.       <xsl:text>]</xsl:text>
  69.    </xsl:template>
  70.    <xsl:template match="@*" mode="schematron-get-full-path">
  71.       <xsl:apply-templates select="parent::*" mode="schematron-get-full-path"/>
  72.       <xsl:text>/</xsl:text>
  73.       <xsl:choose>
  74.          <xsl:when test="namespace-uri()=''">@<xsl:value-of select="name()"/>
  75.          </xsl:when>
  76.          <xsl:otherwise>
  77.             <xsl:text>@*[local-name()='</xsl:text>
  78.             <xsl:value-of select="local-name()"/>
  79.             <xsl:text>' and namespace-uri()='</xsl:text>
  80.             <xsl:value-of select="namespace-uri()"/>
  81.             <xsl:text>']</xsl:text>
  82.          </xsl:otherwise>
  83.       </xsl:choose>
  84.    </xsl:template>
  85.  
  86.    <!--MODE: SCHEMATRON-FULL-PATH-2-->
  87. <!--This mode can be used to generate prefixed XPath for humans-->
  88. <xsl:template match="node() | @*" mode="schematron-get-full-path-2">
  89.       <xsl:for-each select="ancestor-or-self::*">
  90.          <xsl:text>/</xsl:text>
  91.          <xsl:value-of select="name(.)"/>
  92.          <xsl:if test="preceding-sibling::*[name(.)=name(current())]">
  93.             <xsl:text>[</xsl:text>
  94.             <xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
  95.             <xsl:text>]</xsl:text>
  96.          </xsl:if>
  97.       </xsl:for-each>
  98.       <xsl:if test="not(self::*)">
  99.          <xsl:text/>/@<xsl:value-of select="name(.)"/>
  100.       </xsl:if>
  101.    </xsl:template>
  102.    <!--MODE: SCHEMATRON-FULL-PATH-3-->
  103. <!--This mode can be used to generate prefixed XPath for humans
  104.     (Top-level element has index)-->
  105. <xsl:template match="node() | @*" mode="schematron-get-full-path-3">
  106.       <xsl:for-each select="ancestor-or-self::*">
  107.          <xsl:text>/</xsl:text>
  108.          <xsl:value-of select="name(.)"/>
  109.          <xsl:if test="parent::*">
  110.             <xsl:text>[</xsl:text>
  111.             <xsl:value-of select="count(preceding-sibling::*[name(.)=name(current())])+1"/>
  112.             <xsl:text>]</xsl:text>
  113.          </xsl:if>
  114.       </xsl:for-each>
  115.       <xsl:if test="not(self::*)">
  116.          <xsl:text/>/@<xsl:value-of select="name(.)"/>
  117.       </xsl:if>
  118.    </xsl:template>
  119.  
  120.    <!--MODE: GENERATE-ID-FROM-PATH -->
  121. <xsl:template match="/" mode="generate-id-from-path"/>
  122.    <xsl:template match="text()" mode="generate-id-from-path">
  123.       <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
  124.       <xsl:value-of select="concat('.text-', 1+count(preceding-sibling::text()), '-')"/>
  125.    </xsl:template>
  126.    <xsl:template match="comment()" mode="generate-id-from-path">
  127.       <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
  128.       <xsl:value-of select="concat('.comment-', 1+count(preceding-sibling::comment()), '-')"/>
  129.    </xsl:template>
  130.    <xsl:template match="processing-instruction()" mode="generate-id-from-path">
  131.       <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
  132.       <xsl:value-of select="concat('.processing-instruction-', 1+count(preceding-sibling::processing-instruction()), '-')"/>
  133.    </xsl:template>
  134.    <xsl:template match="@*" mode="generate-id-from-path">
  135.       <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
  136.       <xsl:value-of select="concat('.@', name())"/>
  137.    </xsl:template>
  138.    <xsl:template match="*" mode="generate-id-from-path" priority="-0.5">
  139.       <xsl:apply-templates select="parent::*" mode="generate-id-from-path"/>
  140.       <xsl:text>.</xsl:text>
  141.       <xsl:value-of select="concat('.',name(),'-',1+count(preceding-sibling::*[name()=name(current())]),'-')"/>
  142.    </xsl:template>
  143.  
  144.    <!--MODE: GENERATE-ID-2 -->
  145. <xsl:template match="/" mode="generate-id-2">U</xsl:template>
  146.    <xsl:template match="*" mode="generate-id-2" priority="2">
  147.       <xsl:text>U</xsl:text>
  148.       <xsl:number level="multiple" count="*"/>
  149.    </xsl:template>
  150.    <xsl:template match="node()" mode="generate-id-2">
  151.       <xsl:text>U.</xsl:text>
  152.       <xsl:number level="multiple" count="*"/>
  153.       <xsl:text>n</xsl:text>
  154.       <xsl:number count="node()"/>
  155.    </xsl:template>
  156.    <xsl:template match="@*" mode="generate-id-2">
  157.       <xsl:text>U.</xsl:text>
  158.       <xsl:number level="multiple" count="*"/>
  159.       <xsl:text>_</xsl:text>
  160.       <xsl:value-of select="string-length(local-name(.))"/>
  161.       <xsl:text>_</xsl:text>
  162.       <xsl:value-of select="translate(name(),':','.')"/>
  163.    </xsl:template>
  164.    <!--Strip characters--><xsl:template match="text()" priority="-1"/>
  165.  
  166.    <!--SCHEMA SETUP-->
  167. <xsl:template match="/">
  168.       <xsl:processing-instruction xmlns:svrl="http://purl.oclc.org/dsdl/svrl" name="xml-stylesheet">type="text/xsl" href="rapportSchematronToHtml4.xsl"</xsl:processing-instruction>
  169.       <xsl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl"/>
  170.       <svrl:schematron-output xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  171.                              title="Conformité d'un document CDAr2 au volet Structuration Commune des Documents Médicaux du CI-SIS"
  172.                              schemaVersion="CI-SIS_StructurationCommuneCDAr2.sch">
  173.          <xsl:attribute name="phase">latotale20121008</xsl:attribute>
  174.          <xsl:attribute name="document">
  175.             <xsl:value-of select="document-uri(/)"/>
  176.          </xsl:attribute>
  177.          <xsl:attribute name="dateHeure">
  178.             <xsl:value-of select="format-dateTime(current-dateTime(), '[D]/[M]/[Y] à [H]:[m]:[s] (temps UTC[Z])')"/>
  179.          </xsl:attribute>
  180.          <xsl:text/>
  181.          <svrl:active-pattern>
  182.             <xsl:attribute name="id">addr</xsl:attribute>
  183.             <xsl:apply-templates/>
  184.          </svrl:active-pattern>
  185.          <xsl:apply-templates select="/" mode="M5"/>
  186.          <svrl:active-pattern>
  187.             <xsl:attribute name="id">administrativeGenderCode</xsl:attribute>
  188.             <svrl:text>Conformité du code sexe du patient ou du subject, nullFlavor autorisé</svrl:text>
  189.             <xsl:apply-templates/>
  190.          </svrl:active-pattern>
  191.          <xsl:apply-templates select="/" mode="M6"/>
  192.          <svrl:active-pattern>
  193.             <xsl:attribute name="id">assignedEntity</xsl:attribute>
  194.             <xsl:apply-templates/>
  195.          </svrl:active-pattern>
  196.          <xsl:apply-templates select="/" mode="M7"/>
  197.          <svrl:active-pattern>
  198.             <xsl:attribute name="id">authenticatorName</xsl:attribute>
  199.             <xsl:apply-templates/>
  200.          </svrl:active-pattern>
  201.          <xsl:apply-templates select="/" mode="M8"/>
  202.          <svrl:active-pattern>
  203.             <xsl:attribute name="id">authorPersonName</xsl:attribute>
  204.             <xsl:apply-templates/>
  205.          </svrl:active-pattern>
  206.          <xsl:apply-templates select="/" mode="M9"/>
  207.          <svrl:active-pattern>
  208.             <xsl:attribute name="id">authorSpecialty</xsl:attribute>
  209.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  210.             <xsl:apply-templates/>
  211.          </svrl:active-pattern>
  212.          <xsl:apply-templates select="/" mode="M10"/>
  213.          <svrl:active-pattern>
  214.             <xsl:attribute name="id">authorTime</xsl:attribute>
  215.             <svrl:text>
  216.         Vérification de la conformité au CI-SIS d'un élément de type IVL_TS ou TS du standard CDAr2 :
  217.         L'élément doit porter soit un attribut "value" soit un intervalle éventuellement semi-borné de sous-éléments "low", "high".
  218.         Alternativement, si l'attribut nullFlavor est autorisé, il doit porter l'une des valeurs admises par le CI-SIS.
  219.     </svrl:text>
  220.             <xsl:apply-templates/>
  221.          </svrl:active-pattern>
  222.          <xsl:apply-templates select="/" mode="M11"/>
  223.          <svrl:active-pattern>
  224.             <xsl:attribute name="id">documentCode</xsl:attribute>
  225.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  226.             <xsl:apply-templates/>
  227.          </svrl:active-pattern>
  228.          <xsl:apply-templates select="/" mode="M12"/>
  229.          <svrl:active-pattern>
  230.             <xsl:attribute name="id">documentEffectiveTime</xsl:attribute>
  231.             <svrl:text>
  232.         Vérification de la conformité au CI-SIS d'un élément de type IVL_TS ou TS du standard CDAr2 :
  233.         L'élément doit porter soit un attribut "value" soit un intervalle éventuellement semi-borné de sous-éléments "low", "high".
  234.         Alternativement, si l'attribut nullFlavor est autorisé, il doit porter l'une des valeurs admises par le CI-SIS.
  235.     </svrl:text>
  236.             <xsl:apply-templates/>
  237.          </svrl:active-pattern>
  238.          <xsl:apply-templates select="/" mode="M13"/>
  239.          <svrl:active-pattern>
  240.             <xsl:attribute name="id">healthcareFacilityTypeCode</xsl:attribute>
  241.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  242.             <xsl:apply-templates/>
  243.          </svrl:active-pattern>
  244.          <xsl:apply-templates select="/" mode="M14"/>
  245.          <svrl:active-pattern>
  246.             <xsl:attribute name="id">informantAssignedPersonName</xsl:attribute>
  247.             <xsl:apply-templates/>
  248.          </svrl:active-pattern>
  249.          <xsl:apply-templates select="/" mode="M15"/>
  250.          <svrl:active-pattern>
  251.             <xsl:attribute name="id">informantRelatedEntity</xsl:attribute>
  252.             <xsl:apply-templates/>
  253.          </svrl:active-pattern>
  254.          <xsl:apply-templates select="/" mode="M16"/>
  255.          <svrl:active-pattern>
  256.             <xsl:attribute name="id">legalAuthenticatorName</xsl:attribute>
  257.             <xsl:apply-templates/>
  258.          </svrl:active-pattern>
  259.          <xsl:apply-templates select="/" mode="M17"/>
  260.          <svrl:active-pattern>
  261.             <xsl:attribute name="id">legalAuthenticatorTime</xsl:attribute>
  262.             <svrl:text>
  263.         Vérification de la conformité au CI-SIS d'un élément de type IVL_TS ou TS du standard CDAr2 :
  264.         L'élément doit porter soit un attribut "value" soit un intervalle éventuellement semi-borné de sous-éléments "low", "high".
  265.         Alternativement, si l'attribut nullFlavor est autorisé, il doit porter l'une des valeurs admises par le CI-SIS.
  266.     </svrl:text>
  267.             <xsl:apply-templates/>
  268.          </svrl:active-pattern>
  269.          <xsl:apply-templates select="/" mode="M18"/>
  270.          <svrl:active-pattern>
  271.             <xsl:attribute name="id">modeleCommunEnTete</xsl:attribute>
  272.             <svrl:text>Conformité de base de l'en-tête CDA au CI-SIS</svrl:text>
  273.             <xsl:apply-templates/>
  274.          </svrl:active-pattern>
  275.          <xsl:apply-templates select="/" mode="M19"/>
  276.          <svrl:active-pattern>
  277.             <xsl:attribute name="id">nonXMLBody</xsl:attribute>
  278.             <svrl:text>Conformité d'un document CDA avec nonXMLBody au profil IHE XDS-SD et vérification des formats et encodage autorisés</svrl:text>
  279.             <xsl:apply-templates/>
  280.          </svrl:active-pattern>
  281.          <xsl:apply-templates select="/" mode="M20"/>
  282.          <svrl:active-pattern>
  283.             <xsl:attribute name="id">patient</xsl:attribute>
  284.             <xsl:apply-templates/>
  285.          </svrl:active-pattern>
  286.          <xsl:apply-templates select="/" mode="M21"/>
  287.          <svrl:active-pattern>
  288.             <xsl:attribute name="id">patientBirthTime</xsl:attribute>
  289.             <svrl:text>
  290.         Vérification de la conformité au CI-SIS d'un élément de type IVL_TS ou TS du standard CDAr2 :
  291.         L'élément doit porter soit un attribut "value" soit un intervalle éventuellement semi-borné de sous-éléments "low", "high".
  292.         Alternativement, si l'attribut nullFlavor est autorisé, il doit porter l'une des valeurs admises par le CI-SIS.
  293.     </svrl:text>
  294.             <xsl:apply-templates/>
  295.          </svrl:active-pattern>
  296.          <xsl:apply-templates select="/" mode="M22"/>
  297.          <svrl:active-pattern>
  298.             <xsl:attribute name="id">patientId</xsl:attribute>
  299.             <svrl:text>
  300.         Vérification de la conformité au CI-SIS :
  301.         l'INS-C doit être une chaîne de 22 chiffres
  302.     </svrl:text>
  303.             <xsl:apply-templates/>
  304.          </svrl:active-pattern>
  305.          <xsl:apply-templates select="/" mode="M23"/>
  306.          <svrl:active-pattern>
  307.             <xsl:attribute name="id">patientName</xsl:attribute>
  308.             <xsl:apply-templates/>
  309.          </svrl:active-pattern>
  310.          <xsl:apply-templates select="/" mode="M24"/>
  311.          <svrl:active-pattern>
  312.             <xsl:attribute name="id">practiceSettingCode</xsl:attribute>
  313.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  314.             <xsl:apply-templates/>
  315.          </svrl:active-pattern>
  316.          <xsl:apply-templates select="/" mode="M25"/>
  317.          <svrl:active-pattern>
  318.             <xsl:attribute name="id">relatedDocument</xsl:attribute>
  319.             <svrl:text>
  320.         Si l'élément relatedDocument est présent alors son attribut typeCode doit valoir RPLC
  321.     </svrl:text>
  322.             <xsl:apply-templates/>
  323.          </svrl:active-pattern>
  324.          <xsl:apply-templates select="/" mode="M26"/>
  325.          <svrl:active-pattern>
  326.             <xsl:attribute name="id">relatedPersonName</xsl:attribute>
  327.             <xsl:apply-templates/>
  328.          </svrl:active-pattern>
  329.          <xsl:apply-templates select="/" mode="M27"/>
  330.          <svrl:active-pattern>
  331.             <xsl:attribute name="id">serviceEventEffectiveTime</xsl:attribute>
  332.             <svrl:text>
  333.         Vérification de la conformité au CI-SIS d'un élément de type IVL_TS ou TS du standard CDAr2 :
  334.         L'élément doit porter soit un attribut "value" soit un intervalle éventuellement semi-borné de sous-éléments "low", "high".
  335.         Alternativement, si l'attribut nullFlavor est autorisé, il doit porter l'une des valeurs admises par le CI-SIS.
  336.     </svrl:text>
  337.             <xsl:apply-templates/>
  338.          </svrl:active-pattern>
  339.          <xsl:apply-templates select="/" mode="M28"/>
  340.          <svrl:active-pattern>
  341.             <xsl:attribute name="id">serviceEventPerformer</xsl:attribute>
  342.             <svrl:text>
  343.         Vérification de la présence et de la conformité de l'acte principal documenté
  344.     </svrl:text>
  345.             <xsl:apply-templates/>
  346.          </svrl:active-pattern>
  347.          <xsl:apply-templates select="/" mode="M29"/>
  348.          <svrl:active-pattern>
  349.             <xsl:attribute name="id">telecom</xsl:attribute>
  350.             <svrl:text>
  351.         Vérification de la conformité au CI-SIS d'un élément telecom (de type TEL) du standard CDAr2 :
  352.         L'élément doit comporter un attribut "value" bien formaté avec les préfixes autorisés par le CI-SIS,
  353.         et optionnellement un attribut "use" (qui n'est pas contrôlé).
  354.         Alternativement, si l'attribut nullFlavor est présent, il doit avoir l'une des valeurs admises par le CI-SIS.
  355.     </svrl:text>
  356.             <xsl:apply-templates/>
  357.          </svrl:active-pattern>
  358.          <xsl:apply-templates select="/" mode="M30"/>
  359.          <svrl:active-pattern>
  360.             <xsl:attribute name="id">abdomenPhysicalExam-errors</xsl:attribute>
  361.             <xsl:apply-templates/>
  362.          </svrl:active-pattern>
  363.          <xsl:apply-templates select="/" mode="M31"/>
  364.          <svrl:active-pattern>
  365.             <xsl:attribute name="id">activeProblemSection-errors</xsl:attribute>
  366.             <xsl:apply-templates/>
  367.          </svrl:active-pattern>
  368.          <xsl:apply-templates select="/" mode="M32"/>
  369.          <svrl:active-pattern>
  370.             <xsl:attribute name="id">assessmentAndPlan-errors</xsl:attribute>
  371.             <xsl:apply-templates/>
  372.          </svrl:active-pattern>
  373.          <xsl:apply-templates select="/" mode="M33"/>
  374.          <svrl:active-pattern>
  375.             <xsl:attribute name="id">carePlan-errors</xsl:attribute>
  376.             <xsl:apply-templates/>
  377.          </svrl:active-pattern>
  378.          <xsl:apply-templates select="/" mode="M34"/>
  379.          <svrl:active-pattern>
  380.             <xsl:attribute name="id">childFunctionalStatusAssessment-errors</xsl:attribute>
  381.             <xsl:apply-templates/>
  382.          </svrl:active-pattern>
  383.          <xsl:apply-templates select="/" mode="M35"/>
  384.          <svrl:active-pattern>
  385.             <xsl:attribute name="id">childFunctionalStatusEatingSleeping-errors</xsl:attribute>
  386.             <xsl:apply-templates/>
  387.          </svrl:active-pattern>
  388.          <xsl:apply-templates select="/" mode="M36"/>
  389.          <svrl:active-pattern>
  390.             <xsl:attribute name="id">childFunctionalStatusPsychoMot-errors</xsl:attribute>
  391.             <xsl:apply-templates/>
  392.          </svrl:active-pattern>
  393.          <xsl:apply-templates select="/" mode="M37"/>
  394.          <svrl:active-pattern>
  395.             <xsl:attribute name="id">CodedAntenatalTestingAndSurveillance-errors</xsl:attribute>
  396.             <xsl:apply-templates/>
  397.          </svrl:active-pattern>
  398.          <xsl:apply-templates select="/" mode="M38"/>
  399.          <svrl:active-pattern>
  400.             <xsl:attribute name="id">codedPhysicalExam-errors</xsl:attribute>
  401.             <xsl:apply-templates/>
  402.          </svrl:active-pattern>
  403.          <xsl:apply-templates select="/" mode="M39"/>
  404.          <svrl:active-pattern>
  405.             <xsl:attribute name="id">codedResults-errors</xsl:attribute>
  406.             <xsl:apply-templates/>
  407.          </svrl:active-pattern>
  408.          <xsl:apply-templates select="/" mode="M40"/>
  409.          <svrl:active-pattern>
  410.             <xsl:attribute name="id">codedSocialHistory-errors</xsl:attribute>
  411.             <xsl:apply-templates/>
  412.          </svrl:active-pattern>
  413.          <xsl:apply-templates select="/" mode="M41"/>
  414.          <svrl:active-pattern>
  415.             <xsl:attribute name="id">codedVitalSigns-errors</xsl:attribute>
  416.             <xsl:apply-templates/>
  417.          </svrl:active-pattern>
  418.          <xsl:apply-templates select="/" mode="M42"/>
  419.          <svrl:active-pattern>
  420.             <xsl:attribute name="id">EarsPhysicalExam-errors</xsl:attribute>
  421.             <xsl:apply-templates/>
  422.          </svrl:active-pattern>
  423.          <xsl:apply-templates select="/" mode="M43"/>
  424.          <svrl:active-pattern>
  425.             <xsl:attribute name="id">encounterHistoriesSection-errors</xsl:attribute>
  426.             <xsl:apply-templates/>
  427.          </svrl:active-pattern>
  428.          <xsl:apply-templates select="/" mode="M44"/>
  429.          <svrl:active-pattern>
  430.             <xsl:attribute name="id">endocrinePhysicalExam-errors</xsl:attribute>
  431.             <xsl:apply-templates/>
  432.          </svrl:active-pattern>
  433.          <xsl:apply-templates select="/" mode="M45"/>
  434.          <svrl:active-pattern>
  435.             <xsl:attribute name="id">eyesPhysicalExam-errors</xsl:attribute>
  436.             <xsl:apply-templates/>
  437.          </svrl:active-pattern>
  438.          <xsl:apply-templates select="/" mode="M46"/>
  439.          <svrl:active-pattern>
  440.             <xsl:attribute name="id">generalAppearancePhysicalExam-errors</xsl:attribute>
  441.             <xsl:apply-templates/>
  442.          </svrl:active-pattern>
  443.          <xsl:apply-templates select="/" mode="M47"/>
  444.          <svrl:active-pattern>
  445.             <xsl:attribute name="id">genitaliaPhysicalExam-errors</xsl:attribute>
  446.             <xsl:apply-templates/>
  447.          </svrl:active-pattern>
  448.          <xsl:apply-templates select="/" mode="M48"/>
  449.          <svrl:active-pattern>
  450.             <xsl:attribute name="id">heartPhysicalExam-errors</xsl:attribute>
  451.             <xsl:apply-templates/>
  452.          </svrl:active-pattern>
  453.          <xsl:apply-templates select="/" mode="M49"/>
  454.          <svrl:active-pattern>
  455.             <xsl:attribute name="id">historyOfPastIllness-errors</xsl:attribute>
  456.             <xsl:apply-templates/>
  457.          </svrl:active-pattern>
  458.          <xsl:apply-templates select="/" mode="M50"/>
  459.          <svrl:active-pattern>
  460.             <xsl:attribute name="id">immunizations-errors</xsl:attribute>
  461.             <xsl:apply-templates/>
  462.          </svrl:active-pattern>
  463.          <xsl:apply-templates select="/" mode="M51"/>
  464.          <svrl:active-pattern>
  465.             <xsl:attribute name="id">integumentaryPhysicalExam-errors</xsl:attribute>
  466.             <xsl:apply-templates/>
  467.          </svrl:active-pattern>
  468.          <xsl:apply-templates select="/" mode="M52"/>
  469.          <svrl:active-pattern>
  470.             <xsl:attribute name="id">laborAndDeliverySection-errors</xsl:attribute>
  471.             <xsl:apply-templates/>
  472.          </svrl:active-pattern>
  473.          <xsl:apply-templates select="/" mode="M53"/>
  474.          <svrl:active-pattern>
  475.             <xsl:attribute name="id">lymphaticPhysicalExam-errors</xsl:attribute>
  476.             <xsl:apply-templates/>
  477.          </svrl:active-pattern>
  478.          <xsl:apply-templates select="/" mode="M54"/>
  479.          <svrl:active-pattern>
  480.             <xsl:attribute name="id">musculoPhysicalExam-errors</xsl:attribute>
  481.             <xsl:apply-templates/>
  482.          </svrl:active-pattern>
  483.          <xsl:apply-templates select="/" mode="M55"/>
  484.          <svrl:active-pattern>
  485.             <xsl:attribute name="id">neurologicPhysicalExam-errors</xsl:attribute>
  486.             <xsl:apply-templates/>
  487.          </svrl:active-pattern>
  488.          <xsl:apply-templates select="/" mode="M56"/>
  489.          <svrl:active-pattern>
  490.             <xsl:attribute name="id">pregnancyHistorySection-errors</xsl:attribute>
  491.             <xsl:apply-templates/>
  492.          </svrl:active-pattern>
  493.          <xsl:apply-templates select="/" mode="M57"/>
  494.          <svrl:active-pattern>
  495.             <xsl:attribute name="id">prenatalEvents-errors</xsl:attribute>
  496.             <xsl:apply-templates/>
  497.          </svrl:active-pattern>
  498.          <xsl:apply-templates select="/" mode="M58"/>
  499.          <svrl:active-pattern>
  500.             <xsl:attribute name="id">proceduresSection-errors</xsl:attribute>
  501.             <xsl:apply-templates/>
  502.          </svrl:active-pattern>
  503.          <xsl:apply-templates select="/" mode="M59"/>
  504.          <svrl:active-pattern>
  505.             <xsl:attribute name="id">RespiratoryPhysicalExam-errors</xsl:attribute>
  506.             <xsl:apply-templates/>
  507.          </svrl:active-pattern>
  508.          <xsl:apply-templates select="/" mode="M60"/>
  509.          <svrl:active-pattern>
  510.             <xsl:attribute name="id">teethPhysicalExam-errors</xsl:attribute>
  511.             <xsl:apply-templates/>
  512.          </svrl:active-pattern>
  513.          <xsl:apply-templates select="/" mode="M61"/>
  514.          <svrl:active-pattern>
  515.             <xsl:attribute name="id">ACPimageIllustrative</xsl:attribute>
  516.             <svrl:text>Contrôle d'une image illustrative dans un élément observationMedia</svrl:text>
  517.             <xsl:apply-templates/>
  518.          </svrl:active-pattern>
  519.          <xsl:apply-templates select="/" mode="M62"/>
  520.          <svrl:active-pattern>
  521.             <xsl:attribute name="id">ClinicalStatusCodes</xsl:attribute>
  522.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  523.             <xsl:apply-templates/>
  524.          </svrl:active-pattern>
  525.          <xsl:apply-templates select="/" mode="M63"/>
  526.          <svrl:active-pattern>
  527.             <xsl:attribute name="id">codedAntenatalTestingAndSurveillanceOrg-errors</xsl:attribute>
  528.             <xsl:apply-templates/>
  529.          </svrl:active-pattern>
  530.          <xsl:apply-templates select="/" mode="M64"/>
  531.          <svrl:active-pattern>
  532.             <xsl:attribute name="id">codedVitalSignsOrg-errors</xsl:attribute>
  533.             <xsl:apply-templates/>
  534.          </svrl:active-pattern>
  535.          <xsl:apply-templates select="/" mode="M65"/>
  536.          <svrl:active-pattern>
  537.             <xsl:attribute name="id">comments-errors</xsl:attribute>
  538.             <xsl:apply-templates/>
  539.          </svrl:active-pattern>
  540.          <xsl:apply-templates select="/" mode="M66"/>
  541.          <svrl:active-pattern>
  542.             <xsl:attribute name="id">concernEntry-errors</xsl:attribute>
  543.             <xsl:apply-templates/>
  544.          </svrl:active-pattern>
  545.          <xsl:apply-templates select="/" mode="M67"/>
  546.          <svrl:active-pattern>
  547.             <xsl:attribute name="id">encountersEntry-errors</xsl:attribute>
  548.             <xsl:apply-templates/>
  549.          </svrl:active-pattern>
  550.          <xsl:apply-templates select="/" mode="M68"/>
  551.          <svrl:active-pattern>
  552.             <xsl:attribute name="id">HealthStatusCodes</xsl:attribute>
  553.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  554.             <xsl:apply-templates/>
  555.          </svrl:active-pattern>
  556.          <xsl:apply-templates select="/" mode="M69"/>
  557.          <svrl:active-pattern>
  558.             <xsl:attribute name="id">immunizationsEnt-errors</xsl:attribute>
  559.             <xsl:apply-templates/>
  560.          </svrl:active-pattern>
  561.          <xsl:apply-templates select="/" mode="M70"/>
  562.          <svrl:active-pattern>
  563.             <xsl:attribute name="id">observationInterpretation</xsl:attribute>
  564.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  565.             <xsl:apply-templates/>
  566.          </svrl:active-pattern>
  567.          <xsl:apply-templates select="/" mode="M71"/>
  568.          <svrl:active-pattern>
  569.             <xsl:attribute name="id">ProblemCodes</xsl:attribute>
  570.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  571.             <xsl:apply-templates/>
  572.          </svrl:active-pattern>
  573.          <xsl:apply-templates select="/" mode="M72"/>
  574.          <svrl:active-pattern>
  575.             <xsl:attribute name="id">AllergyAndIntoleranceCodes</xsl:attribute>
  576.             <svrl:text>Conformité d'un élément codé obligatoire par rapport à un jeu de valeurs du CI-SIS</svrl:text>
  577.             <xsl:apply-templates/>
  578.          </svrl:active-pattern>
  579.          <xsl:apply-templates select="/" mode="M73"/>
  580.          <svrl:active-pattern>
  581.             <xsl:attribute name="id">problemConcernEntry-errors</xsl:attribute>
  582.             <xsl:apply-templates/>
  583.          </svrl:active-pattern>
  584.          <xsl:apply-templates select="/" mode="M74"/>
  585.          <svrl:active-pattern>
  586.             <xsl:attribute name="id">problemEntry-errors</xsl:attribute>
  587.             <xsl:apply-templates/>
  588.          </svrl:active-pattern>
  589.          <xsl:apply-templates select="/" mode="M75"/>
  590.          <svrl:active-pattern>
  591.             <xsl:attribute name="id">procedureEntry-errors</xsl:attribute>
  592.             <xsl:apply-templates/>
  593.          </svrl:active-pattern>
  594.          <xsl:apply-templates select="/" mode="M76"/>
  595.          <svrl:active-pattern>
  596.             <xsl:attribute name="id">simpleObservation-errors</xsl:attribute>
  597.             <xsl:apply-templates/>
  598.          </svrl:active-pattern>
  599.          <xsl:apply-templates select="/" mode="M77"/>
  600.          <svrl:active-pattern>
  601.             <xsl:attribute name="id">variables</xsl:attribute>
  602.             <xsl:apply-templates/>
  603.          </svrl:active-pattern>
  604.          <xsl:apply-templates select="/" mode="M79"/>
  605.       </svrl:schematron-output>
  606.    </xsl:template>
  607.  
  608.    <!--SCHEMATRON PATTERNS-->
  609. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">Conformité d'un document CDAr2 au volet Structuration Commune des Documents Médicaux du CI-SIS</svrl:text>
  610.  
  611.    <!--PATTERN addr-->
  612.  
  613.  
  614.     <!--RULE -->
  615. <xsl:template match="cda:addr" priority="1000" mode="M5">
  616.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:addr"/>
  617.       <xsl:variable name="nba" select="count(@*)"/>
  618.       <xsl:variable name="nbch" select="count(*)"/>
  619.       <xsl:variable name="val" select="@*"/>
  620.  
  621.             <!--ASSERT -->
  622. <xsl:choose>
  623.          <xsl:when test="(             ($nba = 0 and $nbch &gt; 0) or             ($nba and name(@*) = 'use' and $nbch &gt; 0) or              ($nba = 1 and name(@*) = 'nullFlavor' and $nbch = 0 and             ($val = 'UNK' or $val = 'NASK' or $val = 'ASKU' or $val = 'NAV' or $val = 'MSK'))              )"/>
  624.          <xsl:otherwise>
  625.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  626.                <xsl:attribute name="location">
  627.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  628.                </xsl:attribute>
  629.                <svrl:text>
  630.             Erreur de conformité CI-SIS : <xsl:text/>
  631.                   <xsl:value-of select="name(.)"/>
  632.                   <xsl:text/> ne contient pas un attribut autorisé pour une adresse,
  633.             ou est vide et sans nullFlavor, ou contient une valeur de nullFlavor non admise.
  634.         </svrl:text>
  635.             </svrl:failed-assert>
  636.          </xsl:otherwise>
  637.       </xsl:choose>
  638.  
  639.             <!--ASSERT -->
  640. <xsl:choose>
  641.          <xsl:when test="$nbch = 0 or                         (cda:streetAddressLine and not(cda:postalCode) and not(cda:city) and not(cda:country) and not(cda:state)                         and not(cda:houseNumber) and not(cda:streetName)and not(cda:additionalLocator) and not(cda:unitID)                         and not(cda:postBox) and not(cda:precinct)) or                         (not(cda:streetAddressLine))                         "/>
  642.          <xsl:otherwise>
  643.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  644.                <xsl:attribute name="location">
  645.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  646.                </xsl:attribute>
  647.                <svrl:text>
  648.             Erreur de conformité CI-SIS : <xsl:text/>
  649.                   <xsl:value-of select="name(.)"/>
  650.                   <xsl:text/> doit être structuré :
  651.             - soit sous la formes de lignes d'adresse (streetAddressLine)
  652.             - soit sous la forme de composants élémentaires d'adresse
  653.         </svrl:text>
  654.             </svrl:failed-assert>
  655.          </xsl:otherwise>
  656.       </xsl:choose>
  657.       <xsl:apply-templates select="*" mode="M5"/>
  658.    </xsl:template>
  659.    <xsl:template match="text()" priority="-1" mode="M5"/>
  660.    <xsl:template match="@*|node()" priority="-2" mode="M5">
  661.       <xsl:apply-templates select="*" mode="M5"/>
  662.    </xsl:template>
  663.  
  664.    <!--PATTERN administrativeGenderCode-->
  665.  
  666.  
  667.     <!--RULE -->
  668. <xsl:template match="cda:administrativeGenderCode" priority="1000" mode="M6">
  669.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  670.                       context="cda:administrativeGenderCode"/>
  671.       <xsl:variable name="NF" select="@nullFlavor"/>
  672.       <xsl:variable name="sex" select="@code"/>
  673.  
  674.             <!--ASSERT -->
  675. <xsl:choose>
  676.          <xsl:when test="$sex = 'M' or $sex = 'F' or $sex = 'U' or $NF = 'UNK' or $NF = 'NASK' or $NF = 'ASKU' or $NF = 'NAV' or $NF = 'MSK'"/>
  677.          <xsl:otherwise>
  678.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  679.                <xsl:attribute name="location">
  680.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  681.                </xsl:attribute>
  682.                <svrl:text>
  683.             Erreur de conformité CI-SIS : l'élément administrativeGenderCode doit être présent, avec code sexe ou un nullFlavor autorisé
  684.             (valeur trouvée <xsl:text/>
  685.                   <xsl:value-of select="@*"/>
  686.                   <xsl:text/>).
  687.         </svrl:text>
  688.             </svrl:failed-assert>
  689.          </xsl:otherwise>
  690.       </xsl:choose>
  691.       <xsl:apply-templates select="*" mode="M6"/>
  692.    </xsl:template>
  693.    <xsl:template match="text()" priority="-1" mode="M6"/>
  694.    <xsl:template match="@*|node()" priority="-2" mode="M6">
  695.       <xsl:apply-templates select="*" mode="M6"/>
  696.    </xsl:template>
  697.  
  698.    <!--PATTERN assignedEntity-->
  699.  
  700.  
  701.     <!--RULE -->
  702. <xsl:template match="cda:assignedEntity" priority="1000" mode="M7">
  703.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:assignedEntity"/>
  704.  
  705.             <!--ASSERT -->
  706. <xsl:choose>
  707.          <xsl:when test="./cda:id"/>
  708.          <xsl:otherwise>
  709.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  710.                <xsl:attribute name="location">
  711.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  712.                </xsl:attribute>
  713.                <svrl:text> Erreur de conformité CI-SIS : L'élément "id" doit être présent sous
  714.             assignedEntity. </svrl:text>
  715.             </svrl:failed-assert>
  716.          </xsl:otherwise>
  717.       </xsl:choose>
  718.  
  719.             <!--ASSERT -->
  720. <xsl:choose>
  721.          <xsl:when test="cda:assignedPerson"/>
  722.          <xsl:otherwise>
  723.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  724.                <xsl:attribute name="location">
  725.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  726.                </xsl:attribute>
  727.                <svrl:text> Erreur de conformité CI-SIS : L'élément
  728.             "assignedPerson" doit être présent sous assignedEntity (nullFlavor autorisé). </svrl:text>
  729.             </svrl:failed-assert>
  730.          </xsl:otherwise>
  731.       </xsl:choose>
  732.  
  733.             <!--ASSERT -->
  734. <xsl:choose>
  735.          <xsl:when test="cda:assignedPerson/cda:name or cda:assignedPerson/@nullFlavor"/>
  736.          <xsl:otherwise>
  737.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  738.                <xsl:attribute name="location">
  739.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  740.                </xsl:attribute>
  741.                <svrl:text>
  742.             Erreur de conformité CI-SIS :
  743.             Si l'élément assignedPerson n'est pas vide avec un nullFlavor, alors il
  744.             doit comporter un élément fils "name" (nullFlavor autorisé). </svrl:text>
  745.             </svrl:failed-assert>
  746.          </xsl:otherwise>
  747.       </xsl:choose>
  748.       <xsl:apply-templates select="*" mode="M7"/>
  749.    </xsl:template>
  750.    <xsl:template match="text()" priority="-1" mode="M7"/>
  751.    <xsl:template match="@*|node()" priority="-2" mode="M7">
  752.       <xsl:apply-templates select="*" mode="M7"/>
  753.    </xsl:template>
  754.  
  755.    <!--PATTERN authenticatorName-->
  756.  
  757.  
  758.     <!--RULE -->
  759. <xsl:template match="cda:authenticator/cda:assignedEntity/cda:assignedPerson/cda:name"
  760.                 priority="1000"
  761.                 mode="M8">
  762.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  763.                       context="cda:authenticator/cda:assignedEntity/cda:assignedPerson/cda:name"/>
  764.  
  765.             <!--ASSERT -->
  766. <xsl:choose>
  767.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 1 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  768.          <xsl:otherwise>
  769.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  770.                <xsl:attribute name="location">
  771.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  772.                </xsl:attribute>
  773.                <svrl:text>
  774.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  775.                   <xsl:value-of select="'authenticator/assignedEntity/assignedPerson/name'"/>
  776.                   <xsl:text/>/family doit être présent
  777.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  778.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  779.                   <xsl:value-of select="./cda:family"/>
  780.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  781.                   <xsl:value-of select="./cda:family/@qualifier"/>
  782.                   <xsl:text/>
  783.                </svrl:text>
  784.             </svrl:failed-assert>
  785.          </xsl:otherwise>
  786.       </xsl:choose>
  787.       <xsl:apply-templates select="*" mode="M8"/>
  788.    </xsl:template>
  789.    <xsl:template match="text()" priority="-1" mode="M8"/>
  790.    <xsl:template match="@*|node()" priority="-2" mode="M8">
  791.       <xsl:apply-templates select="*" mode="M8"/>
  792.    </xsl:template>
  793.  
  794.    <!--PATTERN authorPersonName-->
  795.  
  796.  
  797.     <!--RULE -->
  798. <xsl:template match="cda:assignedAuthor/cda:assignedPerson/cda:name" priority="1000"
  799.                 mode="M9">
  800.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  801.                       context="cda:assignedAuthor/cda:assignedPerson/cda:name"/>
  802.  
  803.             <!--ASSERT -->
  804. <xsl:choose>
  805.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 1 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  806.          <xsl:otherwise>
  807.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  808.                <xsl:attribute name="location">
  809.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  810.                </xsl:attribute>
  811.                <svrl:text>
  812.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  813.                   <xsl:value-of select="'assignedAuthor/assignedPerson/name'"/>
  814.                   <xsl:text/>/family doit être présent
  815.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  816.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  817.                   <xsl:value-of select="./cda:family"/>
  818.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  819.                   <xsl:value-of select="./cda:family/@qualifier"/>
  820.                   <xsl:text/>
  821.                </svrl:text>
  822.             </svrl:failed-assert>
  823.          </xsl:otherwise>
  824.       </xsl:choose>
  825.       <xsl:apply-templates select="*" mode="M9"/>
  826.    </xsl:template>
  827.    <xsl:template match="text()" priority="-1" mode="M9"/>
  828.    <xsl:template match="@*|node()" priority="-2" mode="M9">
  829.       <xsl:apply-templates select="*" mode="M9"/>
  830.    </xsl:template>
  831.  
  832.    <!--PATTERN authorSpecialty-->
  833.  
  834.  
  835.     <!--RULE -->
  836. <xsl:template match="cda:ClinicalDocument/cda:author/cda:assignedAuthor/cda:code"
  837.                 priority="1000"
  838.                 mode="M10">
  839.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  840.                       context="cda:ClinicalDocument/cda:author/cda:assignedAuthor/cda:code"/>
  841.       <xsl:variable name="att_code" select="@code"/>
  842.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  843.       <xsl:variable name="att_displayName" select="@displayName"/>
  844.  
  845.             <!--ASSERT -->
  846. <xsl:choose>
  847.          <xsl:when test="(not(@nullFlavor) or 1)"/>
  848.          <xsl:otherwise>
  849.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  850.                <xsl:attribute name="location">
  851.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  852.                </xsl:attribute>
  853.                <svrl:text>
  854.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  855.                   <xsl:value-of select="'ClinicalDocument/author/assignedAuthor/code'"/>
  856.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  857.         </svrl:text>
  858.             </svrl:failed-assert>
  859.          </xsl:otherwise>
  860.       </xsl:choose>
  861.  
  862.             <!--ASSERT -->
  863. <xsl:choose>
  864.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (1 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  865.          <xsl:otherwise>
  866.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  867.                <xsl:attribute name="location">
  868.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  869.                </xsl:attribute>
  870.                <svrl:text>
  871.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  872.                   <xsl:value-of select="'ClinicalDocument/author/assignedAuthor/code'"/>
  873.                   <xsl:text/>" doit avoir ses attributs
  874.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  875.         </svrl:text>
  876.             </svrl:failed-assert>
  877.          </xsl:otherwise>
  878.       </xsl:choose>
  879.  
  880.             <!--ASSERT -->
  881. <xsl:choose>
  882.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_authorSpecialty)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  883.          <xsl:otherwise>
  884.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  885.                <xsl:attribute name="location">
  886.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  887.                </xsl:attribute>
  888.                <svrl:text>
  889.        
  890.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  891.                   <xsl:value-of select="'ClinicalDocument/author/assignedAuthor/code'"/>
  892.                   <xsl:text/>
  893.             [<xsl:text/>
  894.                   <xsl:value-of select="$att_code"/>
  895.                   <xsl:text/>:<xsl:text/>
  896.                   <xsl:value-of select="$att_displayName"/>
  897.                   <xsl:text/>:<xsl:text/>
  898.                   <xsl:value-of select="$att_codeSystem"/>
  899.                   <xsl:text/>]
  900.             doit faire partie du jeu de valeurs <xsl:text/>
  901.                   <xsl:value-of select="$jdv_authorSpecialty"/>
  902.                   <xsl:text/>.
  903.         </svrl:text>
  904.             </svrl:failed-assert>
  905.          </xsl:otherwise>
  906.       </xsl:choose>
  907.       <xsl:apply-templates select="*" mode="M10"/>
  908.    </xsl:template>
  909.    <xsl:template match="text()" priority="-1" mode="M10"/>
  910.    <xsl:template match="@*|node()" priority="-2" mode="M10">
  911.       <xsl:apply-templates select="*" mode="M10"/>
  912.    </xsl:template>
  913.  
  914.    <!--PATTERN authorTime-->
  915.  
  916.  
  917.     <!--RULE -->
  918. <xsl:template match="cda:author/cda:time" priority="1002" mode="M11">
  919.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:author/cda:time"/>
  920.       <xsl:variable name="L" select="string-length(@value)"/>
  921.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  922.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  923.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  924.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  925.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  926.       <xsl:variable name="lDH1" select="string-length(substring-before(@value,'+'))"/>
  927.       <xsl:variable name="lDH2" select="string-length(substring-before(@value,'-'))"/>
  928.  
  929.             <!--ASSERT -->
  930. <xsl:choose>
  931.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4) and $lDH1 &lt;= 14 and $lDH2 &lt;= 14)             )"/>
  932.          <xsl:otherwise>
  933.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  934.                <xsl:attribute name="location">
  935.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  936.                </xsl:attribute>
  937.                <svrl:text>
  938.             Erreur de conformité CI-SIS : <xsl:text/>
  939.                   <xsl:value-of select="'author/time'"/>
  940.                   <xsl:text/>/@value = "<xsl:text/>
  941.                   <xsl:value-of select="@value"/>
  942.                   <xsl:text/>"  contient  
  943.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  944.             en temps local du producteur.
  945.         </svrl:text>
  946.             </svrl:failed-assert>
  947.          </xsl:otherwise>
  948.       </xsl:choose>
  949.  
  950.             <!--ASSERT -->
  951. <xsl:choose>
  952.          <xsl:when test="(@* and not(*)) or (not(@*) and *)"/>
  953.          <xsl:otherwise>
  954.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  955.                <xsl:attribute name="location">
  956.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  957.                </xsl:attribute>
  958.                <svrl:text>
  959.             Erreur de conformité CI-SIS : <xsl:text/>
  960.                   <xsl:value-of select="'author/time'"/>
  961.                   <xsl:text/> doit contenir soit un attribut soit des éléments fils.
  962.         </svrl:text>
  963.             </svrl:failed-assert>
  964.          </xsl:otherwise>
  965.       </xsl:choose>
  966.  
  967.             <!--ASSERT -->
  968. <xsl:choose>
  969.          <xsl:when test="(             (name(@*) = 'nullFlavor' and 1 and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             (name(@*) != 'nullFlavor')              )"/>
  970.          <xsl:otherwise>
  971.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  972.                <xsl:attribute name="location">
  973.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  974.                </xsl:attribute>
  975.                <svrl:text>
  976.             Erreur de conformité CI-SIS : <xsl:text/>
  977.                   <xsl:value-of select="'author/time'"/>
  978.                   <xsl:text/> contient un 'nullFlavor' non autorisé ou porteur d'une valeur non admise.
  979.         </svrl:text>
  980.             </svrl:failed-assert>
  981.          </xsl:otherwise>
  982.       </xsl:choose>
  983.       <xsl:apply-templates select="*" mode="M11"/>
  984.    </xsl:template>
  985.  
  986.       <!--RULE -->
  987. <xsl:template match="cda:author/cda:time/cda:low" priority="1001" mode="M11">
  988.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:author/cda:time/cda:low"/>
  989.       <xsl:variable name="L" select="string-length(@value)"/>
  990.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  991.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  992.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  993.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  994.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  995.  
  996.             <!--ASSERT -->
  997. <xsl:choose>
  998.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  999.          <xsl:otherwise>
  1000.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1001.                <xsl:attribute name="location">
  1002.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1003.                </xsl:attribute>
  1004.                <svrl:text>
  1005.             Erreur de conformité CI-SIS : <xsl:text/>
  1006.                   <xsl:value-of select="'author/time'"/>
  1007.                   <xsl:text/>/low/@value = "<xsl:text/>
  1008.                   <xsl:value-of select="@value"/>
  1009.                   <xsl:text/>"  contient  
  1010.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1011.             en temps local du producteur.
  1012.         </svrl:text>
  1013.             </svrl:failed-assert>
  1014.          </xsl:otherwise>
  1015.       </xsl:choose>
  1016.       <xsl:apply-templates select="*" mode="M11"/>
  1017.    </xsl:template>
  1018.  
  1019.       <!--RULE -->
  1020. <xsl:template match="cda:author/cda:time/cda:high" priority="1000" mode="M11">
  1021.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1022.                       context="cda:author/cda:time/cda:high"/>
  1023.       <xsl:variable name="L" select="string-length(@value)"/>
  1024.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1025.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1026.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1027.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1028.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1029.  
  1030.             <!--ASSERT -->
  1031. <xsl:choose>
  1032.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  1033.          <xsl:otherwise>
  1034.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1035.                <xsl:attribute name="location">
  1036.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1037.                </xsl:attribute>
  1038.                <svrl:text>
  1039.             Erreur de conformité CI-SIS : <xsl:text/>
  1040.                   <xsl:value-of select="'author/time'"/>
  1041.                   <xsl:text/>/high/@value = "<xsl:text/>
  1042.                   <xsl:value-of select="@value"/>
  1043.                   <xsl:text/>"  contient  
  1044.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1045.             en temps local du producteur.
  1046.         </svrl:text>
  1047.             </svrl:failed-assert>
  1048.          </xsl:otherwise>
  1049.       </xsl:choose>
  1050.       <xsl:apply-templates select="*" mode="M11"/>
  1051.    </xsl:template>
  1052.    <xsl:template match="text()" priority="-1" mode="M11"/>
  1053.    <xsl:template match="@*|node()" priority="-2" mode="M11">
  1054.       <xsl:apply-templates select="*" mode="M11"/>
  1055.    </xsl:template>
  1056.  
  1057.    <!--PATTERN documentCode-->
  1058.  
  1059.  
  1060.     <!--RULE -->
  1061. <xsl:template match="cda:ClinicalDocument/cda:code" priority="1000" mode="M12">
  1062.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1063.                       context="cda:ClinicalDocument/cda:code"/>
  1064.       <xsl:variable name="att_code" select="@code"/>
  1065.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  1066.       <xsl:variable name="att_displayName" select="@displayName"/>
  1067.  
  1068.             <!--ASSERT -->
  1069. <xsl:choose>
  1070.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  1071.          <xsl:otherwise>
  1072.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1073.                <xsl:attribute name="location">
  1074.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1075.                </xsl:attribute>
  1076.                <svrl:text>
  1077.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  1078.                   <xsl:value-of select="'ClinicalDocument/code'"/>
  1079.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  1080.         </svrl:text>
  1081.             </svrl:failed-assert>
  1082.          </xsl:otherwise>
  1083.       </xsl:choose>
  1084.  
  1085.             <!--ASSERT -->
  1086. <xsl:choose>
  1087.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  1088.          <xsl:otherwise>
  1089.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1090.                <xsl:attribute name="location">
  1091.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1092.                </xsl:attribute>
  1093.                <svrl:text>
  1094.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  1095.                   <xsl:value-of select="'ClinicalDocument/code'"/>
  1096.                   <xsl:text/>" doit avoir ses attributs
  1097.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  1098.         </svrl:text>
  1099.             </svrl:failed-assert>
  1100.          </xsl:otherwise>
  1101.       </xsl:choose>
  1102.  
  1103.             <!--ASSERT -->
  1104. <xsl:choose>
  1105.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_typeCode)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  1106.          <xsl:otherwise>
  1107.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1108.                <xsl:attribute name="location">
  1109.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1110.                </xsl:attribute>
  1111.                <svrl:text>
  1112.        
  1113.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  1114.                   <xsl:value-of select="'ClinicalDocument/code'"/>
  1115.                   <xsl:text/>
  1116.             [<xsl:text/>
  1117.                   <xsl:value-of select="$att_code"/>
  1118.                   <xsl:text/>:<xsl:text/>
  1119.                   <xsl:value-of select="$att_displayName"/>
  1120.                   <xsl:text/>:<xsl:text/>
  1121.                   <xsl:value-of select="$att_codeSystem"/>
  1122.                   <xsl:text/>]
  1123.             doit faire partie du jeu de valeurs <xsl:text/>
  1124.                   <xsl:value-of select="$jdv_typeCode"/>
  1125.                   <xsl:text/>.
  1126.         </svrl:text>
  1127.             </svrl:failed-assert>
  1128.          </xsl:otherwise>
  1129.       </xsl:choose>
  1130.       <xsl:apply-templates select="*" mode="M12"/>
  1131.    </xsl:template>
  1132.    <xsl:template match="text()" priority="-1" mode="M12"/>
  1133.    <xsl:template match="@*|node()" priority="-2" mode="M12">
  1134.       <xsl:apply-templates select="*" mode="M12"/>
  1135.    </xsl:template>
  1136.  
  1137.    <!--PATTERN documentEffectiveTime-->
  1138.  
  1139.  
  1140.     <!--RULE -->
  1141. <xsl:template match="cda:ClinicalDocument/cda:effectiveTime" priority="1002" mode="M13">
  1142.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1143.                       context="cda:ClinicalDocument/cda:effectiveTime"/>
  1144.       <xsl:variable name="L" select="string-length(@value)"/>
  1145.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1146.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1147.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1148.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1149.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1150.       <xsl:variable name="lDH1" select="string-length(substring-before(@value,'+'))"/>
  1151.       <xsl:variable name="lDH2" select="string-length(substring-before(@value,'-'))"/>
  1152.  
  1153.             <!--ASSERT -->
  1154. <xsl:choose>
  1155.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4) and $lDH1 &lt;= 14 and $lDH2 &lt;= 14)             )"/>
  1156.          <xsl:otherwise>
  1157.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1158.                <xsl:attribute name="location">
  1159.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1160.                </xsl:attribute>
  1161.                <svrl:text>
  1162.             Erreur de conformité CI-SIS : <xsl:text/>
  1163.                   <xsl:value-of select="'ClinicalDocument/effectiveTime'"/>
  1164.                   <xsl:text/>/@value = "<xsl:text/>
  1165.                   <xsl:value-of select="@value"/>
  1166.                   <xsl:text/>"  contient  
  1167.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1168.             en temps local du producteur.
  1169.         </svrl:text>
  1170.             </svrl:failed-assert>
  1171.          </xsl:otherwise>
  1172.       </xsl:choose>
  1173.  
  1174.             <!--ASSERT -->
  1175. <xsl:choose>
  1176.          <xsl:when test="(@* and not(*)) or (not(@*) and *)"/>
  1177.          <xsl:otherwise>
  1178.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1179.                <xsl:attribute name="location">
  1180.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1181.                </xsl:attribute>
  1182.                <svrl:text>
  1183.             Erreur de conformité CI-SIS : <xsl:text/>
  1184.                   <xsl:value-of select="'ClinicalDocument/effectiveTime'"/>
  1185.                   <xsl:text/> doit contenir soit un attribut soit des éléments fils.
  1186.         </svrl:text>
  1187.             </svrl:failed-assert>
  1188.          </xsl:otherwise>
  1189.       </xsl:choose>
  1190.  
  1191.             <!--ASSERT -->
  1192. <xsl:choose>
  1193.          <xsl:when test="(             (name(@*) = 'nullFlavor' and 0 and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             (name(@*) != 'nullFlavor')              )"/>
  1194.          <xsl:otherwise>
  1195.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1196.                <xsl:attribute name="location">
  1197.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1198.                </xsl:attribute>
  1199.                <svrl:text>
  1200.             Erreur de conformité CI-SIS : <xsl:text/>
  1201.                   <xsl:value-of select="'ClinicalDocument/effectiveTime'"/>
  1202.                   <xsl:text/> contient un 'nullFlavor' non autorisé ou porteur d'une valeur non admise.
  1203.         </svrl:text>
  1204.             </svrl:failed-assert>
  1205.          </xsl:otherwise>
  1206.       </xsl:choose>
  1207.       <xsl:apply-templates select="*" mode="M13"/>
  1208.    </xsl:template>
  1209.  
  1210.       <!--RULE -->
  1211. <xsl:template match="cda:ClinicalDocument/cda:effectiveTime/cda:low" priority="1001"
  1212.                 mode="M13">
  1213.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1214.                       context="cda:ClinicalDocument/cda:effectiveTime/cda:low"/>
  1215.       <xsl:variable name="L" select="string-length(@value)"/>
  1216.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1217.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1218.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1219.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1220.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1221.  
  1222.             <!--ASSERT -->
  1223. <xsl:choose>
  1224.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  1225.          <xsl:otherwise>
  1226.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1227.                <xsl:attribute name="location">
  1228.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1229.                </xsl:attribute>
  1230.                <svrl:text>
  1231.             Erreur de conformité CI-SIS : <xsl:text/>
  1232.                   <xsl:value-of select="'ClinicalDocument/effectiveTime'"/>
  1233.                   <xsl:text/>/low/@value = "<xsl:text/>
  1234.                   <xsl:value-of select="@value"/>
  1235.                   <xsl:text/>"  contient  
  1236.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1237.             en temps local du producteur.
  1238.         </svrl:text>
  1239.             </svrl:failed-assert>
  1240.          </xsl:otherwise>
  1241.       </xsl:choose>
  1242.       <xsl:apply-templates select="*" mode="M13"/>
  1243.    </xsl:template>
  1244.  
  1245.       <!--RULE -->
  1246. <xsl:template match="cda:ClinicalDocument/cda:effectiveTime/cda:high" priority="1000"
  1247.                 mode="M13">
  1248.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1249.                       context="cda:ClinicalDocument/cda:effectiveTime/cda:high"/>
  1250.       <xsl:variable name="L" select="string-length(@value)"/>
  1251.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1252.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1253.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1254.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1255.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1256.  
  1257.             <!--ASSERT -->
  1258. <xsl:choose>
  1259.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  1260.          <xsl:otherwise>
  1261.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1262.                <xsl:attribute name="location">
  1263.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1264.                </xsl:attribute>
  1265.                <svrl:text>
  1266.             Erreur de conformité CI-SIS : <xsl:text/>
  1267.                   <xsl:value-of select="'ClinicalDocument/effectiveTime'"/>
  1268.                   <xsl:text/>/high/@value = "<xsl:text/>
  1269.                   <xsl:value-of select="@value"/>
  1270.                   <xsl:text/>"  contient  
  1271.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1272.             en temps local du producteur.
  1273.         </svrl:text>
  1274.             </svrl:failed-assert>
  1275.          </xsl:otherwise>
  1276.       </xsl:choose>
  1277.       <xsl:apply-templates select="*" mode="M13"/>
  1278.    </xsl:template>
  1279.    <xsl:template match="text()" priority="-1" mode="M13"/>
  1280.    <xsl:template match="@*|node()" priority="-2" mode="M13">
  1281.       <xsl:apply-templates select="*" mode="M13"/>
  1282.    </xsl:template>
  1283.  
  1284.    <!--PATTERN healthcareFacilityTypeCode-->
  1285.  
  1286.  
  1287.     <!--RULE -->
  1288. <xsl:template match="cda:encompassingEncounter/cda:location/cda:healthCareFacility/cda:code"
  1289.                 priority="1000"
  1290.                 mode="M14">
  1291.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1292.                       context="cda:encompassingEncounter/cda:location/cda:healthCareFacility/cda:code"/>
  1293.       <xsl:variable name="att_code" select="@code"/>
  1294.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  1295.       <xsl:variable name="att_displayName" select="@displayName"/>
  1296.  
  1297.             <!--ASSERT -->
  1298. <xsl:choose>
  1299.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  1300.          <xsl:otherwise>
  1301.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1302.                <xsl:attribute name="location">
  1303.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1304.                </xsl:attribute>
  1305.                <svrl:text>
  1306.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  1307.                   <xsl:value-of select="'componentOf/encompassingEncounter/location/healtCareFacility/code'"/>
  1308.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  1309.         </svrl:text>
  1310.             </svrl:failed-assert>
  1311.          </xsl:otherwise>
  1312.       </xsl:choose>
  1313.  
  1314.             <!--ASSERT -->
  1315. <xsl:choose>
  1316.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  1317.          <xsl:otherwise>
  1318.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1319.                <xsl:attribute name="location">
  1320.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1321.                </xsl:attribute>
  1322.                <svrl:text>
  1323.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  1324.                   <xsl:value-of select="'componentOf/encompassingEncounter/location/healtCareFacility/code'"/>
  1325.                   <xsl:text/>" doit avoir ses attributs
  1326.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  1327.         </svrl:text>
  1328.             </svrl:failed-assert>
  1329.          </xsl:otherwise>
  1330.       </xsl:choose>
  1331.  
  1332.             <!--ASSERT -->
  1333. <xsl:choose>
  1334.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_healthcareFacilityTypeCode)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  1335.          <xsl:otherwise>
  1336.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1337.                <xsl:attribute name="location">
  1338.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1339.                </xsl:attribute>
  1340.                <svrl:text>
  1341.        
  1342.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  1343.                   <xsl:value-of select="'componentOf/encompassingEncounter/location/healtCareFacility/code'"/>
  1344.                   <xsl:text/>
  1345.             [<xsl:text/>
  1346.                   <xsl:value-of select="$att_code"/>
  1347.                   <xsl:text/>:<xsl:text/>
  1348.                   <xsl:value-of select="$att_displayName"/>
  1349.                   <xsl:text/>:<xsl:text/>
  1350.                   <xsl:value-of select="$att_codeSystem"/>
  1351.                   <xsl:text/>]
  1352.             doit faire partie du jeu de valeurs <xsl:text/>
  1353.                   <xsl:value-of select="$jdv_healthcareFacilityTypeCode"/>
  1354.                   <xsl:text/>.
  1355.         </svrl:text>
  1356.             </svrl:failed-assert>
  1357.          </xsl:otherwise>
  1358.       </xsl:choose>
  1359.       <xsl:apply-templates select="*" mode="M14"/>
  1360.    </xsl:template>
  1361.    <xsl:template match="text()" priority="-1" mode="M14"/>
  1362.    <xsl:template match="@*|node()" priority="-2" mode="M14">
  1363.       <xsl:apply-templates select="*" mode="M14"/>
  1364.    </xsl:template>
  1365.  
  1366.    <!--PATTERN informantAssignedPersonName-->
  1367.  
  1368.  
  1369.     <!--RULE -->
  1370. <xsl:template match="cda:informant/cda:assignedEntity/cda:assignedPerson/cda:name"
  1371.                 priority="1000"
  1372.                 mode="M15">
  1373.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1374.                       context="cda:informant/cda:assignedEntity/cda:assignedPerson/cda:name"/>
  1375.  
  1376.             <!--ASSERT -->
  1377. <xsl:choose>
  1378.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 1 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  1379.          <xsl:otherwise>
  1380.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1381.                <xsl:attribute name="location">
  1382.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1383.                </xsl:attribute>
  1384.                <svrl:text>
  1385.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  1386.                   <xsl:value-of select="'informant/assignedEntity/assignedPerson/name'"/>
  1387.                   <xsl:text/>/family doit être présent
  1388.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  1389.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  1390.                   <xsl:value-of select="./cda:family"/>
  1391.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  1392.                   <xsl:value-of select="./cda:family/@qualifier"/>
  1393.                   <xsl:text/>
  1394.                </svrl:text>
  1395.             </svrl:failed-assert>
  1396.          </xsl:otherwise>
  1397.       </xsl:choose>
  1398.       <xsl:apply-templates select="*" mode="M15"/>
  1399.    </xsl:template>
  1400.    <xsl:template match="text()" priority="-1" mode="M15"/>
  1401.    <xsl:template match="@*|node()" priority="-2" mode="M15">
  1402.       <xsl:apply-templates select="*" mode="M15"/>
  1403.    </xsl:template>
  1404.  
  1405.    <!--PATTERN informantRelatedEntity-->
  1406.  
  1407.  
  1408.     <!--RULE -->
  1409. <xsl:template match="cda:informant/cda:relatedEntity" priority="1000" mode="M16">
  1410.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1411.                       context="cda:informant/cda:relatedEntity"/>
  1412.  
  1413.             <!--ASSERT -->
  1414. <xsl:choose>
  1415.          <xsl:when test="((name(@*) = 'classCode') and                          (@* = 'ECON' or @* = 'GUARD' or @* = 'POLHOLD' or @* = 'CON' or @* = 'QUAL')                     )"/>
  1416.          <xsl:otherwise>
  1417.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1418.                <xsl:attribute name="location">
  1419.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1420.                </xsl:attribute>
  1421.                <svrl:text>
  1422.             Erreur de conformité CI-SIS : L'élément informant/relatedEntity doit avoir un attribut classCode dont la valeur est dans l'ensemble :
  1423.             (ECON, GUARD, POLHOLD, CON, QUAL).
  1424.         </svrl:text>
  1425.             </svrl:failed-assert>
  1426.          </xsl:otherwise>
  1427.       </xsl:choose>
  1428.  
  1429.             <!--ASSERT -->
  1430. <xsl:choose>
  1431.          <xsl:when test="./cda:addr"/>
  1432.          <xsl:otherwise>
  1433.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1434.                <xsl:attribute name="location">
  1435.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1436.                </xsl:attribute>
  1437.                <svrl:text>
  1438.             Erreur de conformité CI-SIS : L'élément informant/relatedEntity doit comporter une adresse géographique (nullFlavor autorisé)
  1439.         </svrl:text>
  1440.             </svrl:failed-assert>
  1441.          </xsl:otherwise>
  1442.       </xsl:choose>
  1443.  
  1444.             <!--ASSERT -->
  1445. <xsl:choose>
  1446.          <xsl:when test="./cda:telecom"/>
  1447.          <xsl:otherwise>
  1448.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1449.                <xsl:attribute name="location">
  1450.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1451.                </xsl:attribute>
  1452.                <svrl:text>
  1453.             Erreur de conformité CI-SIS : L'élément informant/relatedEntity doit comporter une adresse telecom (nullFlavor autorisé)
  1454.         </svrl:text>
  1455.             </svrl:failed-assert>
  1456.          </xsl:otherwise>
  1457.       </xsl:choose>
  1458.       <xsl:apply-templates select="*" mode="M16"/>
  1459.    </xsl:template>
  1460.    <xsl:template match="text()" priority="-1" mode="M16"/>
  1461.    <xsl:template match="@*|node()" priority="-2" mode="M16">
  1462.       <xsl:apply-templates select="*" mode="M16"/>
  1463.    </xsl:template>
  1464.  
  1465.    <!--PATTERN legalAuthenticatorName-->
  1466.  
  1467.  
  1468.     <!--RULE -->
  1469. <xsl:template match="cda:legalAuthenticator/cda:assignedEntity/cda:assignedPerson/cda:name"
  1470.                 priority="1000"
  1471.                 mode="M17">
  1472.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1473.                       context="cda:legalAuthenticator/cda:assignedEntity/cda:assignedPerson/cda:name"/>
  1474.  
  1475.             <!--ASSERT -->
  1476. <xsl:choose>
  1477.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 0 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  1478.          <xsl:otherwise>
  1479.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1480.                <xsl:attribute name="location">
  1481.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1482.                </xsl:attribute>
  1483.                <svrl:text>
  1484.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  1485.                   <xsl:value-of select="'legalAuthenticator/assignedEntity/assignedPerson/name'"/>
  1486.                   <xsl:text/>/family doit être présent
  1487.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  1488.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  1489.                   <xsl:value-of select="./cda:family"/>
  1490.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  1491.                   <xsl:value-of select="./cda:family/@qualifier"/>
  1492.                   <xsl:text/>
  1493.                </svrl:text>
  1494.             </svrl:failed-assert>
  1495.          </xsl:otherwise>
  1496.       </xsl:choose>
  1497.       <xsl:apply-templates select="*" mode="M17"/>
  1498.    </xsl:template>
  1499.    <xsl:template match="text()" priority="-1" mode="M17"/>
  1500.    <xsl:template match="@*|node()" priority="-2" mode="M17">
  1501.       <xsl:apply-templates select="*" mode="M17"/>
  1502.    </xsl:template>
  1503.  
  1504.    <!--PATTERN legalAuthenticatorTime-->
  1505.  
  1506.  
  1507.     <!--RULE -->
  1508. <xsl:template match="cda:legalAuthenticator/cda:time" priority="1002" mode="M18">
  1509.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1510.                       context="cda:legalAuthenticator/cda:time"/>
  1511.       <xsl:variable name="L" select="string-length(@value)"/>
  1512.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1513.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1514.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1515.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1516.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1517.       <xsl:variable name="lDH1" select="string-length(substring-before(@value,'+'))"/>
  1518.       <xsl:variable name="lDH2" select="string-length(substring-before(@value,'-'))"/>
  1519.  
  1520.             <!--ASSERT -->
  1521. <xsl:choose>
  1522.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4) and $lDH1 &lt;= 14 and $lDH2 &lt;= 14)             )"/>
  1523.          <xsl:otherwise>
  1524.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1525.                <xsl:attribute name="location">
  1526.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1527.                </xsl:attribute>
  1528.                <svrl:text>
  1529.             Erreur de conformité CI-SIS : <xsl:text/>
  1530.                   <xsl:value-of select="'legalAuthenticator/time'"/>
  1531.                   <xsl:text/>/@value = "<xsl:text/>
  1532.                   <xsl:value-of select="@value"/>
  1533.                   <xsl:text/>"  contient  
  1534.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1535.             en temps local du producteur.
  1536.         </svrl:text>
  1537.             </svrl:failed-assert>
  1538.          </xsl:otherwise>
  1539.       </xsl:choose>
  1540.  
  1541.             <!--ASSERT -->
  1542. <xsl:choose>
  1543.          <xsl:when test="(@* and not(*)) or (not(@*) and *)"/>
  1544.          <xsl:otherwise>
  1545.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1546.                <xsl:attribute name="location">
  1547.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1548.                </xsl:attribute>
  1549.                <svrl:text>
  1550.             Erreur de conformité CI-SIS : <xsl:text/>
  1551.                   <xsl:value-of select="'legalAuthenticator/time'"/>
  1552.                   <xsl:text/> doit contenir soit un attribut soit des éléments fils.
  1553.         </svrl:text>
  1554.             </svrl:failed-assert>
  1555.          </xsl:otherwise>
  1556.       </xsl:choose>
  1557.  
  1558.             <!--ASSERT -->
  1559. <xsl:choose>
  1560.          <xsl:when test="(             (name(@*) = 'nullFlavor' and 1 and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             (name(@*) != 'nullFlavor')              )"/>
  1561.          <xsl:otherwise>
  1562.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1563.                <xsl:attribute name="location">
  1564.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1565.                </xsl:attribute>
  1566.                <svrl:text>
  1567.             Erreur de conformité CI-SIS : <xsl:text/>
  1568.                   <xsl:value-of select="'legalAuthenticator/time'"/>
  1569.                   <xsl:text/> contient un 'nullFlavor' non autorisé ou porteur d'une valeur non admise.
  1570.         </svrl:text>
  1571.             </svrl:failed-assert>
  1572.          </xsl:otherwise>
  1573.       </xsl:choose>
  1574.       <xsl:apply-templates select="*" mode="M18"/>
  1575.    </xsl:template>
  1576.  
  1577.       <!--RULE -->
  1578. <xsl:template match="cda:legalAuthenticator/cda:time/cda:low" priority="1001" mode="M18">
  1579.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1580.                       context="cda:legalAuthenticator/cda:time/cda:low"/>
  1581.       <xsl:variable name="L" select="string-length(@value)"/>
  1582.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1583.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1584.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1585.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1586.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1587.  
  1588.             <!--ASSERT -->
  1589. <xsl:choose>
  1590.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  1591.          <xsl:otherwise>
  1592.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1593.                <xsl:attribute name="location">
  1594.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1595.                </xsl:attribute>
  1596.                <svrl:text>
  1597.             Erreur de conformité CI-SIS : <xsl:text/>
  1598.                   <xsl:value-of select="'legalAuthenticator/time'"/>
  1599.                   <xsl:text/>/low/@value = "<xsl:text/>
  1600.                   <xsl:value-of select="@value"/>
  1601.                   <xsl:text/>"  contient  
  1602.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1603.             en temps local du producteur.
  1604.         </svrl:text>
  1605.             </svrl:failed-assert>
  1606.          </xsl:otherwise>
  1607.       </xsl:choose>
  1608.       <xsl:apply-templates select="*" mode="M18"/>
  1609.    </xsl:template>
  1610.  
  1611.       <!--RULE -->
  1612. <xsl:template match="cda:legalAuthenticator/cda:time/cda:high" priority="1000" mode="M18">
  1613.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1614.                       context="cda:legalAuthenticator/cda:time/cda:high"/>
  1615.       <xsl:variable name="L" select="string-length(@value)"/>
  1616.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  1617.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  1618.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  1619.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  1620.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  1621.  
  1622.             <!--ASSERT -->
  1623. <xsl:choose>
  1624.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  1625.          <xsl:otherwise>
  1626.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1627.                <xsl:attribute name="location">
  1628.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1629.                </xsl:attribute>
  1630.                <svrl:text>
  1631.             Erreur de conformité CI-SIS : <xsl:text/>
  1632.                   <xsl:value-of select="'legalAuthenticator/time'"/>
  1633.                   <xsl:text/>/high/@value = "<xsl:text/>
  1634.                   <xsl:value-of select="@value"/>
  1635.                   <xsl:text/>"  contient  
  1636.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  1637.             en temps local du producteur.
  1638.         </svrl:text>
  1639.             </svrl:failed-assert>
  1640.          </xsl:otherwise>
  1641.       </xsl:choose>
  1642.       <xsl:apply-templates select="*" mode="M18"/>
  1643.    </xsl:template>
  1644.    <xsl:template match="text()" priority="-1" mode="M18"/>
  1645.    <xsl:template match="@*|node()" priority="-2" mode="M18">
  1646.       <xsl:apply-templates select="*" mode="M18"/>
  1647.    </xsl:template>
  1648.  
  1649.    <!--PATTERN modeleCommunEnTete-->
  1650.  
  1651.  
  1652.     <!--RULE -->
  1653. <xsl:template match="cda:ClinicalDocument" priority="1000" mode="M19">
  1654.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:ClinicalDocument"/>
  1655.  
  1656.             <!--ASSERT -->
  1657. <xsl:choose>
  1658.          <xsl:when test="cda:templateId[@root=$enteteHL7France]"/>
  1659.          <xsl:otherwise>
  1660.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1661.                <xsl:attribute name="location">
  1662.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1663.                </xsl:attribute>
  1664.                <svrl:text>
  1665.             Erreur de conformité HL7 France :
  1666.             L'élément ClinicalDocument/templateId doit être présent
  1667.             avec @root = "<xsl:text/>
  1668.                   <xsl:value-of select="$enteteHL7France"/>
  1669.                   <xsl:text/>".
  1670.         </svrl:text>
  1671.             </svrl:failed-assert>
  1672.          </xsl:otherwise>
  1673.       </xsl:choose>
  1674.  
  1675.             <!--ASSERT -->
  1676. <xsl:choose>
  1677.          <xsl:when test="cda:templateId[@root=$commonTemplate]"/>
  1678.          <xsl:otherwise>
  1679.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1680.                <xsl:attribute name="location">
  1681.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1682.                </xsl:attribute>
  1683.                <svrl:text>
  1684.             Erreur de conformité CI-SIS :
  1685.             L'élément ClinicalDocument/templateId doit être présent avec @root = "<xsl:text/>
  1686.                   <xsl:value-of select="$commonTemplate"/>
  1687.                   <xsl:text/>".
  1688.         </svrl:text>
  1689.             </svrl:failed-assert>
  1690.          </xsl:otherwise>
  1691.       </xsl:choose>
  1692.  
  1693.             <!--ASSERT -->
  1694. <xsl:choose>
  1695.          <xsl:when test="cda:title and normalize-space(cda:title) and not(cda:title[@nullFlavor])"/>
  1696.          <xsl:otherwise>
  1697.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1698.                <xsl:attribute name="location">
  1699.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1700.                </xsl:attribute>
  1701.                <svrl:text>
  1702.             Erreur de conformité CI-SIS :
  1703.             L'élément "title" doit être présent dans l'en-tête,
  1704.             sans nullFlavor et doit contenir un titre non vide.
  1705.         </svrl:text>
  1706.             </svrl:failed-assert>
  1707.          </xsl:otherwise>
  1708.       </xsl:choose>
  1709.  
  1710.             <!--ASSERT -->
  1711. <xsl:choose>
  1712.          <xsl:when test="cda:effectiveTime and not(cda:effectiveTime[@nullFlavor])"/>
  1713.          <xsl:otherwise>
  1714.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1715.                <xsl:attribute name="location">
  1716.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1717.                </xsl:attribute>
  1718.                <svrl:text>
  1719.             Erreur de conformité CI-SIS :
  1720.             L'élément "effectiveTime" doit être présent dans l'en-tête, sans nullFlavor.
  1721.         </svrl:text>
  1722.             </svrl:failed-assert>
  1723.          </xsl:otherwise>
  1724.       </xsl:choose>
  1725.  
  1726.             <!--ASSERT -->
  1727. <xsl:choose>
  1728.          <xsl:when test="cda:realmCode[@code='FR']"/>
  1729.          <xsl:otherwise>
  1730.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1731.                <xsl:attribute name="location">
  1732.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1733.                </xsl:attribute>
  1734.                <svrl:text>
  1735.             Erreur de conformité CI-SIS :
  1736.             L'élément "realmCode" doit être présent et valorisé à "FR".
  1737.         </svrl:text>
  1738.             </svrl:failed-assert>
  1739.          </xsl:otherwise>
  1740.       </xsl:choose>
  1741.  
  1742.             <!--ASSERT -->
  1743. <xsl:choose>
  1744.          <xsl:when test="not(cda:confidentialityCode[@nullFlavor])"/>
  1745.          <xsl:otherwise>
  1746.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1747.                <xsl:attribute name="location">
  1748.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1749.                </xsl:attribute>
  1750.                <svrl:text>
  1751.             Erreur de conformité CI-SIS :
  1752.             L'élément "confidentialityCode" (obligatoire dans CDAr2) doit être sans nullFlavor.
  1753.         </svrl:text>
  1754.             </svrl:failed-assert>
  1755.          </xsl:otherwise>
  1756.       </xsl:choose>
  1757.  
  1758.             <!--ASSERT -->
  1759. <xsl:choose>
  1760.          <xsl:when test="cda:languageCode[@code='fr-FR']"/>
  1761.          <xsl:otherwise>
  1762.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1763.                <xsl:attribute name="location">
  1764.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1765.                </xsl:attribute>
  1766.                <svrl:text>
  1767.             Erreur de conformité CI-SIS :
  1768.             L'élément "languageCode" doit être présent dans l'en-tête, valorisé à "fr-FR".
  1769.         </svrl:text>
  1770.             </svrl:failed-assert>
  1771.          </xsl:otherwise>
  1772.       </xsl:choose>
  1773.  
  1774.             <!--ASSERT -->
  1775. <xsl:choose>
  1776.          <xsl:when test="not(cda:id[@nullFlavor])"/>
  1777.          <xsl:otherwise>
  1778.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1779.                <xsl:attribute name="location">
  1780.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1781.                </xsl:attribute>
  1782.                <svrl:text>
  1783.             Erreur de conformité CI-SIS :
  1784.             L'élément "id", identifiant unique du document (obligatoire dans CDAr2) doit être sans nullFlavor.
  1785.         </svrl:text>
  1786.             </svrl:failed-assert>
  1787.          </xsl:otherwise>
  1788.       </xsl:choose>
  1789.  
  1790.             <!--ASSERT -->
  1791. <xsl:choose>
  1792.          <xsl:when test="cda:legalAuthenticator and not(./cda:legalAuthenticator[@nullFlavor])"/>
  1793.          <xsl:otherwise>
  1794.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1795.                <xsl:attribute name="location">
  1796.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1797.                </xsl:attribute>
  1798.                <svrl:text>
  1799.             Erreur de conformité CI-SIS :
  1800.             L'élément "legalAuthenticator" doit être présent dans l'en-tête, sans nullFlavor.
  1801.         </svrl:text>
  1802.             </svrl:failed-assert>
  1803.          </xsl:otherwise>
  1804.       </xsl:choose>
  1805.  
  1806.             <!--ASSERT -->
  1807. <xsl:choose>
  1808.          <xsl:when test="not(cda:author[@nullFlavor]) and not(./cda:author/cda:assignedAuthor[@nullFlavor])"/>
  1809.          <xsl:otherwise>
  1810.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1811.                <xsl:attribute name="location">
  1812.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1813.                </xsl:attribute>
  1814.                <svrl:text>
  1815.             Erreur de conformité CI-SIS :
  1816.             Les éléments "author" et "author/assignedAuthor" doivent être sans nullFlavor dans l'en-tête.
  1817.         </svrl:text>
  1818.             </svrl:failed-assert>
  1819.          </xsl:otherwise>
  1820.       </xsl:choose>
  1821.  
  1822.             <!--ASSERT -->
  1823. <xsl:choose>
  1824.          <xsl:when test="not(cda:custodian[@nullFlavor]) and not(./cda:custodian/cda:assignedCustodian[@nullFlavor])"/>
  1825.          <xsl:otherwise>
  1826.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1827.                <xsl:attribute name="location">
  1828.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1829.                </xsl:attribute>
  1830.                <svrl:text>
  1831.             Erreur de conformité CI-SIS :
  1832.             Les éléments "custodian" et "custodian/assignedCustodian" doivent être sans nullFlavor dans l'en-tête.
  1833.        </svrl:text>
  1834.             </svrl:failed-assert>
  1835.          </xsl:otherwise>
  1836.       </xsl:choose>
  1837.  
  1838.             <!--ASSERT -->
  1839. <xsl:choose>
  1840.          <xsl:when test="(cda:documentationOf) and not(cda:documentationOf[@nullFlavor]) and                     not(cda:documentationOf/cda:serviceEvent[@nullFlavor])"/>
  1841.          <xsl:otherwise>
  1842.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1843.                <xsl:attribute name="location">
  1844.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1845.                </xsl:attribute>
  1846.                <svrl:text>
  1847.             Erreur de conformité CI-SIS :
  1848.             L'en-tête doit comporter au moins un élément documentationOf
  1849.             et l'attribut nullFlavor n'est pas autorisé ni sur documentationOf ni sur son fils serviceEvent.
  1850.         </svrl:text>
  1851.             </svrl:failed-assert>
  1852.          </xsl:otherwise>
  1853.       </xsl:choose>
  1854.  
  1855.             <!--ASSERT -->
  1856. <xsl:choose>
  1857.          <xsl:when test="cda:componentOf"/>
  1858.          <xsl:otherwise>
  1859.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1860.                <xsl:attribute name="location">
  1861.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1862.                </xsl:attribute>
  1863.                <svrl:text>
  1864.             Erreur de conformité CI-SIS :
  1865.             Le document doit comporter dans son en-tête un componentOf/encompassingEncounter.
  1866.         </svrl:text>
  1867.             </svrl:failed-assert>
  1868.          </xsl:otherwise>
  1869.       </xsl:choose>
  1870.  
  1871.             <!--ASSERT -->
  1872. <xsl:choose>
  1873.          <xsl:when test="cda:componentOf/cda:encompassingEncounter/cda:effectiveTime/@nullFlavor or                     cda:componentOf/cda:encompassingEncounter/cda:effectiveTime/cda:low/@value or                     cda:componentOf/cda:encompassingEncounter/cda:effectiveTime/cda:high/@value             "/>
  1874.          <xsl:otherwise>
  1875.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1876.                <xsl:attribute name="location">
  1877.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1878.                </xsl:attribute>
  1879.                <svrl:text>
  1880.             Erreur de conformité CI-SIS :
  1881.             L'élément componentOf/encompassingEncounter/effectiveTime doit comporter
  1882.             soit un attribut nullFlavor soit l'un des éléments fils "low/@value" et "high/@value"
  1883.             soit les deux.
  1884.         </svrl:text>
  1885.             </svrl:failed-assert>
  1886.          </xsl:otherwise>
  1887.       </xsl:choose>
  1888.  
  1889.             <!--ASSERT -->
  1890. <xsl:choose>
  1891.          <xsl:when test="cda:componentOf/cda:encompassingEncounter/cda:location/cda:healthCareFacility/cda:code"/>
  1892.          <xsl:otherwise>
  1893.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1894.                <xsl:attribute name="location">
  1895.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1896.                </xsl:attribute>
  1897.                <svrl:text>
  1898.             Erreur de conformité CI-SIS :
  1899.             Le document doit comporter dans son en-tête un componentOf/encompassingEncounter/location/healthCareFacility/code.
  1900.         </svrl:text>
  1901.             </svrl:failed-assert>
  1902.          </xsl:otherwise>
  1903.       </xsl:choose>
  1904.       <xsl:apply-templates select="*" mode="M19"/>
  1905.    </xsl:template>
  1906.    <xsl:template match="text()" priority="-1" mode="M19"/>
  1907.    <xsl:template match="@*|node()" priority="-2" mode="M19">
  1908.       <xsl:apply-templates select="*" mode="M19"/>
  1909.    </xsl:template>
  1910.  
  1911.    <!--PATTERN nonXMLBody-->
  1912.  
  1913.  
  1914.     <!--RULE -->
  1915. <xsl:template match="cda:nonXMLBody" priority="1000" mode="M20">
  1916.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:nonXMLBody"/>
  1917.  
  1918.             <!--ASSERT -->
  1919. <xsl:choose>
  1920.          <xsl:when test="../../cda:templateId[@root=$XDS-SD]"/>
  1921.          <xsl:otherwise>
  1922.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1923.                <xsl:attribute name="location">
  1924.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1925.                </xsl:attribute>
  1926.                <svrl:text>
  1927.             Erreur de conformité XDS-SD : Un document avec un
  1928.             corps non xml doit comporter l'élément ClinicalDocument/templateId avec @root =
  1929.             "<xsl:text/>
  1930.                   <xsl:value-of select="$XDS-SD"/>
  1931.                   <xsl:text/>".
  1932.         </svrl:text>
  1933.             </svrl:failed-assert>
  1934.          </xsl:otherwise>
  1935.       </xsl:choose>
  1936.  
  1937.             <!--ASSERT -->
  1938. <xsl:choose>
  1939.          <xsl:when test="./cda:text[@representation=&#34;B64&#34;]"/>
  1940.          <xsl:otherwise>
  1941.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1942.                <xsl:attribute name="location">
  1943.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1944.                </xsl:attribute>
  1945.                <svrl:text>
  1946.             Erreur de conformité CDAr2 : Un document avec un corps non xml
  1947.             doit encapsuler en format base64 son contenu dans l'élément text, avec @representation = "B64"
  1948.         </svrl:text>
  1949.             </svrl:failed-assert>
  1950.          </xsl:otherwise>
  1951.       </xsl:choose>
  1952.  
  1953.             <!--ASSERT -->
  1954. <xsl:choose>
  1955.          <xsl:when test="./cda:text[@mediaType='application/pdf' or              @mediaType='image/jpeg' or              @mediaType='image/tiff' or              @mediaType='text/plain' or              @mediaType='text/rtf']"/>
  1956.          <xsl:otherwise>
  1957.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1958.                <xsl:attribute name="location">
  1959.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1960.                </xsl:attribute>
  1961.                <svrl:text>
  1962.             Erreur de conformité CI-SIS : Un document avec un corps non xml
  1963.             doit encapsuler en format base64 son contenu dans l'élément text, avec @mediaType devant prendre
  1964.             l'une de ces valeurs : {"text/plain", "application/pdf", "image/jpeg", "image/tiff", "text/rtf"}.
  1965.         </svrl:text>
  1966.             </svrl:failed-assert>
  1967.          </xsl:otherwise>
  1968.       </xsl:choose>
  1969.       <xsl:apply-templates select="*" mode="M20"/>
  1970.    </xsl:template>
  1971.    <xsl:template match="text()" priority="-1" mode="M20"/>
  1972.    <xsl:template match="@*|node()" priority="-2" mode="M20">
  1973.       <xsl:apply-templates select="*" mode="M20"/>
  1974.    </xsl:template>
  1975.  
  1976.    <!--PATTERN patient-->
  1977.  
  1978.  
  1979.     <!--RULE -->
  1980. <xsl:template match="cda:ClinicalDocument/cda:recordTarget/cda:patientRole" priority="1000"
  1981.                 mode="M21">
  1982.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  1983.                       context="cda:ClinicalDocument/cda:recordTarget/cda:patientRole"/>
  1984.  
  1985.             <!--ASSERT -->
  1986. <xsl:choose>
  1987.          <xsl:when test="not(cda:id[@nullFlavor])"/>
  1988.          <xsl:otherwise>
  1989.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  1990.                <xsl:attribute name="location">
  1991.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  1992.                </xsl:attribute>
  1993.                <svrl:text>
  1994.             Erreur de conformité CI-SIS : L'élément recordTarget/patientRole/id (obligatoire dans CDAr2),
  1995.             doit être sans nullFlavor.
  1996.         </svrl:text>
  1997.             </svrl:failed-assert>
  1998.          </xsl:otherwise>
  1999.       </xsl:choose>
  2000.  
  2001.             <!--ASSERT -->
  2002. <xsl:choose>
  2003.          <xsl:when test="cda:id[@root=$OIDINS-c]"/>
  2004.          <xsl:otherwise>
  2005.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2006.                <xsl:attribute name="location">
  2007.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2008.                </xsl:attribute>
  2009.                <svrl:text>
  2010.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole
  2011.             doit comporter au moins un élément id contenant un INS-c du patient
  2012.         </svrl:text>
  2013.             </svrl:failed-assert>
  2014.          </xsl:otherwise>
  2015.       </xsl:choose>
  2016.  
  2017.             <!--ASSERT -->
  2018. <xsl:choose>
  2019.          <xsl:when test="cda:patient/cda:birthTime"/>
  2020.          <xsl:otherwise>
  2021.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2022.                <xsl:attribute name="location">
  2023.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2024.                </xsl:attribute>
  2025.                <svrl:text>
  2026.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole/patient/birthTime doit être présent
  2027.             avec une date de naissance ou un nullFlavor autorisé.
  2028.         </svrl:text>
  2029.             </svrl:failed-assert>
  2030.          </xsl:otherwise>
  2031.       </xsl:choose>
  2032.  
  2033.             <!--ASSERT -->
  2034. <xsl:choose>
  2035.          <xsl:when test="cda:addr"/>
  2036.          <xsl:otherwise>
  2037.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2038.                <xsl:attribute name="location">
  2039.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2040.                </xsl:attribute>
  2041.                <svrl:text>
  2042.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole/addr doit être présent
  2043.             avec une adresse géographique ou un nullFlavor autorisé.
  2044.         </svrl:text>
  2045.             </svrl:failed-assert>
  2046.          </xsl:otherwise>
  2047.       </xsl:choose>
  2048.  
  2049.             <!--ASSERT -->
  2050. <xsl:choose>
  2051.          <xsl:when test="cda:telecom"/>
  2052.          <xsl:otherwise>
  2053.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2054.                <xsl:attribute name="location">
  2055.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2056.                </xsl:attribute>
  2057.                <svrl:text>
  2058.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole/telecom doit être présent
  2059.             avec une adresse de télécommunication ou un nullFlavor autorisé.
  2060.         </svrl:text>
  2061.             </svrl:failed-assert>
  2062.          </xsl:otherwise>
  2063.       </xsl:choose>
  2064.  
  2065.             <!--ASSERT -->
  2066. <xsl:choose>
  2067.          <xsl:when test="cda:patient/cda:administrativeGenderCode"/>
  2068.          <xsl:otherwise>
  2069.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2070.                <xsl:attribute name="location">
  2071.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2072.                </xsl:attribute>
  2073.                <svrl:text>
  2074.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole/patient/administrativeGenderCode
  2075.             doit être présent avec le code sexe ou un nullFlavor autorisé.
  2076.         </svrl:text>
  2077.             </svrl:failed-assert>
  2078.          </xsl:otherwise>
  2079.       </xsl:choose>
  2080.  
  2081.             <!--ASSERT -->
  2082. <xsl:choose>
  2083.          <xsl:when test="                     not(cda:patient/cda:religiousAffiliationCode) and                     not(cda:patient/cda:raceCode) and                     not(cda:patient/cda:ethnicGroupCode)                      "/>
  2084.          <xsl:otherwise>
  2085.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2086.                <xsl:attribute name="location">
  2087.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2088.                </xsl:attribute>
  2089.                <svrl:text>
  2090.             Erreur de conformité CI-SIS : Un élément recordTarget/patientRole/patient
  2091.             ne doit contenir ni race ni religion ni groupe ethnique.
  2092.         </svrl:text>
  2093.             </svrl:failed-assert>
  2094.          </xsl:otherwise>
  2095.       </xsl:choose>
  2096.  
  2097.             <!--ASSERT -->
  2098. <xsl:choose>
  2099.          <xsl:when test="cda:patient/cda:name/cda:given"/>
  2100.          <xsl:otherwise>
  2101.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2102.                <xsl:attribute name="location">
  2103.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2104.                </xsl:attribute>
  2105.                <svrl:text>
  2106.             Erreur de conformité CI-SIS : l'élément recordTarget/patientRole/patient/name/given doit être présent avec le prénom du patient ou un nullFlavor.
  2107.         </svrl:text>
  2108.             </svrl:failed-assert>
  2109.          </xsl:otherwise>
  2110.       </xsl:choose>
  2111.       <xsl:apply-templates select="*" mode="M21"/>
  2112.    </xsl:template>
  2113.    <xsl:template match="text()" priority="-1" mode="M21"/>
  2114.    <xsl:template match="@*|node()" priority="-2" mode="M21">
  2115.       <xsl:apply-templates select="*" mode="M21"/>
  2116.    </xsl:template>
  2117.  
  2118.    <!--PATTERN patientBirthTime-->
  2119.  
  2120.  
  2121.     <!--RULE -->
  2122. <xsl:template match="cda:patient/cda:birthTime" priority="1002" mode="M22">
  2123.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:patient/cda:birthTime"/>
  2124.       <xsl:variable name="L" select="string-length(@value)"/>
  2125.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2126.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2127.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2128.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2129.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2130.       <xsl:variable name="lDH1" select="string-length(substring-before(@value,'+'))"/>
  2131.       <xsl:variable name="lDH2" select="string-length(substring-before(@value,'-'))"/>
  2132.  
  2133.             <!--ASSERT -->
  2134. <xsl:choose>
  2135.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4) and $lDH1 &lt;= 14 and $lDH2 &lt;= 14)             )"/>
  2136.          <xsl:otherwise>
  2137.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2138.                <xsl:attribute name="location">
  2139.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2140.                </xsl:attribute>
  2141.                <svrl:text>
  2142.             Erreur de conformité CI-SIS : <xsl:text/>
  2143.                   <xsl:value-of select="'patient/birthTime'"/>
  2144.                   <xsl:text/>/@value = "<xsl:text/>
  2145.                   <xsl:value-of select="@value"/>
  2146.                   <xsl:text/>"  contient  
  2147.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2148.             en temps local du producteur.
  2149.         </svrl:text>
  2150.             </svrl:failed-assert>
  2151.          </xsl:otherwise>
  2152.       </xsl:choose>
  2153.  
  2154.             <!--ASSERT -->
  2155. <xsl:choose>
  2156.          <xsl:when test="(@* and not(*)) or (not(@*) and *)"/>
  2157.          <xsl:otherwise>
  2158.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2159.                <xsl:attribute name="location">
  2160.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2161.                </xsl:attribute>
  2162.                <svrl:text>
  2163.             Erreur de conformité CI-SIS : <xsl:text/>
  2164.                   <xsl:value-of select="'patient/birthTime'"/>
  2165.                   <xsl:text/> doit contenir soit un attribut soit des éléments fils.
  2166.         </svrl:text>
  2167.             </svrl:failed-assert>
  2168.          </xsl:otherwise>
  2169.       </xsl:choose>
  2170.  
  2171.             <!--ASSERT -->
  2172. <xsl:choose>
  2173.          <xsl:when test="(             (name(@*) = 'nullFlavor' and 1 and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             (name(@*) != 'nullFlavor')              )"/>
  2174.          <xsl:otherwise>
  2175.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2176.                <xsl:attribute name="location">
  2177.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2178.                </xsl:attribute>
  2179.                <svrl:text>
  2180.             Erreur de conformité CI-SIS : <xsl:text/>
  2181.                   <xsl:value-of select="'patient/birthTime'"/>
  2182.                   <xsl:text/> contient un 'nullFlavor' non autorisé ou porteur d'une valeur non admise.
  2183.         </svrl:text>
  2184.             </svrl:failed-assert>
  2185.          </xsl:otherwise>
  2186.       </xsl:choose>
  2187.       <xsl:apply-templates select="*" mode="M22"/>
  2188.    </xsl:template>
  2189.  
  2190.       <!--RULE -->
  2191. <xsl:template match="cda:patient/cda:birthTime/cda:low" priority="1001" mode="M22">
  2192.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2193.                       context="cda:patient/cda:birthTime/cda:low"/>
  2194.       <xsl:variable name="L" select="string-length(@value)"/>
  2195.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2196.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2197.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2198.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2199.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2200.  
  2201.             <!--ASSERT -->
  2202. <xsl:choose>
  2203.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  2204.          <xsl:otherwise>
  2205.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2206.                <xsl:attribute name="location">
  2207.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2208.                </xsl:attribute>
  2209.                <svrl:text>
  2210.             Erreur de conformité CI-SIS : <xsl:text/>
  2211.                   <xsl:value-of select="'patient/birthTime'"/>
  2212.                   <xsl:text/>/low/@value = "<xsl:text/>
  2213.                   <xsl:value-of select="@value"/>
  2214.                   <xsl:text/>"  contient  
  2215.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2216.             en temps local du producteur.
  2217.         </svrl:text>
  2218.             </svrl:failed-assert>
  2219.          </xsl:otherwise>
  2220.       </xsl:choose>
  2221.       <xsl:apply-templates select="*" mode="M22"/>
  2222.    </xsl:template>
  2223.  
  2224.       <!--RULE -->
  2225. <xsl:template match="cda:patient/cda:birthTime/cda:high" priority="1000" mode="M22">
  2226.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2227.                       context="cda:patient/cda:birthTime/cda:high"/>
  2228.       <xsl:variable name="L" select="string-length(@value)"/>
  2229.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2230.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2231.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2232.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2233.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2234.  
  2235.             <!--ASSERT -->
  2236. <xsl:choose>
  2237.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  2238.          <xsl:otherwise>
  2239.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2240.                <xsl:attribute name="location">
  2241.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2242.                </xsl:attribute>
  2243.                <svrl:text>
  2244.             Erreur de conformité CI-SIS : <xsl:text/>
  2245.                   <xsl:value-of select="'patient/birthTime'"/>
  2246.                   <xsl:text/>/high/@value = "<xsl:text/>
  2247.                   <xsl:value-of select="@value"/>
  2248.                   <xsl:text/>"  contient  
  2249.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2250.             en temps local du producteur.
  2251.         </svrl:text>
  2252.             </svrl:failed-assert>
  2253.          </xsl:otherwise>
  2254.       </xsl:choose>
  2255.       <xsl:apply-templates select="*" mode="M22"/>
  2256.    </xsl:template>
  2257.    <xsl:template match="text()" priority="-1" mode="M22"/>
  2258.    <xsl:template match="@*|node()" priority="-2" mode="M22">
  2259.       <xsl:apply-templates select="*" mode="M22"/>
  2260.    </xsl:template>
  2261.  
  2262.    <!--PATTERN patientId-->
  2263.  
  2264.  
  2265.     <!--RULE -->
  2266. <xsl:template match="cda:ClinicalDocument/cda:recordTarget/cda:patientRole/cda:id"
  2267.                 priority="1000"
  2268.                 mode="M23">
  2269.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2270.                       context="cda:ClinicalDocument/cda:recordTarget/cda:patientRole/cda:id"/>
  2271.  
  2272.             <!--ASSERT -->
  2273. <xsl:choose>
  2274.          <xsl:when test="             (@root = $OIDINS-c and string-length(@extension) = 22 and number(@extension) &gt; 1)               or (@root != $OIDINS-c)"/>
  2275.          <xsl:otherwise>
  2276.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2277.                <xsl:attribute name="location">
  2278.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2279.                </xsl:attribute>
  2280.                <svrl:text>
  2281.             Erreur de conformité CI-SIS : L'INS-c doit contenir une chaine de 22 chiffres
  2282.             (valeur trouvée dans le document : <xsl:text/>
  2283.                   <xsl:value-of select="@extension"/>
  2284.                   <xsl:text/>,
  2285.              OID trouvé : <xsl:text/>
  2286.                   <xsl:value-of select="@root"/>
  2287.                   <xsl:text/>)
  2288.         </svrl:text>
  2289.             </svrl:failed-assert>
  2290.          </xsl:otherwise>
  2291.       </xsl:choose>
  2292.       <xsl:apply-templates select="*" mode="M23"/>
  2293.    </xsl:template>
  2294.    <xsl:template match="text()" priority="-1" mode="M23"/>
  2295.    <xsl:template match="@*|node()" priority="-2" mode="M23">
  2296.       <xsl:apply-templates select="*" mode="M23"/>
  2297.    </xsl:template>
  2298.  
  2299.    <!--PATTERN patientName-->
  2300.  
  2301.  
  2302.     <!--RULE -->
  2303. <xsl:template match="cda:patient/cda:name" priority="1000" mode="M24">
  2304.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:patient/cda:name"/>
  2305.  
  2306.             <!--ASSERT -->
  2307. <xsl:choose>
  2308.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 0 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  2309.          <xsl:otherwise>
  2310.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2311.                <xsl:attribute name="location">
  2312.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2313.                </xsl:attribute>
  2314.                <svrl:text>
  2315.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  2316.                   <xsl:value-of select="'patient/name'"/>
  2317.                   <xsl:text/>/family doit être présent
  2318.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  2319.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  2320.                   <xsl:value-of select="./cda:family"/>
  2321.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  2322.                   <xsl:value-of select="./cda:family/@qualifier"/>
  2323.                   <xsl:text/>
  2324.                </svrl:text>
  2325.             </svrl:failed-assert>
  2326.          </xsl:otherwise>
  2327.       </xsl:choose>
  2328.       <xsl:apply-templates select="*" mode="M24"/>
  2329.    </xsl:template>
  2330.    <xsl:template match="text()" priority="-1" mode="M24"/>
  2331.    <xsl:template match="@*|node()" priority="-2" mode="M24">
  2332.       <xsl:apply-templates select="*" mode="M24"/>
  2333.    </xsl:template>
  2334.  
  2335.    <!--PATTERN practiceSettingCode-->
  2336.  
  2337.  
  2338.     <!--RULE -->
  2339. <xsl:template match="cda:serviceEvent/cda:performer/cda:assignedEntity/cda:representedOrganization/cda:standardIndustryClassCode"
  2340.                 priority="1000"
  2341.                 mode="M25">
  2342.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2343.                       context="cda:serviceEvent/cda:performer/cda:assignedEntity/cda:representedOrganization/cda:standardIndustryClassCode"/>
  2344.       <xsl:variable name="att_code" select="@code"/>
  2345.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  2346.       <xsl:variable name="att_displayName" select="@displayName"/>
  2347.  
  2348.             <!--ASSERT -->
  2349. <xsl:choose>
  2350.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  2351.          <xsl:otherwise>
  2352.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2353.                <xsl:attribute name="location">
  2354.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2355.                </xsl:attribute>
  2356.                <svrl:text>
  2357.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  2358.                   <xsl:value-of select="'serviceEvent/performer/assignedEntity/representedOrganization/standardIndustryClassCode'"/>
  2359.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  2360.         </svrl:text>
  2361.             </svrl:failed-assert>
  2362.          </xsl:otherwise>
  2363.       </xsl:choose>
  2364.  
  2365.             <!--ASSERT -->
  2366. <xsl:choose>
  2367.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  2368.          <xsl:otherwise>
  2369.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2370.                <xsl:attribute name="location">
  2371.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2372.                </xsl:attribute>
  2373.                <svrl:text>
  2374.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  2375.                   <xsl:value-of select="'serviceEvent/performer/assignedEntity/representedOrganization/standardIndustryClassCode'"/>
  2376.                   <xsl:text/>" doit avoir ses attributs
  2377.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  2378.         </svrl:text>
  2379.             </svrl:failed-assert>
  2380.          </xsl:otherwise>
  2381.       </xsl:choose>
  2382.  
  2383.             <!--ASSERT -->
  2384. <xsl:choose>
  2385.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_practiceSettingCode)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  2386.          <xsl:otherwise>
  2387.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2388.                <xsl:attribute name="location">
  2389.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2390.                </xsl:attribute>
  2391.                <svrl:text>
  2392.        
  2393.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  2394.                   <xsl:value-of select="'serviceEvent/performer/assignedEntity/representedOrganization/standardIndustryClassCode'"/>
  2395.                   <xsl:text/>
  2396.             [<xsl:text/>
  2397.                   <xsl:value-of select="$att_code"/>
  2398.                   <xsl:text/>:<xsl:text/>
  2399.                   <xsl:value-of select="$att_displayName"/>
  2400.                   <xsl:text/>:<xsl:text/>
  2401.                   <xsl:value-of select="$att_codeSystem"/>
  2402.                   <xsl:text/>]
  2403.             doit faire partie du jeu de valeurs <xsl:text/>
  2404.                   <xsl:value-of select="$jdv_practiceSettingCode"/>
  2405.                   <xsl:text/>.
  2406.         </svrl:text>
  2407.             </svrl:failed-assert>
  2408.          </xsl:otherwise>
  2409.       </xsl:choose>
  2410.       <xsl:apply-templates select="*" mode="M25"/>
  2411.    </xsl:template>
  2412.    <xsl:template match="text()" priority="-1" mode="M25"/>
  2413.    <xsl:template match="@*|node()" priority="-2" mode="M25">
  2414.       <xsl:apply-templates select="*" mode="M25"/>
  2415.    </xsl:template>
  2416.  
  2417.    <!--PATTERN relatedDocument-->
  2418.  
  2419.  
  2420.     <!--RULE -->
  2421. <xsl:template match="cda:relatedDocument" priority="1000" mode="M26">
  2422.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:relatedDocument"/>
  2423.  
  2424.             <!--ASSERT -->
  2425. <xsl:choose>
  2426.          <xsl:when test="(count(@*) = 1 and name(@*) = 'typeCode' and @* = 'RPLC')"/>
  2427.          <xsl:otherwise>
  2428.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2429.                <xsl:attribute name="location">
  2430.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2431.                </xsl:attribute>
  2432.                <svrl:text>
  2433.             Erreur de conformité CI-SIS : ClinicalDocument/relatedDocument ne contient pas l'attribut typeCode avec la seule valeur autorisée : RPLC.
  2434.         </svrl:text>
  2435.             </svrl:failed-assert>
  2436.          </xsl:otherwise>
  2437.       </xsl:choose>
  2438.       <xsl:apply-templates select="*" mode="M26"/>
  2439.    </xsl:template>
  2440.    <xsl:template match="text()" priority="-1" mode="M26"/>
  2441.    <xsl:template match="@*|node()" priority="-2" mode="M26">
  2442.       <xsl:apply-templates select="*" mode="M26"/>
  2443.    </xsl:template>
  2444.  
  2445.    <!--PATTERN relatedPersonName-->
  2446.  
  2447.  
  2448.     <!--RULE -->
  2449. <xsl:template match="cda:relatedPerson/cda:name" priority="1000" mode="M27">
  2450.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:relatedPerson/cda:name"/>
  2451.  
  2452.             <!--ASSERT -->
  2453. <xsl:choose>
  2454.          <xsl:when test="(                         (name(@*) = 'nullFlavor' and 1 and                            (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or                         ((./cda:family) and                        ((./cda:family[@qualifier='BR' or @qualifier='SP' or @qualifier='CL']) or not(./cda:family[@qualifier])))                     )"/>
  2455.          <xsl:otherwise>
  2456.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2457.                <xsl:attribute name="location">
  2458.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2459.                </xsl:attribute>
  2460.                <svrl:text>
  2461.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  2462.                   <xsl:value-of select="'relatedPerson/name'"/>
  2463.                   <xsl:text/>/family doit être présent
  2464.             avec un attribut qualifier valorisé dans : BR (nom de famille), SP (nom d'usage) ou CL (pseudonyme)
  2465.             ou sans attribut qualifier. Valeur trouvée pour family : <xsl:text/>
  2466.                   <xsl:value-of select="./cda:family"/>
  2467.                   <xsl:text/>. Valeur trouvée pour family@qualifier : <xsl:text/>
  2468.                   <xsl:value-of select="./cda:family/@qualifier"/>
  2469.                   <xsl:text/>
  2470.                </svrl:text>
  2471.             </svrl:failed-assert>
  2472.          </xsl:otherwise>
  2473.       </xsl:choose>
  2474.       <xsl:apply-templates select="*" mode="M27"/>
  2475.    </xsl:template>
  2476.    <xsl:template match="text()" priority="-1" mode="M27"/>
  2477.    <xsl:template match="@*|node()" priority="-2" mode="M27">
  2478.       <xsl:apply-templates select="*" mode="M27"/>
  2479.    </xsl:template>
  2480.  
  2481.    <!--PATTERN serviceEventEffectiveTime-->
  2482.  
  2483.  
  2484.     <!--RULE -->
  2485. <xsl:template match="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime"
  2486.                 priority="1002"
  2487.                 mode="M28">
  2488.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2489.                       context="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime"/>
  2490.       <xsl:variable name="L" select="string-length(@value)"/>
  2491.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2492.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2493.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2494.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2495.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2496.       <xsl:variable name="lDH1" select="string-length(substring-before(@value,'+'))"/>
  2497.       <xsl:variable name="lDH2" select="string-length(substring-before(@value,'-'))"/>
  2498.  
  2499.             <!--ASSERT -->
  2500. <xsl:choose>
  2501.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4) and $lDH1 &lt;= 14 and $lDH2 &lt;= 14)             )"/>
  2502.          <xsl:otherwise>
  2503.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2504.                <xsl:attribute name="location">
  2505.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2506.                </xsl:attribute>
  2507.                <svrl:text>
  2508.             Erreur de conformité CI-SIS : <xsl:text/>
  2509.                   <xsl:value-of select="'ClinicalDocument/documentationOf/serviceEvent/effectiveTime'"/>
  2510.                   <xsl:text/>/@value = "<xsl:text/>
  2511.                   <xsl:value-of select="@value"/>
  2512.                   <xsl:text/>"  contient  
  2513.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2514.             en temps local du producteur.
  2515.         </svrl:text>
  2516.             </svrl:failed-assert>
  2517.          </xsl:otherwise>
  2518.       </xsl:choose>
  2519.  
  2520.             <!--ASSERT -->
  2521. <xsl:choose>
  2522.          <xsl:when test="(@* and not(*)) or (not(@*) and *)"/>
  2523.          <xsl:otherwise>
  2524.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2525.                <xsl:attribute name="location">
  2526.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2527.                </xsl:attribute>
  2528.                <svrl:text>
  2529.             Erreur de conformité CI-SIS : <xsl:text/>
  2530.                   <xsl:value-of select="'ClinicalDocument/documentationOf/serviceEvent/effectiveTime'"/>
  2531.                   <xsl:text/> doit contenir soit un attribut soit des éléments fils.
  2532.         </svrl:text>
  2533.             </svrl:failed-assert>
  2534.          </xsl:otherwise>
  2535.       </xsl:choose>
  2536.  
  2537.             <!--ASSERT -->
  2538. <xsl:choose>
  2539.          <xsl:when test="(             (name(@*) = 'nullFlavor' and 1 and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             (name(@*) != 'nullFlavor')              )"/>
  2540.          <xsl:otherwise>
  2541.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2542.                <xsl:attribute name="location">
  2543.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2544.                </xsl:attribute>
  2545.                <svrl:text>
  2546.             Erreur de conformité CI-SIS : <xsl:text/>
  2547.                   <xsl:value-of select="'ClinicalDocument/documentationOf/serviceEvent/effectiveTime'"/>
  2548.                   <xsl:text/> contient un 'nullFlavor' non autorisé ou porteur d'une valeur non admise.
  2549.         </svrl:text>
  2550.             </svrl:failed-assert>
  2551.          </xsl:otherwise>
  2552.       </xsl:choose>
  2553.       <xsl:apply-templates select="*" mode="M28"/>
  2554.    </xsl:template>
  2555.  
  2556.       <!--RULE -->
  2557. <xsl:template match="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime/cda:low"
  2558.                 priority="1001"
  2559.                 mode="M28">
  2560.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2561.                       context="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime/cda:low"/>
  2562.       <xsl:variable name="L" select="string-length(@value)"/>
  2563.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2564.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2565.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2566.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2567.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2568.  
  2569.             <!--ASSERT -->
  2570. <xsl:choose>
  2571.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  2572.          <xsl:otherwise>
  2573.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2574.                <xsl:attribute name="location">
  2575.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2576.                </xsl:attribute>
  2577.                <svrl:text>
  2578.             Erreur de conformité CI-SIS : <xsl:text/>
  2579.                   <xsl:value-of select="'ClinicalDocument/documentationOf/serviceEvent/effectiveTime'"/>
  2580.                   <xsl:text/>/low/@value = "<xsl:text/>
  2581.                   <xsl:value-of select="@value"/>
  2582.                   <xsl:text/>"  contient  
  2583.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2584.             en temps local du producteur.
  2585.         </svrl:text>
  2586.             </svrl:failed-assert>
  2587.          </xsl:otherwise>
  2588.       </xsl:choose>
  2589.       <xsl:apply-templates select="*" mode="M28"/>
  2590.    </xsl:template>
  2591.  
  2592.       <!--RULE -->
  2593. <xsl:template match="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime/cda:high"
  2594.                 priority="1000"
  2595.                 mode="M28">
  2596.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2597.                       context="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:effectiveTime/cda:high"/>
  2598.       <xsl:variable name="L" select="string-length(@value)"/>
  2599.       <xsl:variable name="mm" select="number(substring(@value,5,2))"/>
  2600.       <xsl:variable name="dd" select="number(substring(@value,7,2))"/>
  2601.       <xsl:variable name="hh" select="number(substring(@value,9,2))"/>
  2602.       <xsl:variable name="lzp" select="string-length(substring-after(@value,'+'))"/>
  2603.       <xsl:variable name="lzm" select="string-length(substring-after(@value,'-'))"/>
  2604.  
  2605.             <!--ASSERT -->
  2606. <xsl:choose>
  2607.          <xsl:when test="(             ($L = 0) or             ($L = 4) or              ($L = 6 and $mm &lt;= 12) or              ($L = 8 and $mm &lt;= 12 and $dd &lt;= 31) or              ($L &gt; 14 and $mm &lt;= 12 and $dd &lt;= 31 and $hh &lt; 24 and ($lzp = 4 or $lzm = 4))             )"/>
  2608.          <xsl:otherwise>
  2609.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2610.                <xsl:attribute name="location">
  2611.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2612.                </xsl:attribute>
  2613.                <svrl:text>
  2614.             Erreur de conformité CI-SIS : <xsl:text/>
  2615.                   <xsl:value-of select="'ClinicalDocument/documentationOf/serviceEvent/effectiveTime'"/>
  2616.                   <xsl:text/>/high/@value = "<xsl:text/>
  2617.                   <xsl:value-of select="@value"/>
  2618.                   <xsl:text/>"  contient  
  2619.             une date et heure invalide, différente de aaaa ou aaaamm ou aaaammjj ou aaaammjjhh[mm[ss]][+/-]zzzz
  2620.             en temps local du producteur.
  2621.         </svrl:text>
  2622.             </svrl:failed-assert>
  2623.          </xsl:otherwise>
  2624.       </xsl:choose>
  2625.       <xsl:apply-templates select="*" mode="M28"/>
  2626.    </xsl:template>
  2627.    <xsl:template match="text()" priority="-1" mode="M28"/>
  2628.    <xsl:template match="@*|node()" priority="-2" mode="M28">
  2629.       <xsl:apply-templates select="*" mode="M28"/>
  2630.    </xsl:template>
  2631.  
  2632.    <!--PATTERN serviceEventPerformer-->
  2633.  
  2634.  
  2635.     <!--RULE -->
  2636. <xsl:template match="cda:ClinicalDocument" priority="1001" mode="M29">
  2637.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:ClinicalDocument"/>
  2638.  
  2639.             <!--ASSERT -->
  2640. <xsl:choose>
  2641.          <xsl:when test="count(cda:documentationOf/cda:serviceEvent/cda:performer) = 1"/>
  2642.          <xsl:otherwise>
  2643.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2644.                <xsl:attribute name="location">
  2645.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2646.                </xsl:attribute>
  2647.                <svrl:text>
  2648.             Erreur de conformité CI-SIS : l'en-tête CDA doit comporter un et un seul documentationOf/serviceEvent
  2649.             avec un élément fils performer. </svrl:text>
  2650.             </svrl:failed-assert>
  2651.          </xsl:otherwise>
  2652.       </xsl:choose>
  2653.       <xsl:apply-templates select="*" mode="M29"/>
  2654.    </xsl:template>
  2655.  
  2656.       <!--RULE -->
  2657. <xsl:template match="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:performer"
  2658.                 priority="1000"
  2659.                 mode="M29">
  2660.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2661.                       context="cda:ClinicalDocument/cda:documentationOf/cda:serviceEvent/cda:performer"/>
  2662.  
  2663.             <!--ASSERT -->
  2664. <xsl:choose>
  2665.          <xsl:when test="not(@nullFlavor)"/>
  2666.          <xsl:otherwise>
  2667.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2668.                <xsl:attribute name="location">
  2669.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2670.                </xsl:attribute>
  2671.                <svrl:text>
  2672.             Erreur de conformité CI-SIS : L'élément documentationOf/serviceEvent/performer doit être renseigné sans nullFlavor. </svrl:text>
  2673.             </svrl:failed-assert>
  2674.          </xsl:otherwise>
  2675.       </xsl:choose>
  2676.  
  2677.             <!--ASSERT -->
  2678. <xsl:choose>
  2679.          <xsl:when test="../cda:effectiveTime/cda:low and                        not(../cda:effectiveTime[@nullFlavor]) and                       not(../cda:effectiveTime/cda:low[@nullFlavor])"/>
  2680.          <xsl:otherwise>
  2681.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2682.                <xsl:attribute name="location">
  2683.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2684.                </xsl:attribute>
  2685.                <svrl:text>
  2686.             Erreur de conformité CI-SIS : L'élément documentationOf/serviceEvent portant l'acte principal documenté
  2687.             doit comporter à la fois un fils performer et un petit-fils effectiveTime/low sans attribut nullFlavor. </svrl:text>
  2688.             </svrl:failed-assert>
  2689.          </xsl:otherwise>
  2690.       </xsl:choose>
  2691.  
  2692.             <!--ASSERT -->
  2693. <xsl:choose>
  2694.          <xsl:when test="cda:assignedEntity/cda:representedOrganization/cda:standardIndustryClassCode"/>
  2695.          <xsl:otherwise>
  2696.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2697.                <xsl:attribute name="location">
  2698.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2699.                </xsl:attribute>
  2700.                <svrl:text>
  2701.             Erreur de conformité CI-SIS : L'élément documentationOf/serviceEvent/performer correspondant à l'acte principal documenté,
  2702.             doit comporter un descendant assignedEntity/representedOrganization/standardIndustryClassCode. </svrl:text>
  2703.             </svrl:failed-assert>
  2704.          </xsl:otherwise>
  2705.       </xsl:choose>
  2706.       <xsl:apply-templates select="*" mode="M29"/>
  2707.    </xsl:template>
  2708.    <xsl:template match="text()" priority="-1" mode="M29"/>
  2709.    <xsl:template match="@*|node()" priority="-2" mode="M29">
  2710.       <xsl:apply-templates select="*" mode="M29"/>
  2711.    </xsl:template>
  2712.  
  2713.    <!--PATTERN telecom-->
  2714.  
  2715.  
  2716.     <!--RULE -->
  2717. <xsl:template match="cda:telecom" priority="1000" mode="M30">
  2718.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl" context="cda:telecom"/>
  2719.       <xsl:variable name="prefix" select="substring-before(@value, ':')"/>
  2720.       <xsl:variable name="suffix" select="substring-after(@value, ':')"/>
  2721.  
  2722.             <!--ASSERT -->
  2723. <xsl:choose>
  2724.          <xsl:when test="(             (count(@*) = 1 and name(@*) = 'nullFlavor' and             (@* = 'UNK' or @* = 'NASK' or @* = 'ASKU' or @* = 'NAV' or @* = 'MSK')) or             ($suffix and (             $prefix = 'tel' or              $prefix = 'fax' or              $prefix = 'mailto' or              $prefix = 'http' or              $prefix = 'ftp' or              $prefix = 'mllp'))             )"/>
  2725.          <xsl:otherwise>
  2726.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2727.                <xsl:attribute name="location">
  2728.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2729.                </xsl:attribute>
  2730.                <svrl:text>
  2731.             Erreur de conformité CI-SIS : <xsl:text/>
  2732.                   <xsl:value-of select="name(.)"/>
  2733.                   <xsl:text/> n'est pas conforme à une adresse de télécommunication préfixe:chaîne
  2734.             (avec préfixe = tel, fax, mailto, http, ftp ou mllp)
  2735.             ou est vide et sans nullFlavor, ou contient un nullFlavor non admis.
  2736.         </svrl:text>
  2737.             </svrl:failed-assert>
  2738.          </xsl:otherwise>
  2739.       </xsl:choose>
  2740.       <xsl:apply-templates select="*" mode="M30"/>
  2741.    </xsl:template>
  2742.    <xsl:template match="text()" priority="-1" mode="M30"/>
  2743.    <xsl:template match="@*|node()" priority="-2" mode="M30">
  2744.       <xsl:apply-templates select="*" mode="M30"/>
  2745.    </xsl:template>
  2746.  
  2747.    <!--PATTERN abdomenPhysicalExam-errorsIHE PCC v3.0 Abdomen Section-->
  2748. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Abdomen Section</svrl:text>
  2749.  
  2750.       <!--RULE -->
  2751. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.31&#34;]"
  2752.                 priority="1000"
  2753.                 mode="M31">
  2754.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2755.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.31&#34;]"/>
  2756.  
  2757.             <!--ASSERT -->
  2758. <xsl:choose>
  2759.          <xsl:when test="../cda:section"/>
  2760.          <xsl:otherwise>
  2761.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2762.                <xsl:attribute name="location">
  2763.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2764.                </xsl:attribute>
  2765.                <svrl:text>
  2766.             Erreur de Conformité volet PCC: Cet élément ne peut être utilisé que comme section.
  2767.         </svrl:text>
  2768.             </svrl:failed-assert>
  2769.          </xsl:otherwise>
  2770.       </xsl:choose>
  2771.  
  2772.             <!--ASSERT -->
  2773. <xsl:choose>
  2774.          <xsl:when test="cda:code[@code = &#34;10191-5&#34;]"/>
  2775.          <xsl:otherwise>
  2776.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2777.                <xsl:attribute name="location">
  2778.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2779.                </xsl:attribute>
  2780.                <svrl:text>
  2781.             Erreur de Conformité volet PCC: Le code de la section Abdomen doit être 10191-5
  2782.         </svrl:text>
  2783.             </svrl:failed-assert>
  2784.          </xsl:otherwise>
  2785.       </xsl:choose>
  2786.  
  2787.             <!--ASSERT -->
  2788. <xsl:choose>
  2789.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  2790.          <xsl:otherwise>
  2791.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2792.                <xsl:attribute name="location">
  2793.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2794.                </xsl:attribute>
  2795.                <svrl:text>
  2796.             Erreur de Conformité volet PCC: L'élément 'codeSystem' doit être codé à partir de la nomenclature LOINC
  2797.             (2.16.840.1.113883.6.1).
  2798.         </svrl:text>
  2799.             </svrl:failed-assert>
  2800.          </xsl:otherwise>
  2801.       </xsl:choose>
  2802.       <xsl:apply-templates select="*" mode="M31"/>
  2803.    </xsl:template>
  2804.    <xsl:template match="text()" priority="-1" mode="M31"/>
  2805.    <xsl:template match="@*|node()" priority="-2" mode="M31">
  2806.       <xsl:apply-templates select="*" mode="M31"/>
  2807.    </xsl:template>
  2808.  
  2809.    <!--PATTERN activeProblemSection-errorsIHE PCC v3.0 Active Problems Section-->
  2810. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Active Problems Section</svrl:text>
  2811.  
  2812.       <!--RULE -->
  2813. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.6&#34;]" priority="1000"
  2814.                 mode="M32">
  2815.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2816.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.6&#34;]"/>
  2817.  
  2818.             <!--ASSERT -->
  2819. <xsl:choose>
  2820.          <xsl:when test="../cda:section"/>
  2821.          <xsl:otherwise>
  2822.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2823.                <xsl:attribute name="location">
  2824.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2825.                </xsl:attribute>
  2826.                <svrl:text>
  2827.             Erreur de Conformité PCC: 'Active Problems' ne peut être utilisé que comme section.</svrl:text>
  2828.             </svrl:failed-assert>
  2829.          </xsl:otherwise>
  2830.       </xsl:choose>
  2831.  
  2832.             <!--ASSERT -->
  2833. <xsl:choose>
  2834.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.11&#34;]"/>
  2835.          <xsl:otherwise>
  2836.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2837.                <xsl:attribute name="location">
  2838.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2839.                </xsl:attribute>
  2840.                <svrl:text>
  2841.             Erreur de Conformité PCC: Le templateId parent de la section 'Active Problems' (2.16.840.1.113883.10.20.1.11) doit être présent</svrl:text>
  2842.             </svrl:failed-assert>
  2843.          </xsl:otherwise>
  2844.       </xsl:choose>
  2845.  
  2846.             <!--ASSERT -->
  2847. <xsl:choose>
  2848.          <xsl:when test="cda:code[@code = &#34;11450-4&#34;]"/>
  2849.          <xsl:otherwise>
  2850.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2851.                <xsl:attribute name="location">
  2852.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2853.                </xsl:attribute>
  2854.                <svrl:text>
  2855.         Erreur de Conformité PCC: Le code de la section 'Active Problems' doit être '11450-4'</svrl:text>
  2856.             </svrl:failed-assert>
  2857.          </xsl:otherwise>
  2858.       </xsl:choose>
  2859.  
  2860.             <!--ASSERT -->
  2861. <xsl:choose>
  2862.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  2863.          <xsl:otherwise>
  2864.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2865.                <xsl:attribute name="location">
  2866.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2867.                </xsl:attribute>
  2868.                <svrl:text> Error: The section
  2869.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section
  2870.             'Active Problems' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1)</svrl:text>
  2871.             </svrl:failed-assert>
  2872.          </xsl:otherwise>
  2873.       </xsl:choose>
  2874.  
  2875.             <!--ASSERT -->
  2876. <xsl:choose>
  2877.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.2&#34;]"/>
  2878.          <xsl:otherwise>
  2879.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2880.                <xsl:attribute name="location">
  2881.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2882.                </xsl:attribute>
  2883.                <svrl:text>
  2884.             Erreur de Conformité PCC: Une section "Active Problems" doit contenir des entrée de type "Problem Concern Entry"</svrl:text>
  2885.             </svrl:failed-assert>
  2886.          </xsl:otherwise>
  2887.       </xsl:choose>
  2888.       <xsl:apply-templates select="*" mode="M32"/>
  2889.    </xsl:template>
  2890.    <xsl:template match="text()" priority="-1" mode="M32"/>
  2891.    <xsl:template match="@*|node()" priority="-2" mode="M32">
  2892.       <xsl:apply-templates select="*" mode="M32"/>
  2893.    </xsl:template>
  2894.  
  2895.    <!--PATTERN assessmentAndPlan-errorsIHE PCC v3.0 Assessment and Plan Section-->
  2896. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Assessment and Plan Section</svrl:text>
  2897.  
  2898.       <!--RULE -->
  2899. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.13.2.5&#34;]"
  2900.                 priority="1000"
  2901.                 mode="M33">
  2902.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2903.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.13.2.5&#34;]"/>
  2904.  
  2905.             <!--ASSERT -->
  2906. <xsl:choose>
  2907.          <xsl:when test="../cda:section"/>
  2908.          <xsl:otherwise>
  2909.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2910.                <xsl:attribute name="location">
  2911.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2912.                </xsl:attribute>
  2913.                <svrl:text>
  2914.             Erreur de Conformité volet PCC: 'Assessment and Plan' ne peut être utilisé que comme section.
  2915.         </svrl:text>
  2916.             </svrl:failed-assert>
  2917.          </xsl:otherwise>
  2918.       </xsl:choose>
  2919.  
  2920.             <!--ASSERT -->
  2921. <xsl:choose>
  2922.          <xsl:when test="cda:code[@code = &#34;51847-2&#34;]"/>
  2923.          <xsl:otherwise>
  2924.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2925.                <xsl:attribute name="location">
  2926.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2927.                </xsl:attribute>
  2928.                <svrl:text>
  2929.             Erreur de Conformité volet PCC: Le code de la section 'Assessment and Plan' doit être 51847-2
  2930.         </svrl:text>
  2931.             </svrl:failed-assert>
  2932.          </xsl:otherwise>
  2933.       </xsl:choose>
  2934.  
  2935.             <!--ASSERT -->
  2936. <xsl:choose>
  2937.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  2938.          <xsl:otherwise>
  2939.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2940.                <xsl:attribute name="location">
  2941.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2942.                </xsl:attribute>
  2943.                <svrl:text>
  2944.             Erreur de Conformité volet PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  2945.         </svrl:text>
  2946.             </svrl:failed-assert>
  2947.          </xsl:otherwise>
  2948.       </xsl:choose>
  2949.       <xsl:apply-templates select="*" mode="M33"/>
  2950.    </xsl:template>
  2951.    <xsl:template match="text()" priority="-1" mode="M33"/>
  2952.    <xsl:template match="@*|node()" priority="-2" mode="M33">
  2953.       <xsl:apply-templates select="*" mode="M33"/>
  2954.    </xsl:template>
  2955.  
  2956.    <!--PATTERN carePlan-errorsIHE PCC v3.0 Care Plan Section-->
  2957. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Care Plan Section</svrl:text>
  2958.  
  2959.       <!--RULE -->
  2960. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.31&#34;]"
  2961.                 priority="1000"
  2962.                 mode="M34">
  2963.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  2964.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.31&#34;]"/>
  2965.  
  2966.             <!--ASSERT -->
  2967. <xsl:choose>
  2968.          <xsl:when test="../cda:section"/>
  2969.          <xsl:otherwise>
  2970.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2971.                <xsl:attribute name="location">
  2972.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2973.                </xsl:attribute>
  2974.                <svrl:text>
  2975.             Erreur de Conformité volet PCC: 'Care Plan' ne peut être utilisé que comme section.
  2976.         </svrl:text>
  2977.             </svrl:failed-assert>
  2978.          </xsl:otherwise>
  2979.       </xsl:choose>
  2980.  
  2981.             <!--ASSERT -->
  2982. <xsl:choose>
  2983.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.10&#34;]"/>
  2984.          <xsl:otherwise>
  2985.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  2986.                <xsl:attribute name="location">
  2987.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  2988.                </xsl:attribute>
  2989.                <svrl:text>
  2990.             Erreur de Conformité volet PCC: L'OID du template parent de la section 'Care Plan' (2.16.840.1.113883.10.20.1.10) est absent.
  2991.         </svrl:text>
  2992.             </svrl:failed-assert>
  2993.          </xsl:otherwise>
  2994.       </xsl:choose>
  2995.  
  2996.             <!--ASSERT -->
  2997. <xsl:choose>
  2998.          <xsl:when test="cda:code[@code = &#34;18776-5&#34;]"/>
  2999.          <xsl:otherwise>
  3000.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3001.                <xsl:attribute name="location">
  3002.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3003.                </xsl:attribute>
  3004.                <svrl:text>
  3005.             Erreur de Conformité volet PCC: Le code de la section 'Care Plan' doit être '18776-5'
  3006.         </svrl:text>
  3007.             </svrl:failed-assert>
  3008.          </xsl:otherwise>
  3009.       </xsl:choose>
  3010.  
  3011.             <!--ASSERT -->
  3012. <xsl:choose>
  3013.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3014.          <xsl:otherwise>
  3015.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3016.                <xsl:attribute name="location">
  3017.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3018.                </xsl:attribute>
  3019.                <svrl:text>
  3020.             Erreur de Conformité volet PCC: L'attribut 'codeSystem' de la section a pour valeur '2.16.840.1.113883.6.1' (LOINC)  
  3021.             system ().
  3022.         </svrl:text>
  3023.             </svrl:failed-assert>
  3024.          </xsl:otherwise>
  3025.       </xsl:choose>
  3026.       <xsl:apply-templates select="*" mode="M34"/>
  3027.    </xsl:template>
  3028.    <xsl:template match="text()" priority="-1" mode="M34"/>
  3029.    <xsl:template match="@*|node()" priority="-2" mode="M34">
  3030.       <xsl:apply-templates select="*" mode="M34"/>
  3031.    </xsl:template>
  3032.  
  3033.    <!--PATTERN childFunctionalStatusAssessment-errorsIHE PCC v3.0 Child Functional Status Assessment-->
  3034. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Child Functional Status Assessment</svrl:text>
  3035.  
  3036.       <!--RULE -->
  3037. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.3&#34;]"
  3038.                 priority="1000"
  3039.                 mode="M35">
  3040.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3041.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.3&#34;]"/>
  3042.  
  3043.             <!--ASSERT -->
  3044. <xsl:choose>
  3045.          <xsl:when test="../cda:section"/>
  3046.          <xsl:otherwise>
  3047.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3048.                <xsl:attribute name="location">
  3049.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3050.                </xsl:attribute>
  3051.                <svrl:text>
  3052.             Erreur de Conformité PCC: 'Child Functional Status Assessment' ne peut être utilisé que comme section.
  3053.         </svrl:text>
  3054.             </svrl:failed-assert>
  3055.          </xsl:otherwise>
  3056.       </xsl:choose>
  3057.  
  3058.             <!--ASSERT -->
  3059. <xsl:choose>
  3060.          <xsl:when test="cda:code[@code = &#34;47420-5&#34;]"/>
  3061.          <xsl:otherwise>
  3062.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3063.                <xsl:attribute name="location">
  3064.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3065.                </xsl:attribute>
  3066.                <svrl:text>
  3067.             Erreur de Conformité PCC: Le code de la section 'Child Functional Status Assessment' doit être '47420-5'
  3068.         </svrl:text>
  3069.             </svrl:failed-assert>
  3070.          </xsl:otherwise>
  3071.       </xsl:choose>
  3072.  
  3073.             <!--ASSERT -->
  3074. <xsl:choose>
  3075.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3076.          <xsl:otherwise>
  3077.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3078.                <xsl:attribute name="location">
  3079.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3080.                </xsl:attribute>
  3081.                <svrl:text>
  3082.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section 'Child Functional Status Assessment' doit être codé dans la nomenclature LOINC
  3083.             (2.16.840.1.113883.6.1).
  3084.         </svrl:text>
  3085.             </svrl:failed-assert>
  3086.          </xsl:otherwise>
  3087.       </xsl:choose>
  3088.  
  3089.             <!--ASSERT -->
  3090. <xsl:choose>
  3091.          <xsl:when test=".//cda:templateId[@root =&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.4&#34;]"/>
  3092.          <xsl:otherwise>
  3093.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3094.                <xsl:attribute name="location">
  3095.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3096.                </xsl:attribute>
  3097.                <svrl:text>
  3098.             Erreur de Conformité PCC: La section 'Child Functional Status Assessment' ne contient pas de sous-section'Psychomotor development'.
  3099.         </svrl:text>
  3100.             </svrl:failed-assert>
  3101.          </xsl:otherwise>
  3102.       </xsl:choose>
  3103.  
  3104.             <!--ASSERT -->
  3105. <xsl:choose>
  3106.          <xsl:when test=".//cda:templateId[@root =&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.5&#34;]"/>
  3107.          <xsl:otherwise>
  3108.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3109.                <xsl:attribute name="location">
  3110.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3111.                </xsl:attribute>
  3112.                <svrl:text>
  3113.             Erreur de Conformité PCC: La section 'Child Functional Status Assessment' ne contient pas de sous-section'Eating and sleeping Assessment'.        
  3114.         </svrl:text>
  3115.             </svrl:failed-assert>
  3116.          </xsl:otherwise>
  3117.       </xsl:choose>
  3118.       <xsl:apply-templates select="*" mode="M35"/>
  3119.    </xsl:template>
  3120.    <xsl:template match="text()" priority="-1" mode="M35"/>
  3121.    <xsl:template match="@*|node()" priority="-2" mode="M35">
  3122.       <xsl:apply-templates select="*" mode="M35"/>
  3123.    </xsl:template>
  3124.  
  3125.    <!--PATTERN childFunctionalStatusEatingSleeping-errorsIHE PCC v3.0 Eating and sleeping Assessment-->
  3126. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Eating and sleeping Assessment</svrl:text>
  3127.  
  3128.       <!--RULE -->
  3129. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.5&#34;]"
  3130.                 priority="1000"
  3131.                 mode="M36">
  3132.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3133.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.5&#34;]"/>
  3134.  
  3135.             <!--ASSERT -->
  3136. <xsl:choose>
  3137.          <xsl:when test="../cda:section"/>
  3138.          <xsl:otherwise>
  3139.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3140.                <xsl:attribute name="location">
  3141.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3142.                </xsl:attribute>
  3143.                <svrl:text>
  3144.             Erreur de Conformité PCC: 'Eating and sleeping Assessment' ne peut être utilisé que comme section.
  3145.         </svrl:text>
  3146.             </svrl:failed-assert>
  3147.          </xsl:otherwise>
  3148.       </xsl:choose>
  3149.  
  3150.             <!--ASSERT -->
  3151. <xsl:choose>
  3152.          <xsl:when test="cda:code[@code = &#34;47420-5&#34;]"/>
  3153.          <xsl:otherwise>
  3154.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3155.                <xsl:attribute name="location">
  3156.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3157.                </xsl:attribute>
  3158.                <svrl:text>
  3159.             Erreur de Conformité PCC: Le code de la section 'Eating and sleeping Assessment' doit être 'xx-MCH-PsychoMDev'
  3160.         </svrl:text>
  3161.             </svrl:failed-assert>
  3162.          </xsl:otherwise>
  3163.       </xsl:choose>
  3164.  
  3165.             <!--ASSERT -->
  3166. <xsl:choose>
  3167.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3168.          <xsl:otherwise>
  3169.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3170.                <xsl:attribute name="location">
  3171.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3172.                </xsl:attribute>
  3173.                <svrl:text>
  3174.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section 'Eating and sleeping Assessment' doit être codé dans la nomenclature LOINC
  3175.             (2.16.840.1.113883.6.1).
  3176.         </svrl:text>
  3177.             </svrl:failed-assert>
  3178.          </xsl:otherwise>
  3179.       </xsl:choose>
  3180.       <xsl:apply-templates select="*" mode="M36"/>
  3181.    </xsl:template>
  3182.    <xsl:template match="text()" priority="-1" mode="M36"/>
  3183.    <xsl:template match="@*|node()" priority="-2" mode="M36">
  3184.       <xsl:apply-templates select="*" mode="M36"/>
  3185.    </xsl:template>
  3186.  
  3187.    <!--PATTERN childFunctionalStatusPsychoMot-errorsIHE PCC v3.0 Psychomotor Development-->
  3188. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Psychomotor Development</svrl:text>
  3189.  
  3190.       <!--RULE -->
  3191. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.4&#34;]"
  3192.                 priority="1000"
  3193.                 mode="M37">
  3194.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3195.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.7.3.1.1.13.4&#34;]"/>
  3196.  
  3197.             <!--ASSERT -->
  3198. <xsl:choose>
  3199.          <xsl:when test="../cda:section"/>
  3200.          <xsl:otherwise>
  3201.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3202.                <xsl:attribute name="location">
  3203.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3204.                </xsl:attribute>
  3205.                <svrl:text>
  3206.             Erreur de Conformité au volet PCC: 'Psychomotor Development' ne peut être utilisé que comme section.
  3207.         </svrl:text>
  3208.             </svrl:failed-assert>
  3209.          </xsl:otherwise>
  3210.       </xsl:choose>
  3211.  
  3212.             <!--ASSERT -->
  3213. <xsl:choose>
  3214.          <xsl:when test="cda:code[@code = &#34;xx-MCH-PsychoMDev&#34;]"/>
  3215.          <xsl:otherwise>
  3216.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3217.                <xsl:attribute name="location">
  3218.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3219.                </xsl:attribute>
  3220.                <svrl:text>
  3221.             Erreur de Conformité au volet PCC: Le code de la section 'Psychomotor Development' doit être 'xx-MCH-PsychoMDev'
  3222.         </svrl:text>
  3223.             </svrl:failed-assert>
  3224.          </xsl:otherwise>
  3225.       </xsl:choose>
  3226.  
  3227.             <!--ASSERT -->
  3228. <xsl:choose>
  3229.          <xsl:when test="cda:code[@codeSystem = &#34;1.2.250.1.213.1.1.4.14&#34;]"/>
  3230.          <xsl:otherwise>
  3231.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3232.                <xsl:attribute name="location">
  3233.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3234.                </xsl:attribute>
  3235.                <svrl:text>
  3236.             Erreur de Conformité au volet PCC: L'élément 'codeSystem' de la section 'Psychomotor Deveopment' doit être codé dans la nomenclature TA_CS
  3237.             (1.2.250.1.213.1.1.4.14).
  3238.         </svrl:text>
  3239.             </svrl:failed-assert>
  3240.          </xsl:otherwise>
  3241.       </xsl:choose>
  3242.       <xsl:apply-templates select="*" mode="M37"/>
  3243.    </xsl:template>
  3244.    <xsl:template match="text()" priority="-1" mode="M37"/>
  3245.    <xsl:template match="@*|node()" priority="-2" mode="M37">
  3246.       <xsl:apply-templates select="*" mode="M37"/>
  3247.    </xsl:template>
  3248.  
  3249.    <!--PATTERN CodedAntenatalTestingAndSurveillance-errorsIHE PCC v3.0 Coded Antenatal Testing and Surveillance Section-->
  3250. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Coded Antenatal Testing and Surveillance Section</svrl:text>
  3251.  
  3252.       <!--RULE -->
  3253. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.5.1&#34;]"
  3254.                 priority="1000"
  3255.                 mode="M38">
  3256.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3257.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.5.1&#34;]"/>
  3258.  
  3259.             <!--ASSERT -->
  3260. <xsl:choose>
  3261.          <xsl:when test="../cda:section"/>
  3262.          <xsl:otherwise>
  3263.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3264.                <xsl:attribute name="location">
  3265.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3266.                </xsl:attribute>
  3267.                <svrl:text>
  3268.             Erreur de Conformité PCC: 'Coded Antenatal Testing and Surveillance' ne peut être utilisé que comme section.
  3269.         </svrl:text>
  3270.             </svrl:failed-assert>
  3271.          </xsl:otherwise>
  3272.       </xsl:choose>
  3273.  
  3274.             <!--ASSERT -->
  3275. <xsl:choose>
  3276.          <xsl:when test="cda:code[@code = &#34;57078-8&#34;]"/>
  3277.          <xsl:otherwise>
  3278.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3279.                <xsl:attribute name="location">
  3280.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3281.                </xsl:attribute>
  3282.                <svrl:text>
  3283.             Erreur de Conformité PCC: Le code de la section 'Prenatal Events' doit être '57078-8'
  3284.         </svrl:text>
  3285.             </svrl:failed-assert>
  3286.          </xsl:otherwise>
  3287.       </xsl:choose>
  3288.  
  3289.             <!--ASSERT -->
  3290. <xsl:choose>
  3291.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3292.          <xsl:otherwise>
  3293.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3294.                <xsl:attribute name="location">
  3295.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3296.                </xsl:attribute>
  3297.                <svrl:text>
  3298.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section
  3299.             'Coded Antenatal Testing and Surveillance Section' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  3300.         </svrl:text>
  3301.             </svrl:failed-assert>
  3302.          </xsl:otherwise>
  3303.       </xsl:choose>
  3304.  
  3305.             <!--ASSERT -->
  3306. <xsl:choose>
  3307.          <xsl:when test="cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.5&#34;]"/>
  3308.          <xsl:otherwise>
  3309.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3310.                <xsl:attribute name="location">
  3311.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3312.                </xsl:attribute>
  3313.                <svrl:text>
  3314.             Erreur de Conformité PCC: L'OID du template parent de la section 'Coded physical Exam' est absent.
  3315.         </svrl:text>
  3316.             </svrl:failed-assert>
  3317.          </xsl:otherwise>
  3318.       </xsl:choose>
  3319.  
  3320.             <!--ASSERT -->
  3321. <xsl:choose>
  3322.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.3.10&#34;]"/>
  3323.          <xsl:otherwise>
  3324.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3325.                <xsl:attribute name="location">
  3326.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3327.                </xsl:attribute>
  3328.                <svrl:text>
  3329.             Erreur de Conformité PCC: Une section 'Antenatal Testing and Surveillance' doit contenir un élément 'Antenatal Testing and Surveillance Battery'.
  3330.         </svrl:text>
  3331.             </svrl:failed-assert>
  3332.          </xsl:otherwise>
  3333.       </xsl:choose>
  3334.       <xsl:apply-templates select="*" mode="M38"/>
  3335.    </xsl:template>
  3336.    <xsl:template match="text()" priority="-1" mode="M38"/>
  3337.    <xsl:template match="@*|node()" priority="-2" mode="M38">
  3338.       <xsl:apply-templates select="*" mode="M38"/>
  3339.    </xsl:template>
  3340.  
  3341.    <!--PATTERN codedPhysicalExam-errorsIHE PCC v3.0 Physical Exam Section - errors validation phase-->
  3342. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Physical Exam Section - errors validation phase</svrl:text>
  3343.  
  3344.       <!--RULE -->
  3345. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.15.1&#34;]"
  3346.                 priority="1000"
  3347.                 mode="M39">
  3348.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3349.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.15.1&#34;]"/>
  3350.  
  3351.             <!--ASSERT -->
  3352. <xsl:choose>
  3353.          <xsl:when test="../cda:section"/>
  3354.          <xsl:otherwise>
  3355.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3356.                <xsl:attribute name="location">
  3357.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3358.                </xsl:attribute>
  3359.                <svrl:text>
  3360.             Erreur de Conformité PCC: 'Coded physical Exam' ne peut être utilisé que comme section.
  3361.         </svrl:text>
  3362.             </svrl:failed-assert>
  3363.          </xsl:otherwise>
  3364.       </xsl:choose>
  3365.  
  3366.             <!--ASSERT -->
  3367. <xsl:choose>
  3368.          <xsl:when test="cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.15&#34;]"/>
  3369.          <xsl:otherwise>
  3370.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3371.                <xsl:attribute name="location">
  3372.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3373.                </xsl:attribute>
  3374.                <svrl:text>
  3375.             Erreur de Conformité PCC: L'OID du template parent de la section 'Coded physical Exam' est absent.
  3376.         </svrl:text>
  3377.             </svrl:failed-assert>
  3378.          </xsl:otherwise>
  3379.       </xsl:choose>
  3380.  
  3381.             <!--ASSERT -->
  3382. <xsl:choose>
  3383.          <xsl:when test="cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.24&#34;]"/>
  3384.          <xsl:otherwise>
  3385.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3386.                <xsl:attribute name="location">
  3387.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3388.                </xsl:attribute>
  3389.                <svrl:text>
  3390.             Erreur de Conformité au volet CSE: L'OID du template parent de la section 'Coded physical Exam' est absent.
  3391.         </svrl:text>
  3392.             </svrl:failed-assert>
  3393.          </xsl:otherwise>
  3394.       </xsl:choose>
  3395.  
  3396.             <!--ASSERT -->
  3397. <xsl:choose>
  3398.          <xsl:when test="cda:code[@code = &#34;29545-1&#34;]"/>
  3399.          <xsl:otherwise>
  3400.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3401.                <xsl:attribute name="location">
  3402.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3403.                </xsl:attribute>
  3404.                <svrl:text>
  3405.             Erreur de Conformité au volet CSE: Le code de la section 'Coded physical Exam' doit être '29545-1'
  3406.         </svrl:text>
  3407.             </svrl:failed-assert>
  3408.          </xsl:otherwise>
  3409.       </xsl:choose>
  3410.  
  3411.             <!--ASSERT -->
  3412. <xsl:choose>
  3413.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3414.          <xsl:otherwise>
  3415.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3416.                <xsl:attribute name="location">
  3417.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3418.                </xsl:attribute>
  3419.                <svrl:text>
  3420.             Erreur de Conformité au volet CSE: L'élément 'codeSystem' de la section 'Coded physical exam' doit être codé dans la nomenclature LOINC
  3421.             (2.16.840.1.113883.6.1).
  3422.         </svrl:text>
  3423.             </svrl:failed-assert>
  3424.          </xsl:otherwise>
  3425.       </xsl:choose>
  3426.       <xsl:apply-templates select="*" mode="M39"/>
  3427.    </xsl:template>
  3428.    <xsl:template match="text()" priority="-1" mode="M39"/>
  3429.    <xsl:template match="@*|node()" priority="-2" mode="M39">
  3430.       <xsl:apply-templates select="*" mode="M39"/>
  3431.    </xsl:template>
  3432.  
  3433.    <!--PATTERN codedResults-errorsIHE PCC Coded Results Section-->
  3434. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC Coded Results Section</svrl:text>
  3435.  
  3436.       <!--RULE -->
  3437. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.28&#34;]"
  3438.                 priority="1000"
  3439.                 mode="M40">
  3440.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3441.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.28&#34;]"/>
  3442.  
  3443.             <!--ASSERT -->
  3444. <xsl:choose>
  3445.          <xsl:when test="../cda:section"/>
  3446.          <xsl:otherwise>
  3447.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3448.                <xsl:attribute name="location">
  3449.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3450.                </xsl:attribute>
  3451.                <svrl:text>
  3452.         Erreur de Conformité au volet CSE: 'Coded Results' ne peut être utilisé que comme section.</svrl:text>
  3453.             </svrl:failed-assert>
  3454.          </xsl:otherwise>
  3455.       </xsl:choose>
  3456.  
  3457.             <!--ASSERT -->
  3458. <xsl:choose>
  3459.          <xsl:when test="cda:code[@code = '30954-2']"/>
  3460.          <xsl:otherwise>
  3461.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3462.                <xsl:attribute name="location">
  3463.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3464.                </xsl:attribute>
  3465.                <svrl:text>
  3466.         Erreur de Conformité au volet CSE: Le code de la section 'Coded Results' doit être '30954-2'</svrl:text>
  3467.             </svrl:failed-assert>
  3468.          </xsl:otherwise>
  3469.       </xsl:choose>
  3470.  
  3471.             <!--ASSERT -->
  3472. <xsl:choose>
  3473.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3474.          <xsl:otherwise>
  3475.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3476.                <xsl:attribute name="location">
  3477.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3478.                </xsl:attribute>
  3479.                <svrl:text>
  3480.             Erreur de Conformité au volet CSE: L'élément 'codeSystem' de la section
  3481.             'Coded Results' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).</svrl:text>
  3482.             </svrl:failed-assert>
  3483.          </xsl:otherwise>
  3484.       </xsl:choose>
  3485.       <xsl:apply-templates select="*" mode="M40"/>
  3486.    </xsl:template>
  3487.    <xsl:template match="text()" priority="-1" mode="M40"/>
  3488.    <xsl:template match="@*|node()" priority="-2" mode="M40">
  3489.       <xsl:apply-templates select="*" mode="M40"/>
  3490.    </xsl:template>
  3491.  
  3492.    <!--PATTERN codedSocialHistory-errorsIHE PCC v3.0 Coded Social History Section-->
  3493. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Coded Social History Section</svrl:text>
  3494.  
  3495.       <!--RULE -->
  3496. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.16.1&#34;]"
  3497.                 priority="1000"
  3498.                 mode="M41">
  3499.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3500.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.16.1&#34;]"/>
  3501.  
  3502.             <!--ASSERT -->
  3503. <xsl:choose>
  3504.          <xsl:when test="../cda:section"/>
  3505.          <xsl:otherwise>
  3506.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3507.                <xsl:attribute name="location">
  3508.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3509.                </xsl:attribute>
  3510.                <svrl:text>
  3511.             Erreur de Conformité au volet PCC: le templateId de 'Coded Social History' ne peut être utilisé que pour une section.
  3512.         </svrl:text>
  3513.             </svrl:failed-assert>
  3514.          </xsl:otherwise>
  3515.       </xsl:choose>
  3516.  
  3517.             <!--ASSERT -->
  3518. <xsl:choose>
  3519.          <xsl:when test="cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.16&#34;]"/>
  3520.          <xsl:otherwise>
  3521.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3522.                <xsl:attribute name="location">
  3523.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3524.                </xsl:attribute>
  3525.                <svrl:text>
  3526.             Erreur de Conformité au volet PCC: L'OID du template parent de la section 'Coded Social History' est absent.
  3527.         </svrl:text>
  3528.             </svrl:failed-assert>
  3529.          </xsl:otherwise>
  3530.       </xsl:choose>
  3531.  
  3532.             <!--ASSERT -->
  3533. <xsl:choose>
  3534.          <xsl:when test="cda:code[@code = &#34;29762-2&#34;]"/>
  3535.          <xsl:otherwise>
  3536.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3537.                <xsl:attribute name="location">
  3538.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3539.                </xsl:attribute>
  3540.                <svrl:text>
  3541.             Erreur de Conformité au volet PCC: Le code de la section 'Coded Social History' doit être 29762-2
  3542.         </svrl:text>
  3543.             </svrl:failed-assert>
  3544.          </xsl:otherwise>
  3545.       </xsl:choose>
  3546.  
  3547.             <!--ASSERT -->
  3548. <xsl:choose>
  3549.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3550.          <xsl:otherwise>
  3551.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3552.                <xsl:attribute name="location">
  3553.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3554.                </xsl:attribute>
  3555.                <svrl:text>
  3556.             Erreur de Conformité au volet PCC: L'attribut 'codeSystem' de la section 'Coded Social History' doit être codé dans la nomenclature LOINC
  3557.             (2.16.840.1.113883.6.1).
  3558.         </svrl:text>
  3559.             </svrl:failed-assert>
  3560.          </xsl:otherwise>
  3561.       </xsl:choose>
  3562.  
  3563.             <!--ASSERT -->
  3564. <xsl:choose>
  3565.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.4&#34;]"/>
  3566.          <xsl:otherwise>
  3567.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3568.                <xsl:attribute name="location">
  3569.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3570.                </xsl:attribute>
  3571.                <svrl:text>
  3572.            
  3573.             Erreur de Conformité volet PCC: La section "Coded Social History"  doit contenir des éléments d'entrée "Social History Observation".
  3574.         </svrl:text>
  3575.             </svrl:failed-assert>
  3576.          </xsl:otherwise>
  3577.       </xsl:choose>
  3578.       <xsl:apply-templates select="*" mode="M41"/>
  3579.    </xsl:template>
  3580.    <xsl:template match="text()" priority="-1" mode="M41"/>
  3581.    <xsl:template match="@*|node()" priority="-2" mode="M41">
  3582.       <xsl:apply-templates select="*" mode="M41"/>
  3583.    </xsl:template>
  3584.  
  3585.    <!--PATTERN codedVitalSigns-errorsIHE PCC v3.0 Coded Vital Signs Section - errors validation phase-->
  3586. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Coded Vital Signs Section - errors validation phase</svrl:text>
  3587.  
  3588.       <!--RULE -->
  3589. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.2&#34;]"
  3590.                 priority="1000"
  3591.                 mode="M42">
  3592.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3593.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.2&#34;]"/>
  3594.  
  3595.             <!--ASSERT -->
  3596. <xsl:choose>
  3597.          <xsl:when test="../cda:section"/>
  3598.          <xsl:otherwise>
  3599.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3600.                <xsl:attribute name="location">
  3601.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3602.                </xsl:attribute>
  3603.                <svrl:text>
  3604.             Erreur de Conformité volet CSE: ce template ne peut être utilisé que comme section.
  3605.         </svrl:text>
  3606.             </svrl:failed-assert>
  3607.          </xsl:otherwise>
  3608.       </xsl:choose>
  3609.  
  3610.             <!--ASSERT -->
  3611. <xsl:choose>
  3612.          <xsl:when test="cda:code[@code = &#34;8716-3&#34;]"/>
  3613.          <xsl:otherwise>
  3614.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3615.                <xsl:attribute name="location">
  3616.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3617.                </xsl:attribute>
  3618.                <svrl:text>
  3619.             Erreur de Conformité volet CSE: Le code de la section Coded Vital signs doit être 8716-3
  3620.         </svrl:text>
  3621.             </svrl:failed-assert>
  3622.          </xsl:otherwise>
  3623.       </xsl:choose>
  3624.  
  3625.             <!--ASSERT -->
  3626. <xsl:choose>
  3627.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3628.          <xsl:otherwise>
  3629.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3630.                <xsl:attribute name="location">
  3631.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3632.                </xsl:attribute>
  3633.                <svrl:text>
  3634.             Erreur de Conformité volet CSE: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  3635.         </svrl:text>
  3636.             </svrl:failed-assert>
  3637.          </xsl:otherwise>
  3638.       </xsl:choose>
  3639.  
  3640.             <!--ASSERT -->
  3641. <xsl:choose>
  3642.          <xsl:when test="cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.25&#34;]"/>
  3643.          <xsl:otherwise>
  3644.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3645.                <xsl:attribute name="location">
  3646.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3647.                </xsl:attribute>
  3648.                <svrl:text>
  3649.             Erreur de Conformité volet CSE: L'identifiant du template parent pour la section est absent.
  3650.         </svrl:text>
  3651.             </svrl:failed-assert>
  3652.          </xsl:otherwise>
  3653.       </xsl:choose>
  3654.  
  3655.             <!--ASSERT -->
  3656. <xsl:choose>
  3657.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.1&#34;]"/>
  3658.          <xsl:otherwise>
  3659.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3660.                <xsl:attribute name="location">
  3661.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3662.                </xsl:attribute>
  3663.                <svrl:text>
  3664.             Erreur de Conformité volet CSE: Une section 'Coded Vital Signs' doit contenir un élément 'Vital Signs Organizer'.
  3665.         </svrl:text>
  3666.             </svrl:failed-assert>
  3667.          </xsl:otherwise>
  3668.       </xsl:choose>
  3669.       <xsl:apply-templates select="*" mode="M42"/>
  3670.    </xsl:template>
  3671.    <xsl:template match="text()" priority="-1" mode="M42"/>
  3672.    <xsl:template match="@*|node()" priority="-2" mode="M42">
  3673.       <xsl:apply-templates select="*" mode="M42"/>
  3674.    </xsl:template>
  3675.  
  3676.    <!--PATTERN EarsPhysicalExam-errorsIHE PCC v3.0 Ears Section-->
  3677. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Ears Section</svrl:text>
  3678.  
  3679.       <!--RULE -->
  3680. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.21&#34;]"
  3681.                 priority="1000"
  3682.                 mode="M43">
  3683.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3684.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.21&#34;]"/>
  3685.  
  3686.             <!--ASSERT -->
  3687. <xsl:choose>
  3688.          <xsl:when test="../cda:section"/>
  3689.          <xsl:otherwise>
  3690.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3691.                <xsl:attribute name="location">
  3692.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3693.                </xsl:attribute>
  3694.                <svrl:text>
  3695.             Erreur de Conformité PCC: Ce template ne peut être utilisé que pour une section.
  3696.         </svrl:text>
  3697.             </svrl:failed-assert>
  3698.          </xsl:otherwise>
  3699.       </xsl:choose>
  3700.  
  3701.             <!--ASSERT -->
  3702. <xsl:choose>
  3703.          <xsl:when test="cda:code[@code = &#34;10195-6&#34;]"/>
  3704.          <xsl:otherwise>
  3705.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3706.                <xsl:attribute name="location">
  3707.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3708.                </xsl:attribute>
  3709.                <svrl:text>
  3710.             Erreur de Conformité PCC: Le code de la section 'Ears' doit être 10195-6
  3711.         </svrl:text>
  3712.             </svrl:failed-assert>
  3713.          </xsl:otherwise>
  3714.       </xsl:choose>
  3715.  
  3716.             <!--ASSERT -->
  3717. <xsl:choose>
  3718.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3719.          <xsl:otherwise>
  3720.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3721.                <xsl:attribute name="location">
  3722.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3723.                </xsl:attribute>
  3724.                <svrl:text>
  3725.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section 'Ears'
  3726.             doit être codé à partir de la nomenclature LOINC
  3727.             (2.16.840.1.113883.6.1).
  3728.         </svrl:text>
  3729.             </svrl:failed-assert>
  3730.          </xsl:otherwise>
  3731.       </xsl:choose>
  3732.       <xsl:apply-templates select="*" mode="M43"/>
  3733.    </xsl:template>
  3734.    <xsl:template match="text()" priority="-1" mode="M43"/>
  3735.    <xsl:template match="@*|node()" priority="-2" mode="M43">
  3736.       <xsl:apply-templates select="*" mode="M43"/>
  3737.    </xsl:template>
  3738.  
  3739.    <!--PATTERN encounterHistoriesSection-errorsIHE PCC v3.0 Encounter Histories Section-->
  3740. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Encounter Histories Section</svrl:text>
  3741.  
  3742.       <!--RULE -->
  3743. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3&#34;]"
  3744.                 priority="1000"
  3745.                 mode="M44">
  3746.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3747.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.3&#34;]"/>
  3748.  
  3749.             <!--ASSERT -->
  3750. <xsl:choose>
  3751.          <xsl:when test="../cda:section"/>
  3752.          <xsl:otherwise>
  3753.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3754.                <xsl:attribute name="location">
  3755.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3756.                </xsl:attribute>
  3757.                <svrl:text>
  3758.         Erreur de Conformité PCC: 'Encounter Histories' ne peut être utilisé que comme section.</svrl:text>
  3759.             </svrl:failed-assert>
  3760.          </xsl:otherwise>
  3761.       </xsl:choose>
  3762.  
  3763.             <!--ASSERT -->
  3764. <xsl:choose>
  3765.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.3&#34;]"/>
  3766.          <xsl:otherwise>
  3767.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3768.                <xsl:attribute name="location">
  3769.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3770.                </xsl:attribute>
  3771.                <svrl:text>
  3772.         Erreur de Conformité PCC: Les templateId des parents doivent être présents. </svrl:text>
  3773.             </svrl:failed-assert>
  3774.          </xsl:otherwise>
  3775.       </xsl:choose>
  3776.  
  3777.             <!--ASSERT -->
  3778. <xsl:choose>
  3779.          <xsl:when test="cda:code[@code = &#34;46240-8&#34;]"/>
  3780.          <xsl:otherwise>
  3781.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3782.                <xsl:attribute name="location">
  3783.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3784.                </xsl:attribute>
  3785.                <svrl:text>
  3786.         Erreur de Conformité PCC: Le code de la section 'Encounter Histories' doit être '46240-8'</svrl:text>
  3787.             </svrl:failed-assert>
  3788.          </xsl:otherwise>
  3789.       </xsl:choose>
  3790.  
  3791.             <!--ASSERT -->
  3792. <xsl:choose>
  3793.          <xsl:when test="cda:code[@codeSystem = '2.16.840.1.113883.6.1']"/>
  3794.          <xsl:otherwise>
  3795.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3796.                <xsl:attribute name="location">
  3797.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3798.                </xsl:attribute>
  3799.                <svrl:text>
  3800.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section
  3801.             'Encounter Histories' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).</svrl:text>
  3802.             </svrl:failed-assert>
  3803.          </xsl:otherwise>
  3804.       </xsl:choose>
  3805.  
  3806.             <!--ASSERT -->
  3807. <xsl:choose>
  3808.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.14&#34;]"/>
  3809.          <xsl:otherwise>
  3810.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3811.                <xsl:attribute name="location">
  3812.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3813.                </xsl:attribute>
  3814.                <svrl:text>
  3815.             Erreur de Conformité PCC: Une section "Encounter Histories" doit contenir des entrée de type "Encounters".</svrl:text>
  3816.             </svrl:failed-assert>
  3817.          </xsl:otherwise>
  3818.       </xsl:choose>
  3819.       <xsl:apply-templates select="*" mode="M44"/>
  3820.    </xsl:template>
  3821.    <xsl:template match="text()" priority="-1" mode="M44"/>
  3822.    <xsl:template match="@*|node()" priority="-2" mode="M44">
  3823.       <xsl:apply-templates select="*" mode="M44"/>
  3824.    </xsl:template>
  3825.  
  3826.    <!--PATTERN endocrinePhysicalExam-errorsIHE PCC v3.0 Endocrine system-->
  3827. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Endocrine system</svrl:text>
  3828.  
  3829.       <!--RULE -->
  3830. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.25&#34;]"
  3831.                 priority="1000"
  3832.                 mode="M45">
  3833.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3834.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.25&#34;]"/>
  3835.  
  3836.             <!--ASSERT -->
  3837. <xsl:choose>
  3838.          <xsl:when test="../cda:section"/>
  3839.          <xsl:otherwise>
  3840.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3841.                <xsl:attribute name="location">
  3842.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3843.                </xsl:attribute>
  3844.                <svrl:text>
  3845.             Erreur de Conformité PCC: Système Endocrinien et Métabolique ne peut être utilisé que comme section.
  3846.         </svrl:text>
  3847.             </svrl:failed-assert>
  3848.          </xsl:otherwise>
  3849.       </xsl:choose>
  3850.  
  3851.             <!--ASSERT -->
  3852. <xsl:choose>
  3853.          <xsl:when test="cda:code[@code = &#34;29307-6&#34;]"/>
  3854.          <xsl:otherwise>
  3855.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3856.                <xsl:attribute name="location">
  3857.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3858.                </xsl:attribute>
  3859.                <svrl:text>
  3860.             Erreur de Conformité PCC: Le code de la section Système Endocrinien et Métabolique doit être 29307-6
  3861.         </svrl:text>
  3862.             </svrl:failed-assert>
  3863.          </xsl:otherwise>
  3864.       </xsl:choose>
  3865.  
  3866.             <!--ASSERT -->
  3867. <xsl:choose>
  3868.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3869.          <xsl:otherwise>
  3870.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3871.                <xsl:attribute name="location">
  3872.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3873.                </xsl:attribute>
  3874.                <svrl:text>
  3875.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  3876.             (2.16.840.1.113883.6.1).
  3877.         </svrl:text>
  3878.             </svrl:failed-assert>
  3879.          </xsl:otherwise>
  3880.       </xsl:choose>
  3881.       <xsl:apply-templates select="*" mode="M45"/>
  3882.    </xsl:template>
  3883.    <xsl:template match="text()" priority="-1" mode="M45"/>
  3884.    <xsl:template match="@*|node()" priority="-2" mode="M45">
  3885.       <xsl:apply-templates select="*" mode="M45"/>
  3886.    </xsl:template>
  3887.  
  3888.    <!--PATTERN eyesPhysicalExam-errorsIHE PCC v3.0 Eyes-->
  3889. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Eyes</svrl:text>
  3890.  
  3891.       <!--RULE -->
  3892. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.19&#34;]"
  3893.                 priority="1000"
  3894.                 mode="M46">
  3895.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3896.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.19&#34;]"/>
  3897.  
  3898.             <!--ASSERT -->
  3899. <xsl:choose>
  3900.          <xsl:when test="../cda:section"/>
  3901.          <xsl:otherwise>
  3902.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3903.                <xsl:attribute name="location">
  3904.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3905.                </xsl:attribute>
  3906.                <svrl:text>
  3907.             Erreur de Conformité PCC: Ce templateId 'Eyes' ne peut être utilisé que pour une section.
  3908.         </svrl:text>
  3909.             </svrl:failed-assert>
  3910.          </xsl:otherwise>
  3911.       </xsl:choose>
  3912.  
  3913.             <!--ASSERT -->
  3914. <xsl:choose>
  3915.          <xsl:when test="cda:code[@code =&#34;10197-2&#34;]"/>
  3916.          <xsl:otherwise>
  3917.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3918.                <xsl:attribute name="location">
  3919.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3920.                </xsl:attribute>
  3921.                <svrl:text>
  3922.             Erreur de Conformité PCC: Le code de la section 'Eyes' doit être 10197-2
  3923.         </svrl:text>
  3924.             </svrl:failed-assert>
  3925.          </xsl:otherwise>
  3926.       </xsl:choose>
  3927.  
  3928.             <!--ASSERT -->
  3929. <xsl:choose>
  3930.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3931.          <xsl:otherwise>
  3932.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3933.                <xsl:attribute name="location">
  3934.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3935.                </xsl:attribute>
  3936.                <svrl:text>
  3937.             Erreur de Conformité PCC: L'élément 'codeSystem' de la section 'Eyes' doit être codé dans la nomenclature LOINC
  3938.             (2.16.840.1.113883.6.1).
  3939.         </svrl:text>
  3940.             </svrl:failed-assert>
  3941.          </xsl:otherwise>
  3942.       </xsl:choose>
  3943.       <xsl:apply-templates select="*" mode="M46"/>
  3944.    </xsl:template>
  3945.    <xsl:template match="text()" priority="-1" mode="M46"/>
  3946.    <xsl:template match="@*|node()" priority="-2" mode="M46">
  3947.       <xsl:apply-templates select="*" mode="M46"/>
  3948.    </xsl:template>
  3949.  
  3950.    <!--PATTERN generalAppearancePhysicalExam-errorsIHE PCC v3.0 General appearance Section-->
  3951. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 General appearance Section</svrl:text>
  3952.  
  3953.       <!--RULE -->
  3954. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.16&#34;]"
  3955.                 priority="1000"
  3956.                 mode="M47">
  3957.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  3958.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.16&#34;]"/>
  3959.  
  3960.             <!--ASSERT -->
  3961. <xsl:choose>
  3962.          <xsl:when test="../cda:section"/>
  3963.          <xsl:otherwise>
  3964.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3965.                <xsl:attribute name="location">
  3966.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3967.                </xsl:attribute>
  3968.                <svrl:text>
  3969.             Erreur de Conformité PCC: Cet élément ne peut être utilisé que comme section.
  3970.         </svrl:text>
  3971.             </svrl:failed-assert>
  3972.          </xsl:otherwise>
  3973.       </xsl:choose>
  3974.  
  3975.             <!--ASSERT -->
  3976. <xsl:choose>
  3977.          <xsl:when test="cda:code[@code = &#34;10210-3&#34;]"/>
  3978.          <xsl:otherwise>
  3979.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3980.                <xsl:attribute name="location">
  3981.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3982.                </xsl:attribute>
  3983.                <svrl:text>
  3984.             Erreur de Conformité PCC: Le code de la section Système cutané doit être 10210-3
  3985.         </svrl:text>
  3986.             </svrl:failed-assert>
  3987.          </xsl:otherwise>
  3988.       </xsl:choose>
  3989.  
  3990.             <!--ASSERT -->
  3991. <xsl:choose>
  3992.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  3993.          <xsl:otherwise>
  3994.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  3995.                <xsl:attribute name="location">
  3996.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  3997.                </xsl:attribute>
  3998.                <svrl:text>
  3999.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4000.             (2.16.840.1.113883.6.1).
  4001.         </svrl:text>
  4002.             </svrl:failed-assert>
  4003.          </xsl:otherwise>
  4004.       </xsl:choose>
  4005.       <xsl:apply-templates select="*" mode="M47"/>
  4006.    </xsl:template>
  4007.    <xsl:template match="text()" priority="-1" mode="M47"/>
  4008.    <xsl:template match="@*|node()" priority="-2" mode="M47">
  4009.       <xsl:apply-templates select="*" mode="M47"/>
  4010.    </xsl:template>
  4011.  
  4012.    <!--PATTERN genitaliaPhysicalExam-errorsIHE PCC v3.0 Genitalia-->
  4013. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Genitalia</svrl:text>
  4014.  
  4015.       <!--RULE -->
  4016. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.36&#34;]"
  4017.                 priority="1000"
  4018.                 mode="M48">
  4019.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4020.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.36&#34;]"/>
  4021.  
  4022.             <!--ASSERT -->
  4023. <xsl:choose>
  4024.          <xsl:when test="../cda:section"/>
  4025.          <xsl:otherwise>
  4026.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4027.                <xsl:attribute name="location">
  4028.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4029.                </xsl:attribute>
  4030.                <svrl:text>
  4031.                 Erreur de Conformité PCC: Cet élément ne peut être utilisé que comme section.
  4032.             </svrl:text>
  4033.             </svrl:failed-assert>
  4034.          </xsl:otherwise>
  4035.       </xsl:choose>
  4036.  
  4037.             <!--ASSERT -->
  4038. <xsl:choose>
  4039.          <xsl:when test="cda:code[@code =&#34;11400-9&#34;]"/>
  4040.          <xsl:otherwise>
  4041.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4042.                <xsl:attribute name="location">
  4043.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4044.                </xsl:attribute>
  4045.                <svrl:text>
  4046.                 Erreur de Conformité PCC: Le code de la section doit être 11400-9
  4047.             </svrl:text>
  4048.             </svrl:failed-assert>
  4049.          </xsl:otherwise>
  4050.       </xsl:choose>
  4051.  
  4052.             <!--ASSERT -->
  4053. <xsl:choose>
  4054.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4055.          <xsl:otherwise>
  4056.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4057.                <xsl:attribute name="location">
  4058.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4059.                </xsl:attribute>
  4060.                <svrl:text>
  4061.                 Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4062.                 (2.16.840.1.113883.6.1).
  4063.             </svrl:text>
  4064.             </svrl:failed-assert>
  4065.          </xsl:otherwise>
  4066.       </xsl:choose>
  4067.       <xsl:apply-templates select="*" mode="M48"/>
  4068.    </xsl:template>
  4069.    <xsl:template match="text()" priority="-1" mode="M48"/>
  4070.    <xsl:template match="@*|node()" priority="-2" mode="M48">
  4071.       <xsl:apply-templates select="*" mode="M48"/>
  4072.    </xsl:template>
  4073.  
  4074.    <!--PATTERN heartPhysicalExam-errorsIHE PCC v3.0 Heart Section-->
  4075. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Heart Section</svrl:text>
  4076.  
  4077.       <!--RULE -->
  4078. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.29&#34;]"
  4079.                 priority="1000"
  4080.                 mode="M49">
  4081.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4082.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.29&#34;]"/>
  4083.  
  4084.             <!--ASSERT -->
  4085. <xsl:choose>
  4086.          <xsl:when test="../cda:section"/>
  4087.          <xsl:otherwise>
  4088.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4089.                <xsl:attribute name="location">
  4090.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4091.                </xsl:attribute>
  4092.                <svrl:text>
  4093.             Erreur de Conformité PCC: L'entité 'Système Cardiaque' ne peut être utilisé que comme section.
  4094.         </svrl:text>
  4095.             </svrl:failed-assert>
  4096.          </xsl:otherwise>
  4097.       </xsl:choose>
  4098.  
  4099.             <!--ASSERT -->
  4100. <xsl:choose>
  4101.          <xsl:when test="cda:code[@code = &#34;10200-4&#34;]"/>
  4102.          <xsl:otherwise>
  4103.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4104.                <xsl:attribute name="location">
  4105.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4106.                </xsl:attribute>
  4107.                <svrl:text>
  4108.             Erreur de Conformité PCC: Le code de la section 'Système Cardiaque' doit être 10200-4
  4109.         </svrl:text>
  4110.             </svrl:failed-assert>
  4111.          </xsl:otherwise>
  4112.       </xsl:choose>
  4113.  
  4114.             <!--ASSERT -->
  4115. <xsl:choose>
  4116.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4117.          <xsl:otherwise>
  4118.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4119.                <xsl:attribute name="location">
  4120.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4121.                </xsl:attribute>
  4122.                <svrl:text>
  4123.             Erreur de Conformité PCC: L'attribut 'codeSystem' de la section 'Système Cardiaque'doit être codé dans la nomenclature LOINC
  4124.             (2.16.840.1.113883.6.1).
  4125.         </svrl:text>
  4126.             </svrl:failed-assert>
  4127.          </xsl:otherwise>
  4128.       </xsl:choose>
  4129.       <xsl:apply-templates select="*" mode="M49"/>
  4130.    </xsl:template>
  4131.    <xsl:template match="text()" priority="-1" mode="M49"/>
  4132.    <xsl:template match="@*|node()" priority="-2" mode="M49">
  4133.       <xsl:apply-templates select="*" mode="M49"/>
  4134.    </xsl:template>
  4135.  
  4136.    <!--PATTERN historyOfPastIllness-errorsIHE PCC v3.0 History of Past Illness Section-->
  4137. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 History of Past Illness Section</svrl:text>
  4138.  
  4139.       <!--RULE -->
  4140. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.8&#34;]" priority="1000"
  4141.                 mode="M50">
  4142.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4143.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.8&#34;]"/>
  4144.  
  4145.             <!--ASSERT -->
  4146. <xsl:choose>
  4147.          <xsl:when test="../cda:section"/>
  4148.          <xsl:otherwise>
  4149.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4150.                <xsl:attribute name="location">
  4151.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4152.                </xsl:attribute>
  4153.                <svrl:text>
  4154.             Erreur de Conformité PCC: History of Past Illness ne peut être utilisé que dans une section.
  4155.         </svrl:text>
  4156.             </svrl:failed-assert>
  4157.          </xsl:otherwise>
  4158.       </xsl:choose>
  4159.  
  4160.             <!--ASSERT -->
  4161. <xsl:choose>
  4162.          <xsl:when test="cda:code[@code = &#34;11348-0&#34;]"/>
  4163.          <xsl:otherwise>
  4164.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4165.                <xsl:attribute name="location">
  4166.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4167.                </xsl:attribute>
  4168.                <svrl:text>
  4169.             Erreur de Conformité PCC: Le code de la section History of Past Illness doit être 11348-0
  4170.         </svrl:text>
  4171.             </svrl:failed-assert>
  4172.          </xsl:otherwise>
  4173.       </xsl:choose>
  4174.  
  4175.             <!--ASSERT -->
  4176. <xsl:choose>
  4177.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4178.          <xsl:otherwise>
  4179.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4180.                <xsl:attribute name="location">
  4181.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4182.                </xsl:attribute>
  4183.                <svrl:text>
  4184.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  4185.         </svrl:text>
  4186.             </svrl:failed-assert>
  4187.          </xsl:otherwise>
  4188.       </xsl:choose>
  4189.  
  4190.             <!--ASSERT -->
  4191. <xsl:choose>
  4192.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.2&#34;]"/>
  4193.          <xsl:otherwise>
  4194.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4195.                <xsl:attribute name="location">
  4196.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4197.                </xsl:attribute>
  4198.                <svrl:text>
  4199.            
  4200.             Erreur de Conformité PCC: History of Past Illness doit contenir des éléments Problem Concern Entry.
  4201.         </svrl:text>
  4202.             </svrl:failed-assert>
  4203.          </xsl:otherwise>
  4204.       </xsl:choose>
  4205.       <xsl:apply-templates select="*" mode="M50"/>
  4206.    </xsl:template>
  4207.    <xsl:template match="text()" priority="-1" mode="M50"/>
  4208.    <xsl:template match="@*|node()" priority="-2" mode="M50">
  4209.       <xsl:apply-templates select="*" mode="M50"/>
  4210.    </xsl:template>
  4211.  
  4212.    <!--PATTERN immunizations-errorsIHE PCC v3.0 Immunizations Section-->
  4213. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Immunizations Section</svrl:text>
  4214.  
  4215.       <!--RULE -->
  4216. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.23&#34;]"
  4217.                 priority="1000"
  4218.                 mode="M51">
  4219.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4220.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.3.23&#34;]"/>
  4221.  
  4222.             <!--ASSERT -->
  4223. <xsl:choose>
  4224.          <xsl:when test="../cda:section"/>
  4225.          <xsl:otherwise>
  4226.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4227.                <xsl:attribute name="location">
  4228.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4229.                </xsl:attribute>
  4230.                <svrl:text>
  4231.             Erreur de Conformité PCC: Immunizations ne peut être utilisé que comme section.
  4232.         </svrl:text>
  4233.             </svrl:failed-assert>
  4234.          </xsl:otherwise>
  4235.       </xsl:choose>
  4236.  
  4237.             <!--ASSERT -->
  4238. <xsl:choose>
  4239.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.6&#34;]"/>
  4240.          <xsl:otherwise>
  4241.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4242.                <xsl:attribute name="location">
  4243.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4244.                </xsl:attribute>
  4245.                <svrl:text>
  4246.             Erreur de Conformité PCC: L'OID de l'élément parent n'est pas présent.
  4247.         </svrl:text>
  4248.             </svrl:failed-assert>
  4249.          </xsl:otherwise>
  4250.       </xsl:choose>
  4251.  
  4252.             <!--ASSERT -->
  4253. <xsl:choose>
  4254.          <xsl:when test="cda:code[@code = &#34;11369-6&#34;]"/>
  4255.          <xsl:otherwise>
  4256.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4257.                <xsl:attribute name="location">
  4258.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4259.                </xsl:attribute>
  4260.                <svrl:text>
  4261.             Erreur de Conformité PCC: Le code de la section doit être 11369-6
  4262.         </svrl:text>
  4263.             </svrl:failed-assert>
  4264.          </xsl:otherwise>
  4265.       </xsl:choose>
  4266.  
  4267.             <!--ASSERT -->
  4268. <xsl:choose>
  4269.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4270.          <xsl:otherwise>
  4271.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4272.                <xsl:attribute name="location">
  4273.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4274.                </xsl:attribute>
  4275.                <svrl:text>
  4276.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  4277.         </svrl:text>
  4278.             </svrl:failed-assert>
  4279.          </xsl:otherwise>
  4280.       </xsl:choose>
  4281.  
  4282.             <!--ASSERT -->
  4283. <xsl:choose>
  4284.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.12&#34;]"/>
  4285.          <xsl:otherwise>
  4286.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4287.                <xsl:attribute name="location">
  4288.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4289.                </xsl:attribute>
  4290.                <svrl:text>
  4291.             Erreur de Conformité PCC: Une section Immunizations doit contenir au moins une entrée Immunization.          
  4292.         </svrl:text>
  4293.             </svrl:failed-assert>
  4294.          </xsl:otherwise>
  4295.       </xsl:choose>
  4296.       <xsl:apply-templates select="*" mode="M51"/>
  4297.    </xsl:template>
  4298.    <xsl:template match="text()" priority="-1" mode="M51"/>
  4299.    <xsl:template match="@*|node()" priority="-2" mode="M51">
  4300.       <xsl:apply-templates select="*" mode="M51"/>
  4301.    </xsl:template>
  4302.  
  4303.    <!--PATTERN integumentaryPhysicalExam-errorsIHE PCC v3.0 Integumentary System-->
  4304. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Integumentary System</svrl:text>
  4305.  
  4306.       <!--RULE -->
  4307. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.17&#34;]"
  4308.                 priority="1000"
  4309.                 mode="M52">
  4310.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4311.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.17&#34;]"/>
  4312.  
  4313.             <!--ASSERT -->
  4314. <xsl:choose>
  4315.          <xsl:when test="../cda:section"/>
  4316.          <xsl:otherwise>
  4317.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4318.                <xsl:attribute name="location">
  4319.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4320.                </xsl:attribute>
  4321.                <svrl:text>
  4322.             Erreur de Conformité PCC: Cet élément ne peut être utilisé que comme section.
  4323.         </svrl:text>
  4324.             </svrl:failed-assert>
  4325.          </xsl:otherwise>
  4326.       </xsl:choose>
  4327.  
  4328.             <!--ASSERT -->
  4329. <xsl:choose>
  4330.          <xsl:when test="cda:code[@code = &#34;29302-7&#34;]"/>
  4331.          <xsl:otherwise>
  4332.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4333.                <xsl:attribute name="location">
  4334.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4335.                </xsl:attribute>
  4336.                <svrl:text>
  4337.             Erreur de Conformité PCC: Le code de la section 'Système cutané' doit être 29302-7
  4338.         </svrl:text>
  4339.             </svrl:failed-assert>
  4340.          </xsl:otherwise>
  4341.       </xsl:choose>
  4342.  
  4343.             <!--ASSERT -->
  4344. <xsl:choose>
  4345.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4346.          <xsl:otherwise>
  4347.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4348.                <xsl:attribute name="location">
  4349.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4350.                </xsl:attribute>
  4351.                <svrl:text>
  4352.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4353.             (2.16.840.1.113883.6.1).
  4354.         </svrl:text>
  4355.             </svrl:failed-assert>
  4356.          </xsl:otherwise>
  4357.       </xsl:choose>
  4358.       <xsl:apply-templates select="*" mode="M52"/>
  4359.    </xsl:template>
  4360.    <xsl:template match="text()" priority="-1" mode="M52"/>
  4361.    <xsl:template match="@*|node()" priority="-2" mode="M52">
  4362.       <xsl:apply-templates select="*" mode="M52"/>
  4363.    </xsl:template>
  4364.  
  4365.    <!--PATTERN laborAndDeliverySection-errorsIHE PCC Labor and Delivery section-->
  4366. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC Labor and Delivery section</svrl:text>
  4367.  
  4368.       <!--RULE -->
  4369. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.3&#34;]"
  4370.                 priority="1000"
  4371.                 mode="M53">
  4372.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4373.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.3&#34;]"/>
  4374.  
  4375.             <!--ASSERT -->
  4376. <xsl:choose>
  4377.          <xsl:when test="../cda:section"/>
  4378.          <xsl:otherwise>
  4379.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4380.                <xsl:attribute name="location">
  4381.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4382.                </xsl:attribute>
  4383.                <svrl:text>
  4384.         Erreur de Conformité PCC: le templateId de 'Labor and Delivery' ne peut être utilisé que pour une section.
  4385.     </svrl:text>
  4386.             </svrl:failed-assert>
  4387.          </xsl:otherwise>
  4388.       </xsl:choose>
  4389.  
  4390.             <!--ASSERT -->
  4391. <xsl:choose>
  4392.          <xsl:when test="cda:code[@code = &#34;XX-LABORANDDELIVERY&#34;]"/>
  4393.          <xsl:otherwise>
  4394.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4395.                <xsl:attribute name="location">
  4396.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4397.                </xsl:attribute>
  4398.                <svrl:text>
  4399.             Erreur de Conformité PCC: Le code utilisé pour la section "Labor and Delivery" doit être "XX-LABORANDDELIVERY"
  4400.             </svrl:text>
  4401.             </svrl:failed-assert>
  4402.          </xsl:otherwise>
  4403.       </xsl:choose>
  4404.  
  4405.             <!--ASSERT -->
  4406. <xsl:choose>
  4407.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4408.          <xsl:otherwise>
  4409.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4410.                <xsl:attribute name="location">
  4411.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4412.                </xsl:attribute>
  4413.                <svrl:text>
  4414.         Erreur de Conformité PCC: La nomenclature LOINC doit être utilisée pour coder la section "Labor and Delivery"  
  4415.         system (2.16.840.1.113883.6.1).
  4416.     </svrl:text>
  4417.             </svrl:failed-assert>
  4418.          </xsl:otherwise>
  4419.       </xsl:choose>
  4420.       <xsl:apply-templates select="*" mode="M53"/>
  4421.    </xsl:template>
  4422.    <xsl:template match="text()" priority="-1" mode="M53"/>
  4423.    <xsl:template match="@*|node()" priority="-2" mode="M53">
  4424.       <xsl:apply-templates select="*" mode="M53"/>
  4425.    </xsl:template>
  4426.  
  4427.    <!--PATTERN lymphaticPhysicalExam-errorsIHE PCC v3.0 Lymphatic System-->
  4428. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Lymphatic System</svrl:text>
  4429.  
  4430.       <!--RULE -->
  4431. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.32&#34;]"
  4432.                 priority="1000"
  4433.                 mode="M54">
  4434.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4435.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.32&#34;]"/>
  4436.  
  4437.             <!--ASSERT -->
  4438. <xsl:choose>
  4439.          <xsl:when test="../cda:section"/>
  4440.          <xsl:otherwise>
  4441.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4442.                <xsl:attribute name="location">
  4443.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4444.                </xsl:attribute>
  4445.                <svrl:text>
  4446.             Erreur de Conformité PCC: Cet élément ne peut être utilisé que comme section.
  4447.         </svrl:text>
  4448.             </svrl:failed-assert>
  4449.          </xsl:otherwise>
  4450.       </xsl:choose>
  4451.  
  4452.             <!--ASSERT -->
  4453. <xsl:choose>
  4454.          <xsl:when test="cda:code[@code =&#34;11447-0&#34;]"/>
  4455.          <xsl:otherwise>
  4456.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4457.                <xsl:attribute name="location">
  4458.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4459.                </xsl:attribute>
  4460.                <svrl:text>
  4461.             Erreur de Conformité PCC: Le code de la section Système cutané doit être 11447-0
  4462.         </svrl:text>
  4463.             </svrl:failed-assert>
  4464.          </xsl:otherwise>
  4465.       </xsl:choose>
  4466.  
  4467.             <!--ASSERT -->
  4468. <xsl:choose>
  4469.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4470.          <xsl:otherwise>
  4471.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4472.                <xsl:attribute name="location">
  4473.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4474.                </xsl:attribute>
  4475.                <svrl:text>
  4476.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4477.             (2.16.840.1.113883.6.1).
  4478.         </svrl:text>
  4479.             </svrl:failed-assert>
  4480.          </xsl:otherwise>
  4481.       </xsl:choose>
  4482.       <xsl:apply-templates select="*" mode="M54"/>
  4483.    </xsl:template>
  4484.    <xsl:template match="text()" priority="-1" mode="M54"/>
  4485.    <xsl:template match="@*|node()" priority="-2" mode="M54">
  4486.       <xsl:apply-templates select="*" mode="M54"/>
  4487.    </xsl:template>
  4488.  
  4489.    <!--PATTERN musculoPhysicalExam-errorsIHE PCC v3.0 Care Plan Section - errors validation phase-->
  4490. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Care Plan Section - errors validation phase</svrl:text>
  4491.  
  4492.       <!--RULE -->
  4493. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.34&#34;]"
  4494.                 priority="1000"
  4495.                 mode="M55">
  4496.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4497.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.34&#34;]"/>
  4498.  
  4499.             <!--ASSERT -->
  4500. <xsl:choose>
  4501.          <xsl:when test="../cda:section"/>
  4502.          <xsl:otherwise>
  4503.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4504.                <xsl:attribute name="location">
  4505.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4506.                </xsl:attribute>
  4507.                <svrl:text>
  4508.             Erreur de Conformité PCC: l'élément 'Musculoskeletal system' ne peut être utilisé que comme section.
  4509.         </svrl:text>
  4510.             </svrl:failed-assert>
  4511.          </xsl:otherwise>
  4512.       </xsl:choose>
  4513.  
  4514.             <!--ASSERT -->
  4515. <xsl:choose>
  4516.          <xsl:when test="cda:code[@code =&#34;11410-8&#34;]"/>
  4517.          <xsl:otherwise>
  4518.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4519.                <xsl:attribute name="location">
  4520.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4521.                </xsl:attribute>
  4522.                <svrl:text>
  4523.             Erreur de Conformité PCC: Le code de la section 'Musculoskeletal system' doit être 11410-8
  4524.         </svrl:text>
  4525.             </svrl:failed-assert>
  4526.          </xsl:otherwise>
  4527.       </xsl:choose>
  4528.  
  4529.             <!--ASSERT -->
  4530. <xsl:choose>
  4531.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4532.          <xsl:otherwise>
  4533.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4534.                <xsl:attribute name="location">
  4535.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4536.                </xsl:attribute>
  4537.                <svrl:text>
  4538.             Erreur de Conformité PCC: L'attribut 'codeSystem' de la section 'Musculoskeletal system' doit être codé dans la nomenclature LOINC
  4539.             (2.16.840.1.113883.6.1).
  4540.         </svrl:text>
  4541.             </svrl:failed-assert>
  4542.          </xsl:otherwise>
  4543.       </xsl:choose>
  4544.       <xsl:apply-templates select="*" mode="M55"/>
  4545.    </xsl:template>
  4546.    <xsl:template match="text()" priority="-1" mode="M55"/>
  4547.    <xsl:template match="@*|node()" priority="-2" mode="M55">
  4548.       <xsl:apply-templates select="*" mode="M55"/>
  4549.    </xsl:template>
  4550.  
  4551.    <!--PATTERN neurologicPhysicalExam-errorsIHE PCC v3.0 Neurologic System-->
  4552. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Neurologic System</svrl:text>
  4553.  
  4554.       <!--RULE -->
  4555. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.35&#34;]"
  4556.                 priority="1000"
  4557.                 mode="M56">
  4558.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4559.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.35&#34;]"/>
  4560.  
  4561.             <!--ASSERT -->
  4562. <xsl:choose>
  4563.          <xsl:when test="../cda:section"/>
  4564.          <xsl:otherwise>
  4565.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4566.                <xsl:attribute name="location">
  4567.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4568.                </xsl:attribute>
  4569.                <svrl:text>
  4570.             Erreur de Conformité PCC: "Neurologic System" ne peut être utilisé que comme section.
  4571.         </svrl:text>
  4572.             </svrl:failed-assert>
  4573.          </xsl:otherwise>
  4574.       </xsl:choose>
  4575.  
  4576.             <!--ASSERT -->
  4577. <xsl:choose>
  4578.          <xsl:when test="cda:code[@code =&#34;10202-0&#34;]"/>
  4579.          <xsl:otherwise>
  4580.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4581.                <xsl:attribute name="location">
  4582.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4583.                </xsl:attribute>
  4584.                <svrl:text>
  4585.             Erreur de Conformité PCC: Le code de la section "Neurologic System" doit être 10202-0
  4586.         </svrl:text>
  4587.             </svrl:failed-assert>
  4588.          </xsl:otherwise>
  4589.       </xsl:choose>
  4590.  
  4591.             <!--ASSERT -->
  4592. <xsl:choose>
  4593.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4594.          <xsl:otherwise>
  4595.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4596.                <xsl:attribute name="location">
  4597.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4598.                </xsl:attribute>
  4599.                <svrl:text>
  4600.             Erreur de Conformité PCC: L'attribut 'codeSystem' de la section "Neurologic System" doit être codé dans la nomenclature LOINC
  4601.             (2.16.840.1.113883.6.1).
  4602.         </svrl:text>
  4603.             </svrl:failed-assert>
  4604.          </xsl:otherwise>
  4605.       </xsl:choose>
  4606.       <xsl:apply-templates select="*" mode="M56"/>
  4607.    </xsl:template>
  4608.    <xsl:template match="text()" priority="-1" mode="M56"/>
  4609.    <xsl:template match="@*|node()" priority="-2" mode="M56">
  4610.       <xsl:apply-templates select="*" mode="M56"/>
  4611.    </xsl:template>
  4612.  
  4613.    <!--PATTERN pregnancyHistorySection-errorsIHE PCC v3.0 Pregnancy History Section-->
  4614. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Pregnancy History Section</svrl:text>
  4615.  
  4616.       <!--RULE -->
  4617. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.4&#34;]"
  4618.                 priority="1000"
  4619.                 mode="M57">
  4620.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4621.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.5.3.4&#34;]"/>
  4622.  
  4623.             <!--ASSERT -->
  4624. <xsl:choose>
  4625.          <xsl:when test="../cda:section"/>
  4626.          <xsl:otherwise>
  4627.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4628.                <xsl:attribute name="location">
  4629.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4630.                </xsl:attribute>
  4631.                <svrl:text>
  4632.             Erreur de Conformité PCC: le templateId de 'Pregnancy History' ne peut être utilisé que pour une section.
  4633.         </svrl:text>
  4634.             </svrl:failed-assert>
  4635.          </xsl:otherwise>
  4636.       </xsl:choose>
  4637.  
  4638.             <!--ASSERT -->
  4639. <xsl:choose>
  4640.          <xsl:when test="cda:code[@code = &#34;10162-6&#34;]"/>
  4641.          <xsl:otherwise>
  4642.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4643.                <xsl:attribute name="location">
  4644.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4645.                </xsl:attribute>
  4646.                <svrl:text>
  4647.             Erreur de Conformité PCC: Le code utilisé pour la section "Pregnancy History" doit être "10162-6"
  4648.         </svrl:text>
  4649.             </svrl:failed-assert>
  4650.          </xsl:otherwise>
  4651.       </xsl:choose>
  4652.  
  4653.             <!--ASSERT -->
  4654. <xsl:choose>
  4655.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4656.          <xsl:otherwise>
  4657.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4658.                <xsl:attribute name="location">
  4659.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4660.                </xsl:attribute>
  4661.                <svrl:text>
  4662.             Erreur de Conformité PCC: La nomenclature LOINC doit être utilisée pour coder la section "Pregnancy History"  
  4663.             system (2.16.840.1.113883.6.1).
  4664.         </svrl:text>
  4665.             </svrl:failed-assert>
  4666.          </xsl:otherwise>
  4667.       </xsl:choose>
  4668.  
  4669.             <!--ASSERT -->
  4670. <xsl:choose>
  4671.          <xsl:when test=".//cda:templateId[@root =&#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.5&#34;]"/>
  4672.          <xsl:otherwise>
  4673.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4674.                <xsl:attribute name="location">
  4675.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4676.                </xsl:attribute>
  4677.                <svrl:text>
  4678.             Erreur de Conformité PCC: Un section Pregnancy History doit comporter des entrées de type Pregnancy Observation</svrl:text>
  4679.             </svrl:failed-assert>
  4680.          </xsl:otherwise>
  4681.       </xsl:choose>
  4682.       <xsl:apply-templates select="*" mode="M57"/>
  4683.    </xsl:template>
  4684.    <xsl:template match="text()" priority="-1" mode="M57"/>
  4685.    <xsl:template match="@*|node()" priority="-2" mode="M57">
  4686.       <xsl:apply-templates select="*" mode="M57"/>
  4687.    </xsl:template>
  4688.  
  4689.    <!--PATTERN prenatalEvents-errorsIHE PCC v3.0 Prenatal Events Section-->
  4690. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Prenatal Events Section</svrl:text>
  4691.  
  4692.       <!--RULE -->
  4693. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.2&#34;]"
  4694.                 priority="1000"
  4695.                 mode="M58">
  4696.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4697.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.2.2&#34;]"/>
  4698.  
  4699.             <!--ASSERT -->
  4700. <xsl:choose>
  4701.          <xsl:when test="../cda:section"/>
  4702.          <xsl:otherwise>
  4703.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4704.                <xsl:attribute name="location">
  4705.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4706.                </xsl:attribute>
  4707.                <svrl:text>
  4708.             Erreur de Conformité au volet CSE: 'Prenatal Events' ne peut être utilisé que comme section.
  4709.         </svrl:text>
  4710.             </svrl:failed-assert>
  4711.          </xsl:otherwise>
  4712.       </xsl:choose>
  4713.  
  4714.             <!--ASSERT -->
  4715. <xsl:choose>
  4716.          <xsl:when test="cda:code[@code = &#34;57073-9&#34;]"/>
  4717.          <xsl:otherwise>
  4718.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4719.                <xsl:attribute name="location">
  4720.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4721.                </xsl:attribute>
  4722.                <svrl:text>
  4723.             Erreur de Conformité au volet CSE: Le code de la section 'Prenatal Events' doit être '57073-9'
  4724.         </svrl:text>
  4725.             </svrl:failed-assert>
  4726.          </xsl:otherwise>
  4727.       </xsl:choose>
  4728.  
  4729.             <!--ASSERT -->
  4730. <xsl:choose>
  4731.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4732.          <xsl:otherwise>
  4733.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4734.                <xsl:attribute name="location">
  4735.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4736.                </xsl:attribute>
  4737.                <svrl:text>
  4738.             Erreur de Conformité au volet CSE: L'élément 'codeSystem' de la section
  4739.             'Prenatal Events' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1).
  4740.         </svrl:text>
  4741.             </svrl:failed-assert>
  4742.          </xsl:otherwise>
  4743.       </xsl:choose>
  4744.  
  4745.             <!--ASSERT -->
  4746. <xsl:choose>
  4747.          <xsl:when test=".//cda:templateId[@root =&#34;1.3.6.1.4.1.19376.1.5.3.1.3.28&#34;]"/>
  4748.          <xsl:otherwise>
  4749.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4750.                <xsl:attribute name="location">
  4751.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4752.                </xsl:attribute>
  4753.                <svrl:text>
  4754.             Erreur de Conformité au volet CSE: La section 'Prenatal Events' ne contient pas de sous-section'Coded Results'.
  4755.         </svrl:text>
  4756.             </svrl:failed-assert>
  4757.          </xsl:otherwise>
  4758.       </xsl:choose>
  4759.       <xsl:apply-templates select="*" mode="M58"/>
  4760.    </xsl:template>
  4761.    <xsl:template match="text()" priority="-1" mode="M58"/>
  4762.    <xsl:template match="@*|node()" priority="-2" mode="M58">
  4763.       <xsl:apply-templates select="*" mode="M58"/>
  4764.    </xsl:template>
  4765.  
  4766.    <!--PATTERN proceduresSection-errorsIHE PCC v3.0 Procedures Section IHE PCC v3.0 Procedures Section-->
  4767. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Procedures Section</svrl:text>
  4768.    <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Procedures Section</svrl:text>
  4769.  
  4770.       <!--RULE -->
  4771. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.13.2.11&#34;]"
  4772.                 priority="1000"
  4773.                 mode="M59">
  4774.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4775.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.13.2.11&#34;]"/>
  4776.  
  4777.             <!--ASSERT -->
  4778. <xsl:choose>
  4779.          <xsl:when test="../cda:section"/>
  4780.          <xsl:otherwise>
  4781.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4782.                <xsl:attribute name="location">
  4783.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4784.                </xsl:attribute>
  4785.                <svrl:text>
  4786.                 Erreur de Conformité PCC: 'Procedures' ne peut être utilisé que comme section
  4787.             </svrl:text>
  4788.             </svrl:failed-assert>
  4789.          </xsl:otherwise>
  4790.       </xsl:choose>
  4791.  
  4792.             <!--ASSERT -->
  4793. <xsl:choose>
  4794.          <xsl:when test="cda:code[@code = &#34;29544-3&#34;]"/>
  4795.          <xsl:otherwise>
  4796.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4797.                <xsl:attribute name="location">
  4798.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4799.                </xsl:attribute>
  4800.                <svrl:text>
  4801.                 Erreur de Conformité PCC: Le code de la section 'Procedures' doit être '29544-3'              
  4802.             </svrl:text>
  4803.             </svrl:failed-assert>
  4804.          </xsl:otherwise>
  4805.       </xsl:choose>
  4806.  
  4807.             <!--ASSERT -->
  4808. <xsl:choose>
  4809.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4810.          <xsl:otherwise>
  4811.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4812.                <xsl:attribute name="location">
  4813.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4814.                </xsl:attribute>
  4815.                <svrl:text>
  4816.                 L'élément 'codeSystem' de la section
  4817.                 'Procedures' doit être codé dans la nomenclature LOINC (2.16.840.1.113883.6.1)
  4818.             </svrl:text>
  4819.             </svrl:failed-assert>
  4820.          </xsl:otherwise>
  4821.       </xsl:choose>
  4822.  
  4823.             <!--ASSERT -->
  4824. <xsl:choose>
  4825.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.19&#34;]"/>
  4826.          <xsl:otherwise>
  4827.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4828.                <xsl:attribute name="location">
  4829.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4830.                </xsl:attribute>
  4831.                <svrl:text>
  4832.                
  4833.                 Erreur de Conformité PCC: Une section "Procedures and Interventions" doit contenir des entrée de type "Procedures entry"
  4834.             </svrl:text>
  4835.             </svrl:failed-assert>
  4836.          </xsl:otherwise>
  4837.       </xsl:choose>
  4838.       <xsl:apply-templates select="*" mode="M59"/>
  4839.    </xsl:template>
  4840.    <xsl:template match="text()" priority="-1" mode="M59"/>
  4841.    <xsl:template match="@*|node()" priority="-2" mode="M59">
  4842.       <xsl:apply-templates select="*" mode="M59"/>
  4843.    </xsl:template>
  4844.  
  4845.    <!--PATTERN RespiratoryPhysicalExam-errorsIHE PCC v3.0 Respiratory System-->
  4846. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Respiratory System</svrl:text>
  4847.  
  4848.       <!--RULE -->
  4849. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.30&#34;]"
  4850.                 priority="1000"
  4851.                 mode="M60">
  4852.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4853.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.30&#34;]"/>
  4854.  
  4855.             <!--ASSERT -->
  4856. <xsl:choose>
  4857.          <xsl:when test="../cda:section"/>
  4858.          <xsl:otherwise>
  4859.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4860.                <xsl:attribute name="location">
  4861.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4862.                </xsl:attribute>
  4863.                <svrl:text>
  4864.             Erreur de Conformité PCC: Cet élément ne peut être utilisé que comme section.
  4865.         </svrl:text>
  4866.             </svrl:failed-assert>
  4867.          </xsl:otherwise>
  4868.       </xsl:choose>
  4869.  
  4870.             <!--ASSERT -->
  4871. <xsl:choose>
  4872.          <xsl:when test="cda:code[@code =&#34;11412-4&#34;]"/>
  4873.          <xsl:otherwise>
  4874.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4875.                <xsl:attribute name="location">
  4876.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4877.                </xsl:attribute>
  4878.                <svrl:text>
  4879.             Erreur de Conformité PCC: Le code de la section doit être 11412-4
  4880.         </svrl:text>
  4881.             </svrl:failed-assert>
  4882.          </xsl:otherwise>
  4883.       </xsl:choose>
  4884.  
  4885.             <!--ASSERT -->
  4886. <xsl:choose>
  4887.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4888.          <xsl:otherwise>
  4889.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4890.                <xsl:attribute name="location">
  4891.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4892.                </xsl:attribute>
  4893.                <svrl:text>
  4894.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4895.             (2.16.840.1.113883.6.1).
  4896.         </svrl:text>
  4897.             </svrl:failed-assert>
  4898.          </xsl:otherwise>
  4899.       </xsl:choose>
  4900.       <xsl:apply-templates select="*" mode="M60"/>
  4901.    </xsl:template>
  4902.    <xsl:template match="text()" priority="-1" mode="M60"/>
  4903.    <xsl:template match="@*|node()" priority="-2" mode="M60">
  4904.       <xsl:apply-templates select="*" mode="M60"/>
  4905.    </xsl:template>
  4906.  
  4907.    <!--PATTERN teethPhysicalExam-errorsIHE PCC v3.0 Mouth, Throat and Teeth section-->
  4908. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Mouth, Throat and Teeth section</svrl:text>
  4909.  
  4910.       <!--RULE -->
  4911. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.23&#34;]"
  4912.                 priority="1000"
  4913.                 mode="M61">
  4914.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4915.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.9.23&#34;]"/>
  4916.  
  4917.             <!--ASSERT -->
  4918. <xsl:choose>
  4919.          <xsl:when test="../cda:section"/>
  4920.          <xsl:otherwise>
  4921.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4922.                <xsl:attribute name="location">
  4923.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4924.                </xsl:attribute>
  4925.                <svrl:text>
  4926.             Erreur de Conformité PCC: section 'Mouth, Throat and Teeth' ne peut être utilisé que comme section.
  4927.         </svrl:text>
  4928.             </svrl:failed-assert>
  4929.          </xsl:otherwise>
  4930.       </xsl:choose>
  4931.  
  4932.             <!--ASSERT -->
  4933. <xsl:choose>
  4934.          <xsl:when test="cda:code[@code = &#34;10201-2&#34;]"/>
  4935.          <xsl:otherwise>
  4936.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4937.                <xsl:attribute name="location">
  4938.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4939.                </xsl:attribute>
  4940.                <svrl:text>
  4941.             Erreur de Conformité PCC: Le code de la section 'Mouth, Throat and Teeth' doit être 10200-4
  4942.         </svrl:text>
  4943.             </svrl:failed-assert>
  4944.          </xsl:otherwise>
  4945.       </xsl:choose>
  4946.  
  4947.             <!--ASSERT -->
  4948. <xsl:choose>
  4949.          <xsl:when test="cda:code[@codeSystem = &#34;2.16.840.1.113883.6.1&#34;]"/>
  4950.          <xsl:otherwise>
  4951.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4952.                <xsl:attribute name="location">
  4953.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4954.                </xsl:attribute>
  4955.                <svrl:text>
  4956.             Erreur de Conformité PCC: L'élément 'codeSystem' doit être codé dans la nomenclature LOINC
  4957.             (2.16.840.1.113883.6.1).
  4958.         </svrl:text>
  4959.             </svrl:failed-assert>
  4960.          </xsl:otherwise>
  4961.       </xsl:choose>
  4962.       <xsl:apply-templates select="*" mode="M61"/>
  4963.    </xsl:template>
  4964.    <xsl:template match="text()" priority="-1" mode="M61"/>
  4965.    <xsl:template match="@*|node()" priority="-2" mode="M61">
  4966.       <xsl:apply-templates select="*" mode="M61"/>
  4967.    </xsl:template>
  4968.  
  4969.    <!--PATTERN ACPimageIllustrative-->
  4970.  
  4971.  
  4972.     <!--RULE -->
  4973. <xsl:template match="*[cda:templateId/@root = $templateObservationMedia]" priority="1000"
  4974.                 mode="M62">
  4975.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  4976.                       context="*[cda:templateId/@root = $templateObservationMedia]"/>
  4977.  
  4978.             <!--ASSERT -->
  4979. <xsl:choose>
  4980.          <xsl:when test="../cda:observationMedia[@classCode = 'OBS' and @moodCode = 'EVN' and @ID]"/>
  4981.          <xsl:otherwise>
  4982.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4983.                <xsl:attribute name="location">
  4984.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  4985.                </xsl:attribute>
  4986.                <svrl:text>
  4987.             Erreur de Conformité CI-SIS :
  4988.             Le template d'image illustrative doit apparaître dans un élément observationMedia
  4989.             de classCode 'OBS' et de moodCode 'EVN', et identifié par un attribut ID. </svrl:text>
  4990.             </svrl:failed-assert>
  4991.          </xsl:otherwise>
  4992.       </xsl:choose>
  4993.  
  4994.             <!--ASSERT -->
  4995. <xsl:choose>
  4996.          <xsl:when test="cda:value[(@mediaType = 'image/gif' or @mediaType = 'image/jpeg' or @mediaType = 'image/png') and @representation = 'B64']"/>
  4997.          <xsl:otherwise>
  4998.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  4999.                <xsl:attribute name="location">
  5000.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5001.                </xsl:attribute>
  5002.                <svrl:text>
  5003.             Erreur de Conformité CI-SIS :
  5004.             L'image doit être un gif, un png ou un jpeg, encodé en base 64 dans le sous-élément value. </svrl:text>
  5005.             </svrl:failed-assert>
  5006.          </xsl:otherwise>
  5007.       </xsl:choose>
  5008.       <xsl:apply-templates select="*" mode="M62"/>
  5009.    </xsl:template>
  5010.    <xsl:template match="text()" priority="-1" mode="M62"/>
  5011.    <xsl:template match="@*|node()" priority="-2" mode="M62">
  5012.       <xsl:apply-templates select="*" mode="M62"/>
  5013.    </xsl:template>
  5014.  
  5015.    <!--PATTERN ClinicalStatusCodes-->
  5016.  
  5017.  
  5018.     <!--RULE -->
  5019. <xsl:template match="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.1']/cda:value"
  5020.                 priority="1000"
  5021.                 mode="M63">
  5022.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5023.                       context="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.1']/cda:value"/>
  5024.       <xsl:variable name="att_code" select="@code"/>
  5025.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  5026.       <xsl:variable name="att_displayName" select="@displayName"/>
  5027.  
  5028.             <!--ASSERT -->
  5029. <xsl:choose>
  5030.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  5031.          <xsl:otherwise>
  5032.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5033.                <xsl:attribute name="location">
  5034.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5035.                </xsl:attribute>
  5036.                <svrl:text>
  5037.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  5038.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/entryRelationship/observation/entryRelationship/observation/value"/>
  5039.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  5040.         </svrl:text>
  5041.             </svrl:failed-assert>
  5042.          </xsl:otherwise>
  5043.       </xsl:choose>
  5044.  
  5045.             <!--ASSERT -->
  5046. <xsl:choose>
  5047.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  5048.          <xsl:otherwise>
  5049.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5050.                <xsl:attribute name="location">
  5051.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5052.                </xsl:attribute>
  5053.                <svrl:text>
  5054.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  5055.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/entryRelationship/observation/entryRelationship/observation/value"/>
  5056.                   <xsl:text/>" doit avoir ses attributs
  5057.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  5058.         </svrl:text>
  5059.             </svrl:failed-assert>
  5060.          </xsl:otherwise>
  5061.       </xsl:choose>
  5062.  
  5063.             <!--ASSERT -->
  5064. <xsl:choose>
  5065.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_ClinicalStatusCodes)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  5066.          <xsl:otherwise>
  5067.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5068.                <xsl:attribute name="location">
  5069.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5070.                </xsl:attribute>
  5071.                <svrl:text>
  5072.        
  5073.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  5074.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/entryRelationship/observation/entryRelationship/observation/value"/>
  5075.                   <xsl:text/>
  5076.             [<xsl:text/>
  5077.                   <xsl:value-of select="$att_code"/>
  5078.                   <xsl:text/>:<xsl:text/>
  5079.                   <xsl:value-of select="$att_displayName"/>
  5080.                   <xsl:text/>:<xsl:text/>
  5081.                   <xsl:value-of select="$att_codeSystem"/>
  5082.                   <xsl:text/>]
  5083.             doit faire partie du jeu de valeurs <xsl:text/>
  5084.                   <xsl:value-of select="$jdv_ClinicalStatusCodes"/>
  5085.                   <xsl:text/>.
  5086.         </svrl:text>
  5087.             </svrl:failed-assert>
  5088.          </xsl:otherwise>
  5089.       </xsl:choose>
  5090.       <xsl:apply-templates select="*" mode="M63"/>
  5091.    </xsl:template>
  5092.    <xsl:template match="text()" priority="-1" mode="M63"/>
  5093.    <xsl:template match="@*|node()" priority="-2" mode="M63">
  5094.       <xsl:apply-templates select="*" mode="M63"/>
  5095.    </xsl:template>
  5096.  
  5097.    <!--PATTERN codedAntenatalTestingAndSurveillanceOrg-errorsIHE PCC v3.0 Coded Antenatal Testing and Surveillance Organizer-->
  5098. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Coded Antenatal Testing and Surveillance Organizer</svrl:text>
  5099.  
  5100.       <!--RULE -->
  5101. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.3.10&#34;]"
  5102.                 priority="1000"
  5103.                 mode="M64">
  5104.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5105.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.1.21.3.10&#34;]"/>
  5106.  
  5107.             <!--ASSERT -->
  5108. <xsl:choose>
  5109.          <xsl:when test="../cda:organizer"/>
  5110.          <xsl:otherwise>
  5111.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5112.                <xsl:attribute name="location">
  5113.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5114.                </xsl:attribute>
  5115.                <svrl:text>
  5116.             Erreur de Conformité PCC: 'Conformité PCC v3.0 (Erreur):' ne peut être utilisé que comme organizer.
  5117.         </svrl:text>
  5118.             </svrl:failed-assert>
  5119.          </xsl:otherwise>
  5120.       </xsl:choose>
  5121.  
  5122.             <!--ASSERT -->
  5123. <xsl:choose>
  5124.          <xsl:when test="cda:code[@code=&#34;XX-ANTENATALTESTINGBATTERY&#34; and              @displayName=&#34;ANTENATAL TESTING AND SURVEILLANCE BATTERY&#34; and             @codeSystem=&#34;2.16.840.1.113883.6.1&#34; and             @codeSystemName=&#34;LOINC&#34;]"/>
  5125.          <xsl:otherwise>
  5126.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5127.                <xsl:attribute name="location">
  5128.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5129.                </xsl:attribute>
  5130.                <svrl:text>
  5131.             Erreur de Conformité PCC: L'élément &lt;code&gt; de l'organizer "Antenatal Testing and Surveillance"est requis, et
  5132.             identifie celui-ci comme un organizer contenant des données de test et de surveillance: &lt;code code='XX-ANTENATALTESTINGBATTERY'
  5133.             displayName='ANTENATAL TESTING AND SURVEILLANCE BATTERY' codeSystem='2.16.840.1.113883.6.1' codeSystemName="LOINC"</svrl:text>
  5134.             </svrl:failed-assert>
  5135.          </xsl:otherwise>
  5136.       </xsl:choose>
  5137.  
  5138.             <!--ASSERT -->
  5139. <xsl:choose>
  5140.          <xsl:when test="cda:component/cda:observation/cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.13&#34;]"/>
  5141.          <xsl:otherwise>
  5142.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5143.                <xsl:attribute name="location">
  5144.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5145.                </xsl:attribute>
  5146.                <svrl:text>
  5147.             Erreur de Conformité PCC: L'élément 'Coded Antenatal Testing and Surveillance Organizer' doit
  5148.             au moins contenir une entrée 'Simple Observation' (1.3.6.1.4.1.19376.1.5.3.1.4.13)
  5149.         </svrl:text>
  5150.             </svrl:failed-assert>
  5151.          </xsl:otherwise>
  5152.       </xsl:choose>
  5153.  
  5154.             <!--ASSERT -->
  5155. <xsl:choose>
  5156.          <xsl:when test="cda:id"/>
  5157.          <xsl:otherwise>
  5158.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5159.                <xsl:attribute name="location">
  5160.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5161.                </xsl:attribute>
  5162.                <svrl:text>
  5163.             Erreur de Conformité PCC: "Coded Antenatal Testing and Surveillance Organizer" aura nécessairement un identifiant &lt;id&gt;.
  5164.         </svrl:text>
  5165.             </svrl:failed-assert>
  5166.          </xsl:otherwise>
  5167.       </xsl:choose>
  5168.  
  5169.             <!--ASSERT -->
  5170. <xsl:choose>
  5171.          <xsl:when test="cda:statusCode[@code=&#34;completed&#34;]"/>
  5172.          <xsl:otherwise>
  5173.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5174.                <xsl:attribute name="location">
  5175.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5176.                </xsl:attribute>
  5177.                <svrl:text>
  5178.             Erreur de Conformité PCC: La valeur de l'élément "statusCode" de "Coded Antenatal Testing and Surveillance Organizer" est fixée à "completed".
  5179.         </svrl:text>
  5180.             </svrl:failed-assert>
  5181.          </xsl:otherwise>
  5182.       </xsl:choose>
  5183.  
  5184.             <!--ASSERT -->
  5185. <xsl:choose>
  5186.          <xsl:when test="cda:effectiveTime"/>
  5187.          <xsl:otherwise>
  5188.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5189.                <xsl:attribute name="location">
  5190.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5191.                </xsl:attribute>
  5192.                <svrl:text>
  5193.             Erreur de Conformité PCC: l'élément effectiveTime est requis. Il indique quand l'observation a été faite.
  5194.         </svrl:text>
  5195.             </svrl:failed-assert>
  5196.          </xsl:otherwise>
  5197.       </xsl:choose>
  5198.       <xsl:apply-templates select="*" mode="M64"/>
  5199.    </xsl:template>
  5200.    <xsl:template match="text()" priority="-1" mode="M64"/>
  5201.    <xsl:template match="@*|node()" priority="-2" mode="M64">
  5202.       <xsl:apply-templates select="*" mode="M64"/>
  5203.    </xsl:template>
  5204.  
  5205.    <!--PATTERN codedVitalSignsOrg-errorsIHE PCC v3.0 Vital Signs Organizer-->
  5206. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Vital Signs Organizer</svrl:text>
  5207.  
  5208.       <!--RULE -->
  5209. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.1&#34;]"
  5210.                 priority="1000"
  5211.                 mode="M65">
  5212.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5213.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.1&#34;]"/>
  5214.  
  5215.             <!--ASSERT -->
  5216. <xsl:choose>
  5217.          <xsl:when test="../cda:organizer"/>
  5218.          <xsl:otherwise>
  5219.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5220.                <xsl:attribute name="location">
  5221.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5222.                </xsl:attribute>
  5223.                <svrl:text>
  5224.             Erreur de Conformité PCC: 'Coded physical Exam' ne peut être utilisé que comme section.
  5225.         </svrl:text>
  5226.             </svrl:failed-assert>
  5227.          </xsl:otherwise>
  5228.       </xsl:choose>
  5229.  
  5230.             <!--ASSERT -->
  5231. <xsl:choose>
  5232.          <xsl:when test="cda:code[@code =&#34;F-03400&#34;]"/>
  5233.          <xsl:otherwise>
  5234.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5235.                <xsl:attribute name="location">
  5236.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5237.                </xsl:attribute>
  5238.                <svrl:text>
  5239.             Erreur de Conformité PCC: Le codage de l'élément 'Vital Signs Organizer' doit être 'F-03400'.          
  5240.         </svrl:text>
  5241.             </svrl:failed-assert>
  5242.          </xsl:otherwise>
  5243.       </xsl:choose>
  5244.  
  5245.             <!--ASSERT -->
  5246. <xsl:choose>
  5247.          <xsl:when test="cda:code[@codeSystem =&#34;1.2.250.1.213.2.12&#34;]"/>
  5248.          <xsl:otherwise>
  5249.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5250.                <xsl:attribute name="location">
  5251.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5252.                </xsl:attribute>
  5253.                <svrl:text>
  5254.             Erreur de Conformité PCC: L'attribut 'codeSystem' de l'élément 'Vital Signs Organizer' a pour valeur '1.2.250.1.213.2.12' (SNOMED 3.5)          
  5255.         </svrl:text>
  5256.             </svrl:failed-assert>
  5257.          </xsl:otherwise>
  5258.       </xsl:choose>
  5259.  
  5260.             <!--ASSERT -->
  5261. <xsl:choose>
  5262.          <xsl:when test="cda:templateId[@root = &#34;2.16.840.1.113883.10.20.1.32&#34;]"/>
  5263.          <xsl:otherwise>
  5264.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5265.                <xsl:attribute name="location">
  5266.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5267.                </xsl:attribute>
  5268.                <svrl:text>
  5269.             Erreur de Conformité PCC: L'identifiant du template parent (2.16.840.1.113883.10.20.1.32) doit être présent.
  5270.         </svrl:text>
  5271.             </svrl:failed-assert>
  5272.          </xsl:otherwise>
  5273.       </xsl:choose>
  5274.  
  5275.             <!--ASSERT -->
  5276. <xsl:choose>
  5277.          <xsl:when test="cda:templateId[@root = &#34;2.16.840.1.113883.10.20.1.35&#34;]"/>
  5278.          <xsl:otherwise>
  5279.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5280.                <xsl:attribute name="location">
  5281.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5282.                </xsl:attribute>
  5283.                <svrl:text>
  5284.             Erreur de Conformité PCC: L'identifiant du template parent (2.16.840.1.113883.10.20.1.35) doit être présent.
  5285.         </svrl:text>
  5286.             </svrl:failed-assert>
  5287.          </xsl:otherwise>
  5288.       </xsl:choose>
  5289.  
  5290.             <!--ASSERT -->
  5291. <xsl:choose>
  5292.          <xsl:when test=".//cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.13.2&#34;]"/>
  5293.          <xsl:otherwise>
  5294.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5295.                <xsl:attribute name="location">
  5296.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5297.                </xsl:attribute>
  5298.                <svrl:text>
  5299.             Erreur de Conformité PCC: L'élément 'Vital Sign Organizer' doit au moins contenir une entrée 'Vital Sign Observation'
  5300.         </svrl:text>
  5301.             </svrl:failed-assert>
  5302.          </xsl:otherwise>
  5303.       </xsl:choose>
  5304.       <xsl:apply-templates select="*" mode="M65"/>
  5305.    </xsl:template>
  5306.    <xsl:template match="text()" priority="-1" mode="M65"/>
  5307.    <xsl:template match="@*|node()" priority="-2" mode="M65">
  5308.       <xsl:apply-templates select="*" mode="M65"/>
  5309.    </xsl:template>
  5310.  
  5311.    <!--PATTERN comments-errorsIHE PCC v3.0 Comments - errors validation phase-->
  5312. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Comments - errors validation phase</svrl:text>
  5313.  
  5314.       <!--RULE -->
  5315. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.2&#34;]" priority="1000"
  5316.                 mode="M66">
  5317.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5318.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.2&#34;]"/>
  5319.  
  5320.             <!--ASSERT -->
  5321. <xsl:choose>
  5322.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.40&#34;]"/>
  5323.          <xsl:otherwise>
  5324.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5325.                <xsl:attribute name="location">
  5326.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5327.                </xsl:attribute>
  5328.                <svrl:text>
  5329.                 Erreur de Conformité PCC: Le templateId CCD (2.16.840.1.113883.10.20.1.40) de l'entrée
  5330.                 Comments doit être déclaré.</svrl:text>
  5331.             </svrl:failed-assert>
  5332.          </xsl:otherwise>
  5333.       </xsl:choose>
  5334.  
  5335.             <!--ASSERT -->
  5336. <xsl:choose>
  5337.          <xsl:when test="cda:code[@code=&#34;48767-8&#34; and                 @codeSystem=&#34;2.16.840.1.113883.6.1&#34;]"/>
  5338.          <xsl:otherwise>
  5339.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5340.                <xsl:attribute name="location">
  5341.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5342.                </xsl:attribute>
  5343.                <svrl:text>
  5344.                 Erreur de Conformité PCC: L'élément "code" pour l'entrée "Comments" est requis. Ses attributs "code" et "codeSystem"
  5345.                 sont obligatoires (cf. CI-SIS Volet de contenu CDA)</svrl:text>
  5346.             </svrl:failed-assert>
  5347.          </xsl:otherwise>
  5348.       </xsl:choose>
  5349.  
  5350.             <!--ASSERT -->
  5351. <xsl:choose>
  5352.          <xsl:when test="cda:statusCode[@code = &#34;completed&#34;]"/>
  5353.          <xsl:otherwise>
  5354.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5355.                <xsl:attribute name="location">
  5356.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5357.                </xsl:attribute>
  5358.                <svrl:text>
  5359.             Erreur de Conformité PCC: La valeur de l'élément "code" de "statusCode" est toujours fixée à "completed". </svrl:text>
  5360.             </svrl:failed-assert>
  5361.          </xsl:otherwise>
  5362.       </xsl:choose>
  5363.  
  5364.             <!--ASSERT -->
  5365. <xsl:choose>
  5366.          <xsl:when test="not(cda:author) or (                 cda:author/cda:time and                 cda:author/cda:assignedAuthor/cda:id and                 cda:author/cda:assignedAuthor/cda:addr and                 cda:author/cda:assignedAuthor/cda:telecom and                 cda:author/cda:assignedAuthor/cda:assignedPerson/cda:name and                 cda:author/cda:assignedAuthor/cda:representedOrganization/cda:name)"/>
  5367.          <xsl:otherwise>
  5368.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5369.                <xsl:attribute name="location">
  5370.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5371.                </xsl:attribute>
  5372.                <svrl:text>
  5373.                 Erreur de Conformité PCC: Un élément "Comment" peut avoir un auteur.
  5374.                 L'horodatage de la création de l'élément "Comment" est réalisé à partir de l'élément "time" lorsque l'élément "author" est présent.
  5375.                 L'identifiant de l'auteur (id), son adresse (addr) et son numéro de téléphone (telecom) sont dans ce cas obligatoires.
  5376.                 Le nom de l'auteur et/ou celui de l'organisation qu'il représente doit être présent.</svrl:text>
  5377.             </svrl:failed-assert>
  5378.          </xsl:otherwise>
  5379.       </xsl:choose>
  5380.       <xsl:apply-templates select="*" mode="M66"/>
  5381.    </xsl:template>
  5382.    <xsl:template match="text()" priority="-1" mode="M66"/>
  5383.    <xsl:template match="@*|node()" priority="-2" mode="M66">
  5384.       <xsl:apply-templates select="*" mode="M66"/>
  5385.    </xsl:template>
  5386.  
  5387.    <!--PATTERN concernEntry-errorsIHE PCC v3.0 Concern Entry-->
  5388. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Concern Entry</svrl:text>
  5389.  
  5390.       <!--RULE -->
  5391. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.1&#34;]"
  5392.                 priority="1000"
  5393.                 mode="M67">
  5394.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5395.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.1&#34;]"/>
  5396.  
  5397.             <!--ASSERT -->
  5398. <xsl:choose>
  5399.          <xsl:when test="../cda:act"/>
  5400.          <xsl:otherwise>
  5401.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5402.                <xsl:attribute name="location">
  5403.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5404.                </xsl:attribute>
  5405.                <svrl:text>
  5406.             Erreur de Conformité PCC: L'entrée "Concern Entry" ne peut être utilisée que comme un élément "act".</svrl:text>
  5407.             </svrl:failed-assert>
  5408.          </xsl:otherwise>
  5409.       </xsl:choose>
  5410.  
  5411.             <!--ASSERT -->
  5412. <xsl:choose>
  5413.          <xsl:when test="../cda:act[@classCode=&#34;ACT&#34;] and ../cda:act[@moodCode=&#34;EVN&#34;]"/>
  5414.          <xsl:otherwise>
  5415.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5416.                <xsl:attribute name="location">
  5417.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5418.                </xsl:attribute>
  5419.                <svrl:text>
  5420.                 Erreur de Conformité PCC: une entrée "Concern Entry" est l'acte ("act classCode='ACT'") qui consiste
  5421.                 à enregistrer un événement (moodCode='EVN') relatif à un problème, une allergie ou tout autre élément se rapportant
  5422.                 à l'état clinique d'un patient.</svrl:text>
  5423.             </svrl:failed-assert>
  5424.          </xsl:otherwise>
  5425.       </xsl:choose>
  5426.  
  5427.             <!--ASSERT -->
  5428. <xsl:choose>
  5429.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.27&#34;]"/>
  5430.          <xsl:otherwise>
  5431.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5432.                <xsl:attribute name="location">
  5433.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5434.                </xsl:attribute>
  5435.                <svrl:text>
  5436.                 Erreur de Conformité PCC: Ces élément templateId indiquent que l'entrée "Concern Entry" se conforme
  5437.                 au module de contenu Concern. Celui-ci hérite des contraintes du template HL7 CCD pour les "problem acts",
  5438.                 et déclarera sa conformité à patir du templateId 2.16.840.1.113883.10.20.1.27.</svrl:text>
  5439.             </svrl:failed-assert>
  5440.          </xsl:otherwise>
  5441.       </xsl:choose>
  5442.  
  5443.             <!--ASSERT -->
  5444. <xsl:choose>
  5445.          <xsl:when test="cda:id"/>
  5446.          <xsl:otherwise>
  5447.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5448.                <xsl:attribute name="location">
  5449.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5450.                </xsl:attribute>
  5451.                <svrl:text>
  5452.                 Erreur de Conformité PCC: L'entrée "Concern Entry" requiert un élément "id".</svrl:text>
  5453.             </svrl:failed-assert>
  5454.          </xsl:otherwise>
  5455.       </xsl:choose>
  5456.  
  5457.             <!--ASSERT -->
  5458. <xsl:choose>
  5459.          <xsl:when test="cda:code[@nullFlavor=&#34;NAV&#34;]"/>
  5460.          <xsl:otherwise>
  5461.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5462.                <xsl:attribute name="location">
  5463.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5464.                </xsl:attribute>
  5465.                <svrl:text>
  5466.                 Erreur de Conformité PCC: l'élément "code" n'est pas applicable à un élément "Concern Entry", et prendra la valeur nullFlavor='NAV'.</svrl:text>
  5467.             </svrl:failed-assert>
  5468.          </xsl:otherwise>
  5469.       </xsl:choose>
  5470.  
  5471.             <!--ASSERT -->
  5472. <xsl:choose>
  5473.          <xsl:when test="cda:statusCode[@code=&#34;active&#34; or                  @code=&#34;suspended&#34; or                 @code=&#34;aborted&#34; or                 @code=&#34;completed&#34;]"/>
  5474.          <xsl:otherwise>
  5475.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5476.                <xsl:attribute name="location">
  5477.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5478.                </xsl:attribute>
  5479.                <svrl:text>
  5480.                 Erreur de Conformité PCC: L'élément "statusCode" associé à tout élément concern doit prendre l'une des valeurs suivantes:
  5481.                 "active", "suspended", "aborted" ou "completed".</svrl:text>
  5482.             </svrl:failed-assert>
  5483.          </xsl:otherwise>
  5484.       </xsl:choose>
  5485.  
  5486.             <!--ASSERT -->
  5487. <xsl:choose>
  5488.          <xsl:when test="cda:effectiveTime/cda:low"/>
  5489.          <xsl:otherwise>
  5490.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5491.                <xsl:attribute name="location">
  5492.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5493.                </xsl:attribute>
  5494.                <svrl:text>
  5495.                 Erreur de Conformité PCC: l'élément "effectiveTime" indiquele début et la fin de la période durant laquelle l'élément "Concern Entry" était actif.
  5496.                 Son composant "low" sera au moins présent.</svrl:text>
  5497.             </svrl:failed-assert>
  5498.          </xsl:otherwise>
  5499.       </xsl:choose>
  5500.  
  5501.             <!--ASSERT -->
  5502. <xsl:choose>
  5503.          <xsl:when test="(cda:statusCode[@code=&#34;completed&#34; or @code=&#34;aborted&#34;] and cda:effectiveTime/cda:high) or                 (cda:statusCode[@code=&#34;active&#34; or @code=&#34;suspended&#34;] and not(cda:effectiveTime/cda:high))"/>
  5504.          <xsl:otherwise>
  5505.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5506.                <xsl:attribute name="location">
  5507.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5508.                </xsl:attribute>
  5509.                <svrl:text>
  5510.                 Erreur de Conformité PCC: l'élément "effectiveTime" indiquele début et la fin de la période durant laquelle l'élément
  5511.                 "Concern Entry" était actif.
  5512.                 Son composant "high" sera présent pour les es éléments "Concern entry" ayant un statut "completed" ou "aborted"
  5513.                 et sera absent dans tous les autres cas</svrl:text>
  5514.             </svrl:failed-assert>
  5515.          </xsl:otherwise>
  5516.       </xsl:choose>
  5517.  
  5518.             <!--ASSERT -->
  5519. <xsl:choose>
  5520.          <xsl:when test="(cda:entryRelationship[@typeCode=&#34;SUBJ&#34;] and cda:entryRelationship/*/cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5&#34; or @root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.6&#34;]) or                   (cda:sourceOf[@typeCode=&#34;SUBJ&#34; and @inversionInd=&#34;false&#34;] and cda:sourceOf/*/cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5&#34; or @root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.6&#34;]) "/>
  5521.          <xsl:otherwise>
  5522.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5523.                <xsl:attribute name="location">
  5524.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5525.                </xsl:attribute>
  5526.                <svrl:text>
  5527.                 Erreur de Conformité PCC: Tout élément "Concern Entry" concerne un ou plusieurs problèmes ou allergies.
  5528.                 Cette entrée contient une ou plusieurs entrées qui se conforment aux spécifications de "Problem Entry" ou "Allergies and Intolerance Entry"
  5529.                 permettant à une série d'observations d'être regroupées en un unique élément "Concern Entry", ce à partir de liens de type entryRelationship
  5530.                 d'attribut typeCode='SUBJ' et inversionInd='false'</svrl:text>
  5531.             </svrl:failed-assert>
  5532.          </xsl:otherwise>
  5533.       </xsl:choose>
  5534.       <xsl:apply-templates select="*" mode="M67"/>
  5535.    </xsl:template>
  5536.    <xsl:template match="text()" priority="-1" mode="M67"/>
  5537.    <xsl:template match="@*|node()" priority="-2" mode="M67">
  5538.       <xsl:apply-templates select="*" mode="M67"/>
  5539.    </xsl:template>
  5540.  
  5541.    <!--PATTERN encountersEntry-errorsIHE PCC v3.0 Encounters - errors validation phase-->
  5542. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Encounters - errors validation phase</svrl:text>
  5543.  
  5544.       <!--RULE -->
  5545. <xsl:template match="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.14']"
  5546.                 priority="1000"
  5547.                 mode="M68">
  5548.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5549.                       context="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.14']"/>
  5550.  
  5551.             <!--ASSERT -->
  5552. <xsl:choose>
  5553.          <xsl:when test="@classCode='ENC'"/>
  5554.          <xsl:otherwise>
  5555.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5556.                <xsl:attribute name="location">
  5557.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5558.                </xsl:attribute>
  5559.                <svrl:text>
  5560.             Erreur de Conformité PCC: Dans une entrée "Encounters", l'attribut "classCode" sera fixé à la valeur "ENC". </svrl:text>
  5561.             </svrl:failed-assert>
  5562.          </xsl:otherwise>
  5563.       </xsl:choose>
  5564.  
  5565.             <!--ASSERT -->
  5566. <xsl:choose>
  5567.          <xsl:when test="not(@moodCode='EVN') or cda:templateId[@root='2.16.840.1.113883.10.20.1.21']"/>
  5568.          <xsl:otherwise>
  5569.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5570.                <xsl:attribute name="location">
  5571.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5572.                </xsl:attribute>
  5573.                <svrl:text>
  5574.             Erreur de Conformité PCC: Dans une entrée "Encounters", le templateId indique que cet élément
  5575.             se conforme aux contraintes de ce module de contenu.
  5576.             NOTE: Lorsque l'entrée "Encounters",est en mode événement, (moodCode='EVN'), cette entrée
  5577.             se conforme au template CCD 2.16.840.1.113883.10.20.1.21, et dans les autres modes,
  5578.             elle se conformera au template CCD 2.16.840.1.113883.10.20.1.25. </svrl:text>
  5579.             </svrl:failed-assert>
  5580.          </xsl:otherwise>
  5581.       </xsl:choose>
  5582.  
  5583.             <!--ASSERT -->
  5584. <xsl:choose>
  5585.          <xsl:when test="@moodCode='EVN' or cda:templateId[@root='2.16.840.1.113883.10.20.1.25']"/>
  5586.          <xsl:otherwise>
  5587.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5588.                <xsl:attribute name="location">
  5589.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5590.                </xsl:attribute>
  5591.                <svrl:text>
  5592.             Erreur de Conformité PCC: Dans une entrée "Encounters", le templateId indique que cet élément
  5593.             se conforme aux contraintes de ce module de contenu.
  5594.             NOTE: Lorsque l'entrée "Encounters",est en mode événement, (moodCode='EVN'), cette entrée
  5595.             se conforme au template CCD 2.16.840.1.113883.10.20.1.21, et dans les autres modes,
  5596.             elle se conformera au template CCD 2.16.840.1.113883.10.20.1.25. </svrl:text>
  5597.             </svrl:failed-assert>
  5598.          </xsl:otherwise>
  5599.       </xsl:choose>
  5600.  
  5601.             <!--ASSERT -->
  5602. <xsl:choose>
  5603.          <xsl:when test="cda:id"/>
  5604.          <xsl:otherwise>
  5605.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5606.                <xsl:attribute name="location">
  5607.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5608.                </xsl:attribute>
  5609.                <svrl:text>
  5610.         Erreur de Conformité PCC: Dans une entrée "Encounters", l'élément "id" est obligatoire. </svrl:text>
  5611.             </svrl:failed-assert>
  5612.          </xsl:otherwise>
  5613.       </xsl:choose>
  5614.  
  5615.             <!--ASSERT -->
  5616. <xsl:choose>
  5617.          <xsl:when test="cda:text/cda:reference"/>
  5618.          <xsl:otherwise>
  5619.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5620.                <xsl:attribute name="location">
  5621.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5622.                </xsl:attribute>
  5623.                <svrl:text>
  5624.             Erreur de Conformité PCC: Dans une entrée "Encounters", l'élément "text" contiendra
  5625.             une référence à la partie narrative décrivant l'événement. </svrl:text>
  5626.             </svrl:failed-assert>
  5627.          </xsl:otherwise>
  5628.       </xsl:choose>
  5629.  
  5630.             <!--ASSERT -->
  5631. <xsl:choose>
  5632.          <xsl:when test="not(@moodCode = 'EVN' or @moodCode = 'APT') or cda:effectiveTime"/>
  5633.          <xsl:otherwise>
  5634.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5635.                <xsl:attribute name="location">
  5636.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5637.                </xsl:attribute>
  5638.                <svrl:text>
  5639.             Erreur de Conformité PCC: Dans une entrée "Encounters", l'élément "effectiveTime"
  5640.             horodate l'événement (en mode EVN), ou la date désirée pour la rencontre, en mode ARQ or APT.
  5641.             En mode EVN ou APT, l'élément "effectiveTime" sera présent. En mode ARQ, l'élément "effectiveTime"
  5642.             pourra être présent, et dans le cas contraire, l'élément "priorityCode" sera présent,
  5643.             pour indiquer qu'un rappel est nécessaire pour fixer la date de rendez-vous pour la rencontre. </svrl:text>
  5644.             </svrl:failed-assert>
  5645.          </xsl:otherwise>
  5646.       </xsl:choose>
  5647.  
  5648.             <!--ASSERT -->
  5649. <xsl:choose>
  5650.          <xsl:when test="@moodCode='ARQ' and (cda:effectiveTime or cda:priorityCode)"/>
  5651.          <xsl:otherwise>
  5652.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5653.                <xsl:attribute name="location">
  5654.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5655.                </xsl:attribute>
  5656.                <svrl:text>
  5657.             Erreur de Conformité PCC: Dans une entrée "Encounters", en mode ARQ mood, si l'élément "effectiveTime" est absent,
  5658.             alors l'élément "priorityCode" sera présent. </svrl:text>
  5659.             </svrl:failed-assert>
  5660.          </xsl:otherwise>
  5661.       </xsl:choose>
  5662.  
  5663.             <!--ASSERT -->
  5664. <xsl:choose>
  5665.          <xsl:when test="not(cda:participant[@typeCode='LOC']) or                  cda:participant[@typeCode='LOC']/cda:participantRole[@classCode='SDLOC']"/>
  5666.          <xsl:otherwise>
  5667.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5668.                <xsl:attribute name="location">
  5669.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5670.                </xsl:attribute>
  5671.                <svrl:text>
  5672.             Erreur de Conformité PCC: Dans une entrée "Encounters", un élément "participant" avec un attribut "typeCode"
  5673.             LOC pourra être présent pour donner l'indication sur le lieu où la rencontre doit ou s'est tenue.
  5674.             Cet élément aura un élément "participantRole" d'attribut classCode='SDLOC' décrivant la localisation du service. </svrl:text>
  5675.             </svrl:failed-assert>
  5676.          </xsl:otherwise>
  5677.       </xsl:choose>
  5678.  
  5679.             <!--ASSERT -->
  5680. <xsl:choose>
  5681.          <xsl:when test="not(cda:particpant[@typeCode='LOC']) or                 cda:participant[@typeCode='LOC']/cda:playingEntity/cda:name"/>
  5682.          <xsl:otherwise>
  5683.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5684.                <xsl:attribute name="location">
  5685.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5686.                </xsl:attribute>
  5687.                <svrl:text>
  5688.             Erreur de Conformité PCC: Dans une entrée "Encounters", un élément "participant" d'attribut "typeCode='LOC'"
  5689.             désignera un élément "playingEntity" avec son nom. </svrl:text>
  5690.             </svrl:failed-assert>
  5691.          </xsl:otherwise>
  5692.       </xsl:choose>
  5693.  
  5694.             <!--ASSERT -->
  5695. <xsl:choose>
  5696.          <xsl:when test="not(@moodCode='ARQ') or cda:effectiveTime"/>
  5697.          <xsl:otherwise>
  5698.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5699.                <xsl:attribute name="location">
  5700.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5701.                </xsl:attribute>
  5702.                <svrl:text>
  5703.             Erreur de Conformité PCC (alerte): Dans une entrée "Encounters", en mode ARQ,
  5704.             l'élément "effectiveTime" doit être présent. </svrl:text>
  5705.             </svrl:failed-assert>
  5706.          </xsl:otherwise>
  5707.       </xsl:choose>
  5708.  
  5709.             <!--ASSERT -->
  5710. <xsl:choose>
  5711.          <xsl:when test="not(@moodCode='EVN') or cda:performer"/>
  5712.          <xsl:otherwise>
  5713.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5714.                <xsl:attribute name="location">
  5715.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5716.                </xsl:attribute>
  5717.                <svrl:text>
  5718.             Erreur de Conformité PCC (alerte): Dans une entrée "Encounters", en mode EVN mood, au moisn
  5719.             un élément "performer" devrait être présentpour identifier la personne délivrant un service (soins, consultation...)
  5720.             durant la rencontre. Plus d'un élément "performer" pourront être présents. </svrl:text>
  5721.             </svrl:failed-assert>
  5722.          </xsl:otherwise>
  5723.       </xsl:choose>
  5724.  
  5725.             <!--ASSERT -->
  5726. <xsl:choose>
  5727.          <xsl:when test="not(cda:particpant[@typeCode='LOC']) or                 cda:participant[@typeCode='LOC']/cda:addr"/>
  5728.          <xsl:otherwise>
  5729.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5730.                <xsl:attribute name="location">
  5731.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5732.                </xsl:attribute>
  5733.                <svrl:text>
  5734.             Erreur de Conformité PCC (alerte): Dans une entrée "Encounters", un élément "addr" devrait être présent
  5735.             comme partie de l'élément "participant" d'attribut "typeCode='LOC'". </svrl:text>
  5736.             </svrl:failed-assert>
  5737.          </xsl:otherwise>
  5738.       </xsl:choose>
  5739.  
  5740.             <!--ASSERT -->
  5741. <xsl:choose>
  5742.          <xsl:when test="not(cda:particpant[@typeCode='LOC']) or                 cda:participant[@typeCode='LOC']/cda:telecom"/>
  5743.          <xsl:otherwise>
  5744.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5745.                <xsl:attribute name="location">
  5746.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5747.                </xsl:attribute>
  5748.                <svrl:text>
  5749.             Erreur de Conformité PCC (alerte): Dans une entrée "Encounters", un élément "telecom" devrait être présent
  5750.             comme partie de l'élément "participant" d'attribut "typeCode='LOC'". </svrl:text>
  5751.             </svrl:failed-assert>
  5752.          </xsl:otherwise>
  5753.       </xsl:choose>
  5754.       <xsl:apply-templates select="*" mode="M68"/>
  5755.    </xsl:template>
  5756.    <xsl:template match="text()" priority="-1" mode="M68"/>
  5757.    <xsl:template match="@*|node()" priority="-2" mode="M68">
  5758.       <xsl:apply-templates select="*" mode="M68"/>
  5759.    </xsl:template>
  5760.  
  5761.    <!--PATTERN HealthStatusCodes-->
  5762.  
  5763.  
  5764.     <!--RULE -->
  5765. <xsl:template match="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.2']/cda:value"
  5766.                 priority="1000"
  5767.                 mode="M69">
  5768.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5769.                       context="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.2']/cda:value"/>
  5770.       <xsl:variable name="att_code" select="@code"/>
  5771.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  5772.       <xsl:variable name="att_displayName" select="@displayName"/>
  5773.  
  5774.             <!--ASSERT -->
  5775. <xsl:choose>
  5776.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  5777.          <xsl:otherwise>
  5778.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5779.                <xsl:attribute name="location">
  5780.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5781.                </xsl:attribute>
  5782.                <svrl:text>
  5783.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  5784.                   <xsl:value-of select="entryRelationship/observation/value"/>
  5785.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  5786.         </svrl:text>
  5787.             </svrl:failed-assert>
  5788.          </xsl:otherwise>
  5789.       </xsl:choose>
  5790.  
  5791.             <!--ASSERT -->
  5792. <xsl:choose>
  5793.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  5794.          <xsl:otherwise>
  5795.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5796.                <xsl:attribute name="location">
  5797.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5798.                </xsl:attribute>
  5799.                <svrl:text>
  5800.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  5801.                   <xsl:value-of select="entryRelationship/observation/value"/>
  5802.                   <xsl:text/>" doit avoir ses attributs
  5803.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  5804.         </svrl:text>
  5805.             </svrl:failed-assert>
  5806.          </xsl:otherwise>
  5807.       </xsl:choose>
  5808.  
  5809.             <!--ASSERT -->
  5810. <xsl:choose>
  5811.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_HealthStatusCodes)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  5812.          <xsl:otherwise>
  5813.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5814.                <xsl:attribute name="location">
  5815.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5816.                </xsl:attribute>
  5817.                <svrl:text>
  5818.        
  5819.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  5820.                   <xsl:value-of select="entryRelationship/observation/value"/>
  5821.                   <xsl:text/>
  5822.             [<xsl:text/>
  5823.                   <xsl:value-of select="$att_code"/>
  5824.                   <xsl:text/>:<xsl:text/>
  5825.                   <xsl:value-of select="$att_displayName"/>
  5826.                   <xsl:text/>:<xsl:text/>
  5827.                   <xsl:value-of select="$att_codeSystem"/>
  5828.                   <xsl:text/>]
  5829.             doit faire partie du jeu de valeurs <xsl:text/>
  5830.                   <xsl:value-of select="$jdv_HealthStatusCodes"/>
  5831.                   <xsl:text/>.
  5832.         </svrl:text>
  5833.             </svrl:failed-assert>
  5834.          </xsl:otherwise>
  5835.       </xsl:choose>
  5836.       <xsl:apply-templates select="*" mode="M69"/>
  5837.    </xsl:template>
  5838.    <xsl:template match="text()" priority="-1" mode="M69"/>
  5839.    <xsl:template match="@*|node()" priority="-2" mode="M69">
  5840.       <xsl:apply-templates select="*" mode="M69"/>
  5841.    </xsl:template>
  5842.  
  5843.    <!--PATTERN immunizationsEnt-errorsIHE PCC v3.0 Immunizations Section-->
  5844. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Immunizations Section</svrl:text>
  5845.  
  5846.       <!--RULE -->
  5847. <xsl:template match="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.12']"
  5848.                 priority="1000"
  5849.                 mode="M70">
  5850.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  5851.                       context="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.12']"/>
  5852.  
  5853.             <!--ASSERT -->
  5854. <xsl:choose>
  5855.          <xsl:when test="@negationInd=&#34;true&#34; or @negationInd=&#34;false&#34;"/>
  5856.          <xsl:otherwise>
  5857.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5858.                <xsl:attribute name="location">
  5859.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5860.                </xsl:attribute>
  5861.                <svrl:text>
  5862.             Erreur de Conformité PCC:
  5863.             Une entrée 'Immunization' peut être le moyen de notifier qu'une vaccination spécifique n'a pas eu lieu, et pourquoi.
  5864.             Dans ce cas, l'attribut negationInd prendra la valeur 'true' et dans tous les autres cas la valeur 'false'.
  5865.         </svrl:text>
  5866.             </svrl:failed-assert>
  5867.          </xsl:otherwise>
  5868.       </xsl:choose>
  5869.  
  5870.             <!--ASSERT -->
  5871. <xsl:choose>
  5872.          <xsl:when test="cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.24&#34;]"/>
  5873.          <xsl:otherwise>
  5874.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5875.                <xsl:attribute name="location">
  5876.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5877.                </xsl:attribute>
  5878.                <svrl:text>
  5879.             Erreur de Conformité PCC: Immunization doit notifier l'OID du template CCD parent (2.16.840.1.113883.10.20.1.24).
  5880.         </svrl:text>
  5881.             </svrl:failed-assert>
  5882.          </xsl:otherwise>
  5883.       </xsl:choose>
  5884.  
  5885.             <!--ASSERT -->
  5886. <xsl:choose>
  5887.          <xsl:when test="cda:id"/>
  5888.          <xsl:otherwise>
  5889.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5890.                <xsl:attribute name="location">
  5891.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5892.                </xsl:attribute>
  5893.                <svrl:text>
  5894.             Erreur de Conformité PCC: Une vaccination aura un identifiant (id).
  5895.         </svrl:text>
  5896.             </svrl:failed-assert>
  5897.          </xsl:otherwise>
  5898.       </xsl:choose>
  5899.  
  5900.             <!--ASSERT -->
  5901. <xsl:choose>
  5902.          <xsl:when test="cda:code[@code and @codeSystem]"/>
  5903.          <xsl:otherwise>
  5904.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5905.                <xsl:attribute name="location">
  5906.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5907.                </xsl:attribute>
  5908.                <svrl:text>
  5909.             Erreur de Conformité PCC:
  5910.             Cet élément obligatoire indique que l'acte effectué est une vaccination.
  5911.             L'élément act substance administration doit présenter un élément 'code' avec des attributs 'code' et 'codeSystem' obligatoirement présents.
  5912.             Si aucun système de codage est utilisé, on utilisera les valeurs code='IMMUNIZ' codeSystem='2.16.840.1.113883.5.4' codeSystemName='ActCode'
  5913.         </svrl:text>
  5914.             </svrl:failed-assert>
  5915.          </xsl:otherwise>
  5916.       </xsl:choose>
  5917.  
  5918.             <!--ASSERT -->
  5919. <xsl:choose>
  5920.          <xsl:when test="cda:statusCode[@code=&#34;completed&#34;]"/>
  5921.          <xsl:otherwise>
  5922.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5923.                <xsl:attribute name="location">
  5924.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5925.                </xsl:attribute>
  5926.                <svrl:text>
  5927.             Erreur de Conformité PCC: L'élément 'statusCode' prendra la valeur 'completed' pour toutes les vaccinations.
  5928.         </svrl:text>
  5929.             </svrl:failed-assert>
  5930.          </xsl:otherwise>
  5931.       </xsl:choose>
  5932.  
  5933.             <!--ASSERT -->
  5934. <xsl:choose>
  5935.          <xsl:when test="cda:effectiveTime[@value or @nullFlavor]"/>
  5936.          <xsl:otherwise>
  5937.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5938.                <xsl:attribute name="location">
  5939.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5940.                </xsl:attribute>
  5941.                <svrl:text>
  5942.             Erreur de Conformité PCC:
  5943.            
  5944.             Dans Immunizations, l'élément 'effectiveTime' sera obligatoirement présent, indiquant l'horodatage de la vaccination.
  5945.             Si la date est inconnue, l'attribut nullFlavor sera utilisé.
  5946.         </svrl:text>
  5947.             </svrl:failed-assert>
  5948.          </xsl:otherwise>
  5949.       </xsl:choose>
  5950.  
  5951.             <!--ASSERT -->
  5952. <xsl:choose>
  5953.          <xsl:when test="cda:consumable//cda:manufacturedProduct//cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.7.2&#34;]"/>
  5954.          <xsl:otherwise>
  5955.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5956.                <xsl:attribute name="location">
  5957.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5958.                </xsl:attribute>
  5959.                <svrl:text>
  5960.             Erreur de Conformité PCC:
  5961.             Dans 'Immunizations', l'élément 'consumable' sera présent, and contiendra une entrée 'manufacturedProduc' se conformant au
  5962.             template 'Product Entry template' (1.3.6.1.4.1.19376.1.5.3.1.4.7.2).
  5963.         </svrl:text>
  5964.             </svrl:failed-assert>
  5965.          </xsl:otherwise>
  5966.       </xsl:choose>
  5967.  
  5968.             <!--ASSERT -->
  5969. <xsl:choose>
  5970.          <xsl:when test="not(cda:entryRelationship[@inversionInd=&#34;false&#34; and @typeCode=&#34;CAUS&#34;]) or             (cda:entryRelationship[@inversionInd=&#34;false&#34; and @typeCode=&#34;CAUS&#34;]//cda:observation/cda:id and             cda:entryRelationship[@inversionInd=&#34;false&#34; and @typeCode=&#34;CAUS&#34;]//cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.28&#34;] and             cda:entryRelationship[@inversionInd=&#34;false&#34; and @typeCode=&#34;CAUS&#34;]//cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5&#34;] and             cda:entryRelationship[@inversionInd=&#34;false&#34; and @typeCode=&#34;CAUS&#34;]//cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.54&#34;])"/>
  5971.          <xsl:otherwise>
  5972.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5973.                <xsl:attribute name="location">
  5974.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5975.                </xsl:attribute>
  5976.                <svrl:text>  
  5977.             Erreur de Conformité PCC:
  5978.             Dans 'Immunizations', un élément entryRelationship pourra être utilisé pour identifier d'éventuelles réactions adverses
  5979.             causées par la vaccination.
  5980.             Dans ce cas l'identifiant (id) de l'observation est requis.
  5981.             L'observation se conformara au template 'Problem Entry', ainsi qu'au template 'CCD Reaction'.
  5982.  
  5983.         </svrl:text>
  5984.             </svrl:failed-assert>
  5985.          </xsl:otherwise>
  5986.       </xsl:choose>
  5987.  
  5988.             <!--ASSERT -->
  5989. <xsl:choose>
  5990.          <xsl:when test="cda:entryRelationship/cda:observation/cda:code[@code=&#34;30973-2&#34; and @codeSystem=&#34;2.16.840.1.113883.6.1&#34;]"/>
  5991.          <xsl:otherwise>
  5992.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  5993.                <xsl:attribute name="location">
  5994.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  5995.                </xsl:attribute>
  5996.                <svrl:text>
  5997.             Erreur de Conformité PCC:
  5998.             dans l'élément entryRelationship permettant d'assigner le rang de la vaccination
  5999.             dans une série de vaccinations effectuée (1ère vaccination, deuxième, etc), l'élément 'code' sera présent et ses
  6000.             attributs prendront les valeurs (code='30973-2' displayName='Dose Number' codeSystem='2.16.840.1.113883.6.1' codeSystemName='LOINC')
  6001.             Cet élément indique que l'observation concerne le rand de la vaccination.
  6002.         </svrl:text>
  6003.             </svrl:failed-assert>
  6004.          </xsl:otherwise>
  6005.       </xsl:choose>
  6006.  
  6007.             <!--ASSERT -->
  6008. <xsl:choose>
  6009.          <xsl:when test="not(ancestor::*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.12&#34;]) or              cda:statusCode[@code=&#34;completed&#34;]"/>
  6010.          <xsl:otherwise>
  6011.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6012.                <xsl:attribute name="location">
  6013.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6014.                </xsl:attribute>
  6015.                <svrl:text>
  6016.             Erreur de Conformité PCC:
  6017.             dans l'élément entryRelationship permettant d'assigner le rang de la vaccination
  6018.             dans une série de vaccinations effectuée (1ère vaccination, deuxième, etc), l'élément 'statusCode', obligatoire,
  6019.             prendra la valeur 'completed'.
  6020.         </svrl:text>
  6021.             </svrl:failed-assert>
  6022.          </xsl:otherwise>
  6023.       </xsl:choose>
  6024.  
  6025.             <!--ASSERT -->
  6026. <xsl:choose>
  6027.          <xsl:when test="cda:entryRelationship/cda:observation/cda:value[@value]"/>
  6028.          <xsl:otherwise>
  6029.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6030.                <xsl:attribute name="location">
  6031.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6032.                </xsl:attribute>
  6033.                <svrl:text>
  6034.             Erreur de Conformité PCC:
  6035.             Dans une entrée 'Immunization', dans l'élément entryRelationship permettant d'assigner le rang de la vaccination
  6036.             dans une série de vaccinations effectuée (1ère vaccination, deuxième, etc), l'élément 'value' sera présent et
  6037.             indiquera le numéro de lot du vaccin.
  6038.         </svrl:text>
  6039.             </svrl:failed-assert>
  6040.          </xsl:otherwise>
  6041.       </xsl:choose>
  6042.       <xsl:apply-templates select="*" mode="M70"/>
  6043.    </xsl:template>
  6044.    <xsl:template match="text()" priority="-1" mode="M70"/>
  6045.    <xsl:template match="@*|node()" priority="-2" mode="M70">
  6046.       <xsl:apply-templates select="*" mode="M70"/>
  6047.    </xsl:template>
  6048.  
  6049.    <!--PATTERN observationInterpretation-->
  6050.  
  6051.  
  6052.     <!--RULE -->
  6053. <xsl:template match="cda:observation/cda:interpretationCode" priority="1000" mode="M71">
  6054.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6055.                       context="cda:observation/cda:interpretationCode"/>
  6056.       <xsl:variable name="att_code" select="@code"/>
  6057.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  6058.       <xsl:variable name="att_displayName" select="@displayName"/>
  6059.  
  6060.             <!--ASSERT -->
  6061. <xsl:choose>
  6062.          <xsl:when test="(not(@nullFlavor) or 1)"/>
  6063.          <xsl:otherwise>
  6064.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6065.                <xsl:attribute name="location">
  6066.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6067.                </xsl:attribute>
  6068.                <svrl:text>
  6069.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6070.                   <xsl:value-of select="'observation/interpretationCode'"/>
  6071.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  6072.         </svrl:text>
  6073.             </svrl:failed-assert>
  6074.          </xsl:otherwise>
  6075.       </xsl:choose>
  6076.  
  6077.             <!--ASSERT -->
  6078. <xsl:choose>
  6079.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (1 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  6080.          <xsl:otherwise>
  6081.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6082.                <xsl:attribute name="location">
  6083.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6084.                </xsl:attribute>
  6085.                <svrl:text>
  6086.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6087.                   <xsl:value-of select="'observation/interpretationCode'"/>
  6088.                   <xsl:text/>" doit avoir ses attributs
  6089.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  6090.         </svrl:text>
  6091.             </svrl:failed-assert>
  6092.          </xsl:otherwise>
  6093.       </xsl:choose>
  6094.  
  6095.             <!--ASSERT -->
  6096. <xsl:choose>
  6097.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_observationInterpretation)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  6098.          <xsl:otherwise>
  6099.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6100.                <xsl:attribute name="location">
  6101.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6102.                </xsl:attribute>
  6103.                <svrl:text>
  6104.        
  6105.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  6106.                   <xsl:value-of select="'observation/interpretationCode'"/>
  6107.                   <xsl:text/>
  6108.             [<xsl:text/>
  6109.                   <xsl:value-of select="$att_code"/>
  6110.                   <xsl:text/>:<xsl:text/>
  6111.                   <xsl:value-of select="$att_displayName"/>
  6112.                   <xsl:text/>:<xsl:text/>
  6113.                   <xsl:value-of select="$att_codeSystem"/>
  6114.                   <xsl:text/>]
  6115.             doit faire partie du jeu de valeurs <xsl:text/>
  6116.                   <xsl:value-of select="$jdv_observationInterpretation"/>
  6117.                   <xsl:text/>.
  6118.         </svrl:text>
  6119.             </svrl:failed-assert>
  6120.          </xsl:otherwise>
  6121.       </xsl:choose>
  6122.       <xsl:apply-templates select="*" mode="M71"/>
  6123.    </xsl:template>
  6124.    <xsl:template match="text()" priority="-1" mode="M71"/>
  6125.    <xsl:template match="@*|node()" priority="-2" mode="M71">
  6126.       <xsl:apply-templates select="*" mode="M71"/>
  6127.    </xsl:template>
  6128.  
  6129.    <!--PATTERN ProblemCodes-->
  6130.  
  6131.  
  6132.     <!--RULE -->
  6133. <xsl:template match="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.5' and not (cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.6')]/cda:code"
  6134.                 priority="1000"
  6135.                 mode="M72">
  6136.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6137.                       context="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.5' and not (cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.6')]/cda:code"/>
  6138.       <xsl:variable name="att_code" select="@code"/>
  6139.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  6140.       <xsl:variable name="att_displayName" select="@displayName"/>
  6141.  
  6142.             <!--ASSERT -->
  6143. <xsl:choose>
  6144.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  6145.          <xsl:otherwise>
  6146.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6147.                <xsl:attribute name="location">
  6148.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6149.                </xsl:attribute>
  6150.                <svrl:text>
  6151.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6152.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6153.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  6154.         </svrl:text>
  6155.             </svrl:failed-assert>
  6156.          </xsl:otherwise>
  6157.       </xsl:choose>
  6158.  
  6159.             <!--ASSERT -->
  6160. <xsl:choose>
  6161.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  6162.          <xsl:otherwise>
  6163.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6164.                <xsl:attribute name="location">
  6165.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6166.                </xsl:attribute>
  6167.                <svrl:text>
  6168.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6169.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6170.                   <xsl:text/>" doit avoir ses attributs
  6171.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  6172.         </svrl:text>
  6173.             </svrl:failed-assert>
  6174.          </xsl:otherwise>
  6175.       </xsl:choose>
  6176.  
  6177.             <!--ASSERT -->
  6178. <xsl:choose>
  6179.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_ProblemCodes)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  6180.          <xsl:otherwise>
  6181.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6182.                <xsl:attribute name="location">
  6183.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6184.                </xsl:attribute>
  6185.                <svrl:text>
  6186.        
  6187.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  6188.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6189.                   <xsl:text/>
  6190.             [<xsl:text/>
  6191.                   <xsl:value-of select="$att_code"/>
  6192.                   <xsl:text/>:<xsl:text/>
  6193.                   <xsl:value-of select="$att_displayName"/>
  6194.                   <xsl:text/>:<xsl:text/>
  6195.                   <xsl:value-of select="$att_codeSystem"/>
  6196.                   <xsl:text/>]
  6197.             doit faire partie du jeu de valeurs <xsl:text/>
  6198.                   <xsl:value-of select="$jdv_ProblemCodes"/>
  6199.                   <xsl:text/>.
  6200.         </svrl:text>
  6201.             </svrl:failed-assert>
  6202.          </xsl:otherwise>
  6203.       </xsl:choose>
  6204.       <xsl:apply-templates select="*" mode="M72"/>
  6205.    </xsl:template>
  6206.    <xsl:template match="text()" priority="-1" mode="M72"/>
  6207.    <xsl:template match="@*|node()" priority="-2" mode="M72">
  6208.       <xsl:apply-templates select="*" mode="M72"/>
  6209.    </xsl:template>
  6210.  
  6211.    <!--PATTERN AllergyAndIntoleranceCodes-->
  6212.  
  6213.  
  6214.     <!--RULE -->
  6215. <xsl:template match="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.6']/cda:code"
  6216.                 priority="1000"
  6217.                 mode="M73">
  6218.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6219.                       context="cda:observation[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.6']/cda:code"/>
  6220.       <xsl:variable name="att_code" select="@code"/>
  6221.       <xsl:variable name="att_codeSystem" select="@codeSystem"/>
  6222.       <xsl:variable name="att_displayName" select="@displayName"/>
  6223.  
  6224.             <!--ASSERT -->
  6225. <xsl:choose>
  6226.          <xsl:when test="(not(@nullFlavor) or 0)"/>
  6227.          <xsl:otherwise>
  6228.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6229.                <xsl:attribute name="location">
  6230.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6231.                </xsl:attribute>
  6232.                <svrl:text>
  6233.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6234.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6235.                   <xsl:text/>" ne doit pas comporter d'attribut nullFlavor.
  6236.         </svrl:text>
  6237.             </svrl:failed-assert>
  6238.          </xsl:otherwise>
  6239.       </xsl:choose>
  6240.  
  6241.             <!--ASSERT -->
  6242. <xsl:choose>
  6243.          <xsl:when test="(             (@code and @codeSystem and @displayName) or             (0 and              (@nullFlavor='UNK' or @nullFlavor='NASK' or @nullFlavor='ASKU' or @nullFlavor='NAV' or @nullFlavor='MSK')) or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE'))             )"/>
  6244.          <xsl:otherwise>
  6245.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6246.                <xsl:attribute name="location">
  6247.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6248.                </xsl:attribute>
  6249.                <svrl:text>
  6250.             Erreur de conformité CI-SIS : L'élément "<xsl:text/>
  6251.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6252.                   <xsl:text/>" doit avoir ses attributs
  6253.             @code, @codeSystem et @displayName renseignés, ou si le nullFlavor est autorisé, une valeur admise pour cet attribut, ou un xsi:type différent de CD ou CE.
  6254.         </svrl:text>
  6255.             </svrl:failed-assert>
  6256.          </xsl:otherwise>
  6257.       </xsl:choose>
  6258.  
  6259.             <!--ASSERT -->
  6260. <xsl:choose>
  6261.          <xsl:when test="(             @nullFlavor or             (@xsi:type and not(@xsi:type = 'CD') and not(@xsi:type = 'CE')) or              (document($jdv_AllergyAndIntoleranceCodes)//svs:Concept[@code=$att_code and @codeSystem=$att_codeSystem])             )"/>
  6262.          <xsl:otherwise>
  6263.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6264.                <xsl:attribute name="location">
  6265.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6266.                </xsl:attribute>
  6267.                <svrl:text>
  6268.        
  6269.             Erreur de conformité CI-SIS : L'élément <xsl:text/>
  6270.                   <xsl:value-of select="ClinicalDocument/component/structuredBody/component/section/component/section/entry/observation/code"/>
  6271.                   <xsl:text/>
  6272.             [<xsl:text/>
  6273.                   <xsl:value-of select="$att_code"/>
  6274.                   <xsl:text/>:<xsl:text/>
  6275.                   <xsl:value-of select="$att_displayName"/>
  6276.                   <xsl:text/>:<xsl:text/>
  6277.                   <xsl:value-of select="$att_codeSystem"/>
  6278.                   <xsl:text/>]
  6279.             doit faire partie du jeu de valeurs <xsl:text/>
  6280.                   <xsl:value-of select="$jdv_AllergyAndIntoleranceCodes"/>
  6281.                   <xsl:text/>.
  6282.         </svrl:text>
  6283.             </svrl:failed-assert>
  6284.          </xsl:otherwise>
  6285.       </xsl:choose>
  6286.       <xsl:apply-templates select="*" mode="M73"/>
  6287.    </xsl:template>
  6288.    <xsl:template match="text()" priority="-1" mode="M73"/>
  6289.    <xsl:template match="@*|node()" priority="-2" mode="M73">
  6290.       <xsl:apply-templates select="*" mode="M73"/>
  6291.    </xsl:template>
  6292.  
  6293.    <!--PATTERN problemConcernEntry-errorsIHE PCC v3.0 Problem Concern Entry - errors validation phase-->
  6294. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Problem Concern Entry - errors validation phase</svrl:text>
  6295.  
  6296.       <!--RULE -->
  6297. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.2&#34;]"
  6298.                 priority="1000"
  6299.                 mode="M74">
  6300.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6301.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.2&#34;]"/>
  6302.  
  6303.             <!--ASSERT -->
  6304. <xsl:choose>
  6305.          <xsl:when test="cda:templateId[@root = &#34;1.3.6.1.4.1.19376.1.5.3.1.4.5.1&#34;]"/>
  6306.          <xsl:otherwise>
  6307.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6308.                <xsl:attribute name="location">
  6309.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6310.                </xsl:attribute>
  6311.                <svrl:text>
  6312.             Erreur de Conformité PCC: Problem Concern Entry a un template OID 1.3.6.1.4.1.19376.1.5.3.1.4.5.2.
  6313.             Elle spécialise Concern Entry et doit donc se conformer à ses spécifications
  6314.             en déclarant son template OID qui est 1.3.6.1.4.1.19376.1.5.3.1.4.5.1. Ces éléments
  6315.             sont requis.
  6316.         </svrl:text>
  6317.             </svrl:failed-assert>
  6318.          </xsl:otherwise>
  6319.       </xsl:choose>
  6320.  
  6321.             <!--ASSERT -->
  6322. <xsl:choose>
  6323.          <xsl:when test="cda:templateId[@root = &#34;2.16.840.1.113883.10.20.1.27&#34;]"/>
  6324.          <xsl:otherwise>
  6325.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6326.                <xsl:attribute name="location">
  6327.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6328.                </xsl:attribute>
  6329.                <svrl:text>
  6330.             Erreur de Conformité PCC: Le template parent de Problem Concern est absent.
  6331.         </svrl:text>
  6332.             </svrl:failed-assert>
  6333.          </xsl:otherwise>
  6334.       </xsl:choose>
  6335.  
  6336.             <!--ASSERT -->
  6337. <xsl:choose>
  6338.          <xsl:when test="(cda:entryRelationship[@typeCode = &#34;SUBJ&#34;] and                 cda:entryRelationship//cda:templateId[@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.5&#34;] and                 cda:entryRelationship[@inversionInd=&#34;false&#34;])"/>
  6339.          <xsl:otherwise>
  6340.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6341.                <xsl:attribute name="location">
  6342.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6343.                </xsl:attribute>
  6344.                <svrl:text>
  6345.             Erreur de Conformité PCC: Problem Concern Entry contiendra une ou plusieurs entrées qui se conformeront
  6346.             au template Problem Entry (1.3.6.1.4.1.19376.1.5.3.1.4.5) et qui se matérialiseront sous
  6347.             la forme d'éléments 'entryRelationship'. L'attribut 'typeCode' prend la valeur 'SUBJ'
  6348.             et l'attribut 'inversionInd' prend la valeur 'false'.
  6349.         </svrl:text>
  6350.             </svrl:failed-assert>
  6351.          </xsl:otherwise>
  6352.       </xsl:choose>
  6353.       <xsl:apply-templates select="*" mode="M74"/>
  6354.    </xsl:template>
  6355.    <xsl:template match="text()" priority="-1" mode="M74"/>
  6356.    <xsl:template match="@*|node()" priority="-2" mode="M74">
  6357.       <xsl:apply-templates select="*" mode="M74"/>
  6358.    </xsl:template>
  6359.  
  6360.    <!--PATTERN problemEntry-errorsIHE PCC v3.0 Problem Entry-->
  6361. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Problem Entry</svrl:text>
  6362.  
  6363.       <!--RULE -->
  6364. <xsl:template match="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.5']" priority="1000"
  6365.                 mode="M75">
  6366.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6367.                       context="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.5']"/>
  6368.  
  6369.             <!--ASSERT -->
  6370. <xsl:choose>
  6371.          <xsl:when test="self::cda:observation[@classCode='OBS' and @moodCode='EVN']"/>
  6372.          <xsl:otherwise>
  6373.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6374.                <xsl:attribute name="location">
  6375.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6376.                </xsl:attribute>
  6377.                <svrl:text>
  6378.             Erreur [problemEntry]: Dans l'élément "Problem Entry", le format de base utilisé pour
  6379.             représenter un problème utilise l'élément CDA 'observation' d'attribut classCode='OBS' pour
  6380.             signifier qu'il s'agit l'observation d'un problème, et moodCode='EVN', pour exprimer
  6381.             que l'événement a déjà eu lieu. </svrl:text>
  6382.             </svrl:failed-assert>
  6383.          </xsl:otherwise>
  6384.       </xsl:choose>
  6385.  
  6386.             <!--ASSERT -->
  6387. <xsl:choose>
  6388.          <xsl:when test="cda:templateId[@root='2.16.840.1.113883.10.20.1.28']"/>
  6389.          <xsl:otherwise>
  6390.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6391.                <xsl:attribute name="location">
  6392.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6393.                </xsl:attribute>
  6394.                <svrl:text>
  6395.             Erreur [problemEntry]: Dans l'élément "Problem Entry", les éléments &lt;templateId&gt;
  6396.             identifient l'entrée comme répondant aux spécifications de PCC et de CCD (2.16.840.1.113883.10.20.1.28).
  6397.             Cette déclaration de conformité est requise.</svrl:text>
  6398.             </svrl:failed-assert>
  6399.          </xsl:otherwise>
  6400.       </xsl:choose>
  6401.  
  6402.             <!--ASSERT -->
  6403. <xsl:choose>
  6404.          <xsl:when test="count(./cda:id) = 1"/>
  6405.          <xsl:otherwise>
  6406.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6407.                <xsl:attribute name="location">
  6408.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6409.                </xsl:attribute>
  6410.                <svrl:text>
  6411.             Erreur [problemEntry]: L'élément "Problem Entry" doit nécessairement avoir un identifiant (&lt;id&gt;)
  6412.             qui est utilisé à des fins de traçage. Si la source d'information du SIS ne fournit pas d'identifiant,
  6413.             un GUID sera affecté comme attribut "root", sans extension (ex: id root='CE1215CD-69EC-4C7B-805F-569233C5E159').
  6414.             Bien que CDA permette l'utilisation de plusieurs identifiants, "Problem Entry" impose qu'un identifiant
  6415.             seulement soit présent. </svrl:text>
  6416.             </svrl:failed-assert>
  6417.          </xsl:otherwise>
  6418.       </xsl:choose>
  6419.  
  6420.             <!--ASSERT -->
  6421. <xsl:choose>
  6422.          <xsl:when test="cda:statusCode[@code='completed']"/>
  6423.          <xsl:otherwise>
  6424.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6425.                <xsl:attribute name="location">
  6426.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6427.                </xsl:attribute>
  6428.                <svrl:text>
  6429.             Erreur [problemEntry]: Un élément "Problem Entry" décrit l'observation d'un fait clinique.
  6430.             Son composant "statutCode" sera donc toujours fixé à la valeur code='completed'. </svrl:text>
  6431.             </svrl:failed-assert>
  6432.          </xsl:otherwise>
  6433.       </xsl:choose>
  6434.  
  6435.             <!--REPORT -->
  6436. <xsl:if test="cda:effectiveTime/cda:width or cda:effectiveTime/cda:center">
  6437.          <svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6438.                                 test="cda:effectiveTime/cda:width or cda:effectiveTime/cda:center">
  6439.             <xsl:attribute name="location">
  6440.                <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6441.             </xsl:attribute>
  6442.             <svrl:text>
  6443.             Erreur [problemEntry]: Bien que CDA permette de nombreuses modalités pour exprimer un intervalle de
  6444.             temps (low/high, low/width, high/width, ou center/width), Problem Entry sera contraint à l'utilisation
  6445.             exclusive de la forme low/high.</svrl:text>
  6446.          </svrl:successful-report>
  6447.       </xsl:if>
  6448.  
  6449.             <!--ASSERT -->
  6450. <xsl:choose>
  6451.          <xsl:when test="cda:effectiveTime/cda:low[@value or @nullFlavor = 'UNK'] or cda:effectiveTime/cda:low[@value or @nullFlavor = 'NAV']"/>
  6452.          <xsl:otherwise>
  6453.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6454.                <xsl:attribute name="location">
  6455.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6456.                </xsl:attribute>
  6457.                <svrl:text>
  6458.             Erreur [problemEntry]: La composante "low" de l'élément "effectiveTime" doit être exprimée dans
  6459.             un élément "Problem Entry".
  6460.             Des exceptions sont cependant admises, comme dans le cas où le patient ne se souvient pas de
  6461.             la date de survenue d'une affection (ex: rougeole dans l'enfance sans date précise).
  6462.             Dans ce cas, l'élément "low" aura pour attribut un "nullFlavor" fixé à la valeur 'UNK'. </svrl:text>
  6463.             </svrl:failed-assert>
  6464.          </xsl:otherwise>
  6465.       </xsl:choose>
  6466.  
  6467.             <!--ASSERT -->
  6468. <xsl:choose>
  6469.          <xsl:when test="cda:value[@xsi:type='CD']"/>
  6470.          <xsl:otherwise>
  6471.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6472.                <xsl:attribute name="location">
  6473.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6474.                </xsl:attribute>
  6475.                <svrl:text>
  6476.             Erreur [problemEntry]: L'élément "value" correspond à l'état (clinique) décritet est donc obligatoire.
  6477.             Cet élément est toujours codé et son type sera toujours de type 'CD' (xsi:type='CD'). </svrl:text>
  6478.             </svrl:failed-assert>
  6479.          </xsl:otherwise>
  6480.       </xsl:choose>
  6481.  
  6482.             <!--ASSERT -->
  6483. <xsl:choose>
  6484.          <xsl:when test="(cda:value[@code and @codeSystem]) or                     (not(cda:value[@code]) and not(cda:value[@codeSystem]))"/>
  6485.          <xsl:otherwise>
  6486.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6487.                <xsl:attribute name="location">
  6488.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6489.                </xsl:attribute>
  6490.                <svrl:text>
  6491.             Erreur [problemEntry]: Si l'élément "value" est codé, les attributs "code" et "codeSystem"
  6492.             seront obligatoirement présents. </svrl:text>
  6493.             </svrl:failed-assert>
  6494.          </xsl:otherwise>
  6495.       </xsl:choose>
  6496.  
  6497.             <!--ASSERT -->
  6498. <xsl:choose>
  6499.          <xsl:when test="count(cda:entryRelationship/cda:observation/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1']) &lt;= 1"/>
  6500.          <xsl:otherwise>
  6501.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6502.                <xsl:attribute name="location">
  6503.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6504.                </xsl:attribute>
  6505.                <svrl:text>
  6506.             Erreur [problemEntry]: Un et un seul élément évaluant la sévérité d'une affection
  6507.             sera présent (entryRelationship) pour une entrée "Problem Entry" </svrl:text>
  6508.             </svrl:failed-assert>
  6509.          </xsl:otherwise>
  6510.       </xsl:choose>
  6511.  
  6512.             <!--ASSERT -->
  6513. <xsl:choose>
  6514.          <xsl:when test="not(cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1']) or                     (cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1'] and                     cda:entryRelationship[@typeCode='SUBJ' and @inversionInd='true'])"/>
  6515.          <xsl:otherwise>
  6516.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6517.                <xsl:attribute name="location">
  6518.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6519.                </xsl:attribute>
  6520.                <svrl:text>
  6521.             Erreur [problemEntry]: un élément "entryRelationship" optionnel peut être présent
  6522.             et donner une indication sur la sévérité d'une affection. S'il est présent, cet élément
  6523.             se conformera au template Severity Entry (1.3.6.1.4.1.19376.1.5.3.1.4.1).
  6524.             Son attribut 'typeCode' prendra alors la valeur 'SUBJ' et 'inversionInd' la valeur 'true'. </svrl:text>
  6525.             </svrl:failed-assert>
  6526.          </xsl:otherwise>
  6527.       </xsl:choose>
  6528.  
  6529.             <!--ASSERT -->
  6530. <xsl:choose>
  6531.          <xsl:when test="count(cda:entryRelationship/cda:observation/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.1']) &lt;= 1"/>
  6532.          <xsl:otherwise>
  6533.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6534.                <xsl:attribute name="location">
  6535.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6536.                </xsl:attribute>
  6537.                <svrl:text>
  6538.             Erreur [problemEntry]: Un et un seul élément évaluant le statut d'une affection (Problem Status Observation)
  6539.             sera présent par le biais d'une relation "entryRelationship" pour toute entrée "Problem Entry"</svrl:text>
  6540.             </svrl:failed-assert>
  6541.          </xsl:otherwise>
  6542.       </xsl:choose>
  6543.  
  6544.             <!--ASSERT -->
  6545. <xsl:choose>
  6546.          <xsl:when test="not(cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.1']) or                     (cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.1'] and                     cda:entryRelationship[@typeCode='REFR' and @inversionInd='false'])"/>
  6547.          <xsl:otherwise>
  6548.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6549.                <xsl:attribute name="location">
  6550.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6551.                </xsl:attribute>
  6552.                <svrl:text>
  6553.             Erreur [problemEntry]: un élément "entryRelationship" optionnel peut être présent
  6554.             et donner une indication sur le statut clinique d'une affection -- cf. value set "PCC_ClinicalStatusCodes" (1.2.250.1.213.1.1.4.2.283.2).
  6555.             S'il est présent, cet élément se conformera au template "Problem Status Observation" (1.3.6.1.4.1.19376.1.5.3.1.4.1.1).
  6556.             Son attribut 'typeCode' prendra alors la valeur 'REFR' et 'inversionInd' la valeur 'false'.</svrl:text>
  6557.             </svrl:failed-assert>
  6558.          </xsl:otherwise>
  6559.       </xsl:choose>
  6560.  
  6561.             <!--ASSERT -->
  6562. <xsl:choose>
  6563.          <xsl:when test="count(cda:entryRelationship/cda:observation/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.2']) &lt;= 1"/>
  6564.          <xsl:otherwise>
  6565.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6566.                <xsl:attribute name="location">
  6567.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6568.                </xsl:attribute>
  6569.                <svrl:text>
  6570.             Erreur [problemEntry]: Un et un seul élément évaluant le statut de l'état de santé
  6571.             d'un patient (Health Status Observation) sera présent par le biais d'une relation "entryRelationship"
  6572.             pour toute entrée "Problem Entry". </svrl:text>
  6573.             </svrl:failed-assert>
  6574.          </xsl:otherwise>
  6575.       </xsl:choose>
  6576.  
  6577.             <!--ASSERT -->
  6578. <xsl:choose>
  6579.          <xsl:when test="not(cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.2']) or                     (cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.1.2'] and                     cda:entryRelationship[@typeCode='REFR' and @inversionInd='false'])"/>
  6580.          <xsl:otherwise>
  6581.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6582.                <xsl:attribute name="location">
  6583.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6584.                </xsl:attribute>
  6585.                <svrl:text>
  6586.             Erreur [problemEntry]: un élément "entryRelationship" optionnel peut être présent et donner
  6587.             une indication sur le statut de l'état de santé d'un patient -- cf. value set "PCC_HealthStatusCodes" (1.2.250.1.213.1.1.4.2.283.1).
  6588.             S'il est présent, cet élément se conformera au template "Health Status Observation" (1.3.6.1.4.1.19376.1.5.3.1.4.1.2).
  6589.             Son attribut 'typeCode' prendra alors la valeur 'REFR' et 'inversionInd' la valeur 'false'.</svrl:text>
  6590.             </svrl:failed-assert>
  6591.          </xsl:otherwise>
  6592.       </xsl:choose>
  6593.  
  6594.             <!--ASSERT -->
  6595. <xsl:choose>
  6596.          <xsl:when test="not(cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.2']) or                     (cda:entryRelationship/cda:templateId[@root='1.3.6.1.4.1.19376.1.5.3.1.4.2'] and                     cda:entryRelationship[@typeCode='SUBJ' and @inversionInd='true'])"/>
  6597.          <xsl:otherwise>
  6598.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6599.                <xsl:attribute name="location">
  6600.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6601.                </xsl:attribute>
  6602.                <svrl:text>
  6603.             Erreur [problemEntry]: un ou plusieurs éléments "entryRelationship" optionnels peuvent être présents et
  6604.             permettre d'apporter des informations additionnelles sur le problème observé.
  6605.             S'il est présent, cet élément se conformera au template "Comment Entry" (1.3.6.1.4.1.19376.1.5.3.1.4.2).
  6606.             Son attribut 'typeCode' prendra alors la valeur 'SUBJ' et 'inversionInd' la valeur 'true'.</svrl:text>
  6607.             </svrl:failed-assert>
  6608.          </xsl:otherwise>
  6609.       </xsl:choose>
  6610.  
  6611.             <!--ASSERT -->
  6612. <xsl:choose>
  6613.          <xsl:when test="cda:code"/>
  6614.          <xsl:otherwise>
  6615.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6616.                <xsl:attribute name="location">
  6617.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6618.                </xsl:attribute>
  6619.                <svrl:text>  
  6620.             Erreur [problemEntry] (Alerte): L'élément code -- cf. jeu de valeurs "PCC_ProblemCodes" (1.2.250.1.213.1.1.4.2.283.3)
  6621.             d'une entrée Problem Entry permet d'établir à quel stade diagnostique se positionne un problème : par exemple un diagnostic
  6622.             est un stade plus évolué qu'un symptôme dans la description d'un problème. Cette évaluation est importante pour les cliniciens. </svrl:text>
  6623.             </svrl:failed-assert>
  6624.          </xsl:otherwise>
  6625.       </xsl:choose>
  6626.  
  6627.             <!--REPORT -->
  6628. <xsl:if test="cda:uncertaintyCode">
  6629.          <svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cda:uncertaintyCode">
  6630.             <xsl:attribute name="location">
  6631.                <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6632.             </xsl:attribute>
  6633.             <svrl:text>
  6634.             Erreur [problemEntry] (Alerte): CDA permet à la description d'un état clinique un certain degré d'incertitude avec
  6635.             l'élément "uncertaintyCode". En l'absence actuelle de consensus clairement établi sur le bon usage de cet élément,
  6636.             PCC déconseille de l'utiliser dans le cadre d'une entrée Problem Entry.</svrl:text>
  6637.          </svrl:successful-report>
  6638.       </xsl:if>
  6639.  
  6640.             <!--REPORT -->
  6641. <xsl:if test="cda:confidentialityCode">
  6642.          <svrl:successful-report xmlns:svrl="http://purl.oclc.org/dsdl/svrl" test="cda:confidentialityCode">
  6643.             <xsl:attribute name="location">
  6644.                <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6645.             </xsl:attribute>
  6646.             <svrl:text>
  6647.             Erreur [problemEntry] (Alerte): CDA permet l'utilisation de l'élément "confidentialtyCode" pour une observation.
  6648.             PCC déconseille cependant pour des raisons pratiques de l'utiliser dans le cadre d'une entrée Problem Entry.
  6649.             Il y a en effet d'autres manières d'assurer la confidentialité des documents, qui pourront être résolus au sein
  6650.             du domaine d'affinité.</svrl:text>
  6651.          </svrl:successful-report>
  6652.       </xsl:if>
  6653.  
  6654.             <!--ASSERT -->
  6655. <xsl:choose>
  6656.          <xsl:when test="not(cda:value[@codeSystem]) or cda:value[@codeSystemName]"/>
  6657.          <xsl:otherwise>
  6658.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6659.                <xsl:attribute name="location">
  6660.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6661.                </xsl:attribute>
  6662.                <svrl:text>
  6663.             Erreur [problemEntry] (Alerte): les attributs "codeSystem" et "codeSystemName" de l'élément "value" d'une
  6664.             entrée Problem Entry devraient être présents pour une meilleure lisibilité, mais ne sont pas obligatoires. </svrl:text>
  6665.             </svrl:failed-assert>
  6666.          </xsl:otherwise>
  6667.       </xsl:choose>
  6668.  
  6669.             <!--ASSERT -->
  6670. <xsl:choose>
  6671.          <xsl:when test="not(cda:value[@code]) or cda:value[@displayName]"/>
  6672.          <xsl:otherwise>
  6673.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6674.                <xsl:attribute name="location">
  6675.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6676.                </xsl:attribute>
  6677.                <svrl:text>
  6678.             Erreur [problemEntry] (Alerte): l'attribut "displaySystemName" de l'élément "value" d'une
  6679.             entrée Problem Entry devrait être présent pour une meilleure lisibilité, mais n'est pas obligatoire.</svrl:text>
  6680.             </svrl:failed-assert>
  6681.          </xsl:otherwise>
  6682.       </xsl:choose>
  6683.       <xsl:apply-templates select="*" mode="M75"/>
  6684.    </xsl:template>
  6685.    <xsl:template match="text()" priority="-1" mode="M75"/>
  6686.    <xsl:template match="@*|node()" priority="-2" mode="M75">
  6687.       <xsl:apply-templates select="*" mode="M75"/>
  6688.    </xsl:template>
  6689.  
  6690.    <!--PATTERN procedureEntry-errorsIHE PCC v3.0 Procedure Entry-->
  6691. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Procedure Entry</svrl:text>
  6692.  
  6693.       <!--RULE -->
  6694. <xsl:template match="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.19&#34;]"
  6695.                 priority="1000"
  6696.                 mode="M76">
  6697.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6698.                       context="*[cda:templateId/@root=&#34;1.3.6.1.4.1.19376.1.5.3.1.4.19&#34;]"/>
  6699.  
  6700.             <!--ASSERT -->
  6701. <xsl:choose>
  6702.          <xsl:when test="self::cda:procedure[@classCode=&#34;PROC&#34;]"/>
  6703.          <xsl:otherwise>
  6704.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6705.                <xsl:attribute name="location">
  6706.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6707.                </xsl:attribute>
  6708.                <svrl:text>
  6709.                 Erreur [procedureEntry]: L'attribut "classCode" pour un élément "Procedure Entry" sera fixé à la valeur "PROC".</svrl:text>
  6710.             </svrl:failed-assert>
  6711.          </xsl:otherwise>
  6712.       </xsl:choose>
  6713.  
  6714.             <!--ASSERT -->
  6715. <xsl:choose>
  6716.          <xsl:when test="not(./@moodCode=&#34;EVN&#34;) or                 cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.29&#34;]"/>
  6717.          <xsl:otherwise>
  6718.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6719.                <xsl:attribute name="location">
  6720.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6721.                </xsl:attribute>
  6722.                <svrl:text>
  6723.                 Erreur [procedureEntry]: Lorsque l'élément "Procedure Entry" est en mode événement (moodCode='EVN'),
  6724.                 cette entrée se conforme au template CCD 2.16.840.1.113883.10.20.1.29</svrl:text>
  6725.             </svrl:failed-assert>
  6726.          </xsl:otherwise>
  6727.       </xsl:choose>
  6728.  
  6729.             <!--ASSERT -->
  6730. <xsl:choose>
  6731.          <xsl:when test="not(./@moodCode=&#34;INT&#34;) or                 cda:templateId[@root=&#34;2.16.840.1.113883.10.20.1.25&#34;]"/>
  6732.          <xsl:otherwise>
  6733.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6734.                <xsl:attribute name="location">
  6735.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6736.                </xsl:attribute>
  6737.                <svrl:text>
  6738.                 Erreur [procedureEntry]: Lorsque l'élément "Procedure Entry" est en mode intention (moodCode='INT'),
  6739.                 cette entrée se conforme au template CCD 2.16.840.1.113883.10.20.1.25.</svrl:text>
  6740.             </svrl:failed-assert>
  6741.          </xsl:otherwise>
  6742.       </xsl:choose>
  6743.  
  6744.             <!--ASSERT -->
  6745. <xsl:choose>
  6746.          <xsl:when test="cda:id"/>
  6747.          <xsl:otherwise>
  6748.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6749.                <xsl:attribute name="location">
  6750.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6751.                </xsl:attribute>
  6752.                <svrl:text>
  6753.                 Erreur [procedureEntry]: Un élément "Procedure Entry" comporte un identifiant "id".</svrl:text>
  6754.             </svrl:failed-assert>
  6755.          </xsl:otherwise>
  6756.       </xsl:choose>
  6757.  
  6758.             <!--ASSERT -->
  6759. <xsl:choose>
  6760.          <xsl:when test="cda:code"/>
  6761.          <xsl:otherwise>
  6762.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6763.                <xsl:attribute name="location">
  6764.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6765.                </xsl:attribute>
  6766.                <svrl:text>
  6767.             Erreur [procedureEntry]: Un élément "Procedure Entry" comporte un élément "code".</svrl:text>
  6768.             </svrl:failed-assert>
  6769.          </xsl:otherwise>
  6770.       </xsl:choose>
  6771.  
  6772.             <!--ASSERT -->
  6773. <xsl:choose>
  6774.          <xsl:when test="cda:statusCode[@code = &#34;completed&#34; or                 @code = &#34;active&#34; or                 @code = &#34;aborted&#34; or                 @code = &#34;cancelled&#34;]"/>
  6775.          <xsl:otherwise>
  6776.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6777.                <xsl:attribute name="location">
  6778.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6779.                </xsl:attribute>
  6780.                <svrl:text>
  6781.                 Erreur [procedureEntry]: L'élément "statusCode" sera présent.
  6782.                 Il prendra la valeur "completed" pour les procédures réalisées, ou "active" pour les procédures
  6783.                 toujours en cours. Il prendra la valeur "aborted" por les procédures ayant été stoppées avant la fin
  6784.                 et "cancelled" pour celles qui ont été annulées (avant d'avoir débuté).</svrl:text>
  6785.             </svrl:failed-assert>
  6786.          </xsl:otherwise>
  6787.       </xsl:choose>
  6788.  
  6789.             <!--ASSERT -->
  6790. <xsl:choose>
  6791.          <xsl:when test="not(./@moodCode=&#34;INT&#34;) or                  (cda:effectiveTime or cda:priorityCode)"/>
  6792.          <xsl:otherwise>
  6793.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6794.                <xsl:attribute name="location">
  6795.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6796.                </xsl:attribute>
  6797.                <svrl:text>
  6798.                 Erreur [procedureEntry]: dans une entrée "Procedure Entry", l'élément "priorityCode" sera présent en mode "INT"
  6799.                 lorsque l'élément "effectiveTime" est omis.
  6800.                 Il peut cependant exister dans d'autres modes, indiquant le degré de priorité de la procédure.</svrl:text>
  6801.             </svrl:failed-assert>
  6802.          </xsl:otherwise>
  6803.       </xsl:choose>
  6804.  
  6805.             <!--ASSERT -->
  6806. <xsl:choose>
  6807.          <xsl:when test="./@moodCode = &#34;INT&#34; or ./@moodCode = &#34;EVN&#34;"/>
  6808.          <xsl:otherwise>
  6809.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6810.                <xsl:attribute name="location">
  6811.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6812.                </xsl:attribute>
  6813.                <svrl:text>
  6814.                 Erreur [procedureEntry] (Alerte): L'attribut "moodCode" d'une entrée "Procedure Entry" peut prendre la valeur "INT"
  6815.                 pour indiquer une procédure escomptée, ou "EVN" pour indiquer qu'elle a déjà été réalisée.</svrl:text>
  6816.             </svrl:failed-assert>
  6817.          </xsl:otherwise>
  6818.       </xsl:choose>
  6819.  
  6820.             <!--ASSERT -->
  6821. <xsl:choose>
  6822.          <xsl:when test="cda:code[@code]"/>
  6823.          <xsl:otherwise>
  6824.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6825.                <xsl:attribute name="location">
  6826.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6827.                </xsl:attribute>
  6828.                <svrl:text>
  6829.                 Erreur [procedureEntry] (Alerte): une entrée "Procedure Entry" devrait comporter un code décrivant le type de la procédure.</svrl:text>
  6830.             </svrl:failed-assert>
  6831.          </xsl:otherwise>
  6832.       </xsl:choose>
  6833.  
  6834.             <!--ASSERT -->
  6835. <xsl:choose>
  6836.          <xsl:when test="cda:effectiveTime"/>
  6837.          <xsl:otherwise>
  6838.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6839.                <xsl:attribute name="location">
  6840.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6841.                </xsl:attribute>
  6842.                <svrl:text>
  6843.                 Erreur [procedureEntry] (Alerte): l'élément "effectiveTime" devrait être présent dans une entrée "Procedure Entry"
  6844.                 pour horodater la procédure (en mode "EVN") ou la date escomptée pour la procédure (en mode "INT").</svrl:text>
  6845.             </svrl:failed-assert>
  6846.          </xsl:otherwise>
  6847.       </xsl:choose>
  6848.       <xsl:apply-templates select="*" mode="M76"/>
  6849.    </xsl:template>
  6850.    <xsl:template match="text()" priority="-1" mode="M76"/>
  6851.    <xsl:template match="@*|node()" priority="-2" mode="M76">
  6852.       <xsl:apply-templates select="*" mode="M76"/>
  6853.    </xsl:template>
  6854.  
  6855.    <!--PATTERN simpleObservation-errorsIHE PCC v3.0 Simple Observation-->
  6856. <svrl:text xmlns:svrl="http://purl.oclc.org/dsdl/svrl">IHE PCC v3.0 Simple Observation</svrl:text>
  6857.  
  6858.       <!--RULE -->
  6859. <xsl:template match="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.13']"
  6860.                 priority="1000"
  6861.                 mode="M77">
  6862.       <svrl:fired-rule xmlns:svrl="http://purl.oclc.org/dsdl/svrl"
  6863.                       context="*[cda:templateId/@root='1.3.6.1.4.1.19376.1.5.3.1.4.13']"/>
  6864.  
  6865.             <!--ASSERT -->
  6866. <xsl:choose>
  6867.          <xsl:when test="cda:id"/>
  6868.          <xsl:otherwise>
  6869.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6870.                <xsl:attribute name="location">
  6871.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6872.                </xsl:attribute>
  6873.                <svrl:text>
  6874.             Erreur de Conformité PCC: "Simple Observation" requiert un élément identifiant &lt;id&gt;.</svrl:text>
  6875.             </svrl:failed-assert>
  6876.          </xsl:otherwise>
  6877.       </xsl:choose>
  6878.  
  6879.             <!--ASSERT -->
  6880. <xsl:choose>
  6881.          <xsl:when test="cda:code"/>
  6882.          <xsl:otherwise>
  6883.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6884.                <xsl:attribute name="location">
  6885.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6886.                </xsl:attribute>
  6887.                <svrl:text>
  6888.             Erreur de Conformité PCC: "Simple Observation" requiert un élément "code" décrivant ce qui est observé.</svrl:text>
  6889.             </svrl:failed-assert>
  6890.          </xsl:otherwise>
  6891.       </xsl:choose>
  6892.  
  6893.             <!--ASSERT -->
  6894. <xsl:choose>
  6895.          <xsl:when test="cda:statusCode[@code = &#34;completed&#34;]"/>
  6896.          <xsl:otherwise>
  6897.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6898.                <xsl:attribute name="location">
  6899.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6900.                </xsl:attribute>
  6901.                <svrl:text>
  6902.             Erreur de Conformité PCC: L'élément "statusCode" est requis dans "Simple Observations"
  6903.             sont fixés à la valeur "completed".</svrl:text>
  6904.             </svrl:failed-assert>
  6905.          </xsl:otherwise>
  6906.       </xsl:choose>
  6907.  
  6908.             <!--ASSERT -->
  6909. <xsl:choose>
  6910.          <xsl:when test="cda:effectiveTime[@value or @nullFlavor]"/>
  6911.          <xsl:otherwise>
  6912.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6913.                <xsl:attribute name="location">
  6914.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6915.                </xsl:attribute>
  6916.                <svrl:text>
  6917.             Erreur de Conformité PCC: L'élément &lt;effectiveTime&gt; est requis dans "Simple Observations",
  6918.             et représentera la date et l'heure de la mesure effectuée. Cet élément devrait être précis au jour.
  6919.             Si la date et l'heure sont inconnues, l'attribut nullFlavor sera utilisé.</svrl:text>
  6920.             </svrl:failed-assert>
  6921.          </xsl:otherwise>
  6922.       </xsl:choose>
  6923.  
  6924.             <!--ASSERT -->
  6925. <xsl:choose>
  6926.          <xsl:when test="cda:value"/>
  6927.          <xsl:otherwise>
  6928.             <svrl:failed-assert xmlns:svrl="http://purl.oclc.org/dsdl/svrl">
  6929.                <xsl:attribute name="location">
  6930.                   <xsl:apply-templates select="." mode="schematron-select-full-path"/>
  6931.                </xsl:attribute>
  6932.                <svrl:text>
  6933.             Erreur de Conformité PCC: L'élément "value" d'un élément "Simple Observation" utilisera un
  6934.             type de donnée approprié à l'observation.</svrl:text>
  6935.             </svrl:failed-assert>
  6936.          </xsl:otherwise>
  6937.       </xsl:choose>
  6938.       <xsl:apply-templates select="*" mode="M77"/>
  6939.    </xsl:template>
  6940.    <xsl:template match="text()" priority="-1" mode="M77"/>
  6941.    <xsl:template match="@*|node()" priority="-2" mode="M77">
  6942.       <xsl:apply-templates select="*" mode="M77"/>
  6943.    </xsl:template>
  6944.  
  6945.    <!--PATTERN variables-->
  6946. <xsl:variable name="enteteHL7France" select="'2.16.840.1.113883.2.8.2.1'"/>
  6947.    <xsl:variable name="commonTemplate" select="'1.2.250.1.213.1.1.1.1'"/>
  6948.    <xsl:variable name="XDS-SD" select="'1.3.6.1.4.1.19376.1.2.20'"/>
  6949.    <xsl:variable name="OIDphysique" select="'1.2.250.1.71.4.2.1'"/>
  6950.    <xsl:variable name="OIDmorale" select="'1.2.250.1.71.4.2.2'"/>
  6951.    <xsl:variable name="OIDINS-c" select="'1.2.250.1.213.1.4.2'"/>
  6952.    <xsl:variable name="OIDLOINC" select="'2.16.840.1.113883.6.1'"/>
  6953.    <xsl:variable name="templateObservationMedia" select="'1.3.6.1.4.1.19376.1.8.1.4.10'"/>
  6954.    <xsl:variable name="jdv_authorSpecialty"
  6955.                 select="'../jeuxDeValeurs/CI-SIS_jdv_authorSpecialty.xml'"/>
  6956.    <xsl:variable name="jdv_confidentialityCode"
  6957.                 select="'../jeuxDeValeurs/CI-SIS_jdv_confidentialityCode.xml'"/>
  6958.    <xsl:variable name="jdv_healthcareFacilityTypeCode"
  6959.                 select="'../jeuxDeValeurs/CI-SIS_jdv_healthcareFacilityTypeCode.xml'"/>
  6960.    <xsl:variable name="jdv_observationInterpretation"
  6961.                 select="'../jeuxDeValeurs/CI-SIS_jdv_observationInterpretation.xml'"/>
  6962.    <xsl:variable name="jdv_practiceSettingCode"
  6963.                 select="'../jeuxDeValeurs/CI-SIS_jdv_practiceSettingCode.xml'"/>
  6964.    <xsl:variable name="jdv_typeCode" select="'../jeuxDeValeurs/CI-SIS_jdv_typeCode.xml'"/>
  6965.    <xsl:variable name="jdv_HealthStatusCodes"
  6966.                 select="'../jeuxDeValeurs/CI-SIS_jdv_HealthStatusCodes.xml'"/>
  6967.    <xsl:variable name="jdv_ClinicalStatusCodes"
  6968.                 select="'../jeuxDeValeurs/CI-SIS_jdv_ClinicalStatusCodes.xml'"/>
  6969.    <xsl:variable name="jdv_ProblemCodes" select="'../jeuxDeValeurs/CI-SIS_jdv_ProblemCodes.xml'"/>
  6970.    <xsl:variable name="jdv_AllergyAndIntoleranceCodes"
  6971.                 select="'../jeuxDeValeurs/CI-SIS_jdv_AllergyAndIntoleranceCodes.xml'"/>
  6972.    <xsl:template match="text()" priority="-1" mode="M79"/>
  6973.    <xsl:template match="@*|node()" priority="-2" mode="M79">
  6974.       <xsl:apply-templates select="*" mode="M79"/>
  6975.    </xsl:template>
  6976. </xsl:stylesheet>
Add Comment
Please, Sign In to add comment