<?xml version="1.0" encoding="UTF-8"?>
<sch:schema xmlns:sch="http://purl.oclc.org/dsdl/schematron" queryBinding="xslt2">
  <sch:ns prefix="f" uri="http://hl7.org/fhir"/>
  <sch:ns prefix="h" uri="http://www.w3.org/1999/xhtml"/>
  <!-- 
    This file contains just the constraints for the profile ExampleScenario
    It includes the base constraints for the resource as well.
    Because of the way that schematrons and containment work, 
    you may need to use this schematron fragment to build a, 
    single schematron that validates contained resources (if you have any) 
  -->
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:instance/f:structureType</sch:title>
    <sch:rule context="f:ExampleScenario/f:instance/f:structureType">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.instance.resourceType|0.1.0']) &gt;= 1">extension with URL = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.instance.resourceType|0.1.0': minimum cardinality of 'extension' is 1</sch:assert>
      <sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.instance.resourceType|0.1.0']) &lt;= 1">extension with URL = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.instance.resourceType|0.1.0': maximum cardinality of 'extension' is 1</sch:assert>
      <sch:assert test="count(f:system) &lt;= 1">system: maximum cardinality of 'system' is 1</sch:assert>
      <sch:assert test="count(f:version) &lt;= 1">version: maximum cardinality of 'version' is 1</sch:assert>
      <sch:assert test="count(f:code) &lt;= 1">code: maximum cardinality of 'code' is 1</sch:assert>
      <sch:assert test="count(f:display) &lt;= 1">display: maximum cardinality of 'display' is 1</sch:assert>
      <sch:assert test="count(f:userSelected) &lt;= 1">userSelected: maximum cardinality of 'userSelected' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:process</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:process">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:title) &gt;= 1">title: minimum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:title) &lt;= 1">title: maximum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:description) &lt;= 1">description: maximum cardinality of 'description' is 1</sch:assert>
      <sch:assert test="count(f:preConditions) &lt;= 1">preConditions: maximum cardinality of 'preConditions' is 1</sch:assert>
      <sch:assert test="count(f:postConditions) &lt;= 1">postConditions: maximum cardinality of 'postConditions' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:process/f:step</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:process/f:step">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:number) &lt;= 1">number: maximum cardinality of 'number' is 1</sch:assert>
      <sch:assert test="count(f:process) &lt;= 1">process: maximum cardinality of 'process' is 1</sch:assert>
      <sch:assert test="count(f:workflow) &lt;= 1">workflow: maximum cardinality of 'workflow' is 1</sch:assert>
      <sch:assert test="count(f:operation) &lt;= 1">operation: maximum cardinality of 'operation' is 1</sch:assert>
      <sch:assert test="count(f:pause) &lt;= 1">pause: maximum cardinality of 'pause' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:process/f:step/f:operation</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:process/f:step/f:operation">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:type) &lt;= 1">type: maximum cardinality of 'type' is 1</sch:assert>
      <sch:assert test="count(f:title) &gt;= 1">title: minimum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:title) &lt;= 1">title: maximum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:initiator) &lt;= 1">initiator: maximum cardinality of 'initiator' is 1</sch:assert>
      <sch:assert test="count(f:receiver) &lt;= 1">receiver: maximum cardinality of 'receiver' is 1</sch:assert>
      <sch:assert test="count(f:description) &lt;= 1">description: maximum cardinality of 'description' is 1</sch:assert>
      <sch:assert test="count(f:initiatorActive) &lt;= 1">initiatorActive: maximum cardinality of 'initiatorActive' is 1</sch:assert>
      <sch:assert test="count(f:receiverActive) &lt;= 1">receiverActive: maximum cardinality of 'receiverActive' is 1</sch:assert>
      <sch:assert test="count(f:request) &lt;= 1">request: maximum cardinality of 'request' is 1</sch:assert>
      <sch:assert test="count(f:response) &lt;= 1">response: maximum cardinality of 'response' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:process/f:step/f:alternative</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:process/f:step/f:alternative">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:title) &gt;= 1">title: minimum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:title) &lt;= 1">title: maximum cardinality of 'title' is 1</sch:assert>
      <sch:assert test="count(f:description) &lt;= 1">description: maximum cardinality of 'description' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:operation</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:operation">
      <sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number|0.1.0']) &gt;= 1">extension with URL = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number|0.1.0': minimum cardinality of 'extension' is 1</sch:assert>
      <sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number|0.1.0']) &lt;= 1">extension with URL = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.number|0.1.0': maximum cardinality of 'extension' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
  <sch:pattern>
    <sch:title>f:ExampleScenario/f:process/f:step/f:operation/f:type</sch:title>
    <sch:rule context="f:ExampleScenario/f:process/f:step/f:operation/f:type">
      <sch:assert test="count(f:id) &lt;= 1">id: maximum cardinality of 'id' is 1</sch:assert>
      <sch:assert test="count(f:extension[@url = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.type|0.1.0']) &lt;= 1">extension with URL = 'http://hl7.org/fhir/4.0/StructureDefinition/extension-ExampleScenario.process.step.operation.type|0.1.0': maximum cardinality of 'extension' is 1</sch:assert>
      <sch:assert test="count(f:system) &lt;= 1">system: maximum cardinality of 'system' is 1</sch:assert>
      <sch:assert test="count(f:version) &lt;= 1">version: maximum cardinality of 'version' is 1</sch:assert>
      <sch:assert test="count(f:code) &lt;= 1">code: maximum cardinality of 'code' is 1</sch:assert>
      <sch:assert test="count(f:display) &lt;= 1">display: maximum cardinality of 'display' is 1</sch:assert>
      <sch:assert test="count(f:userSelected) &lt;= 1">userSelected: maximum cardinality of 'userSelected' is 1</sch:assert>
    </sch:rule>
  </sch:pattern>
</sch:schema>
