<?xml version="1.0" encoding="ISO-8859-1"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0" ns="http://www.openhealth.org/ASTM/operative.report" xmlns:astm="http://www.openhealth.org/ASTM/E2182" xmlns:ch="http://www.openhealth.org/ASTM/clinical.header" xmlns:on="http://www.openhealth.org/ASTM/operative.report">
  <include href="ASTM.E2182.rng"/>
  <define name="clinical.body.model">
    <ref name="preoperative.diagnosis"/>
    <ref name="postoperative.diagnosis"/>
    <ref name="procedure"/>
    <ref name="anesthesia"/>
    <ref name="indications"/>
    <optional>
      <ref name="prep"/>
    </optional>
    <optional>
      <ref name="medications"/>
    </optional>
    <ref name="description"/>
    <optional>
      <ref name="findings"/>
    </optional>
    <optional>
      <ref name="specimens"/>
    </optional>
    <optional>
      <ref name="closure"/>
    </optional>
    <optional>
      <ref name="complications"/>
    </optional>
    <optional>
      <ref name="pathology.intraoperative"/>
    </optional>
    <optional>
      <ref name="pathology.permanent"/>
    </optional>
    <optional>
      <ref name="drains"/>
    </optional>
    <optional>
      <ref name="counts"/>
    </optional>
    <optional>
      <ref name="estimated.blood.loss"/>
    </optional>
    <optional>
      <ref name="fluids"/>
    </optional>
    <optional>
      <ref name="patient.condition"/>
    </optional>
    <optional>
      <ref name="disposition"/>
    </optional>
    <optional>
      <ref name="followup"/>
    </optional>
  </define>
  <start>
    <element name="operative.report">
      <ref name="astm.document.attrib"/>
      <ref name="clinical.header"/>
      <ref name="clinical.body"/>
    </element>
  </start>
  <define name="clinical.body">
    <element name="clinical.body">
      <ref name="ch.attrib"/>
      <ref name="clinical.body.model"/>
    </element>
  </define>
  <define name="preoperative.diagnosis">
    <element name="preoperative.diagnosis">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="postoperative.diagnosis">
    <element name="postoperative.diagnosis">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="procedure">
    <element name="procedure">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="anesthesia">
    <element name="anesthesia">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="indications">
    <element name="indications">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="prep">
    <element name="prep">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="medications">
    <element name="medications">
      <ref name="astm.content.attrib"/>
      <zeroOrMore>
        <choice>
          <ref name="astm.content"/>
          <ref name="medication"/>
        </choice>
      </zeroOrMore>
    </element>
  </define>
  <define name="medication">
    <element name="medication">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="description">
    <element name="description">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="findings">
    <element name="findings">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="specimens">
    <element name="specimens">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="closure">
    <element name="closure">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="complications">
    <element name="complications">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="drains">
    <element name="drains">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="counts">
    <element name="counts">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="pathology.intraoperative">
    <element name="pathology.intraoperative">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="pathology.permanent">
    <element name="pathology.permanent">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="estimated.blood.loss">
    <element name="estimated.blood.loss">
      <ref name="astm.content.attrib"/>
      <text/>
    </element>
  </define>
  <define name="fluids">
    <element name="fluids">
      <ref name="astm.content.attrib"/>
      <zeroOrMore>
        <ref name="fluid"/>
      </zeroOrMore>
    </element>
  </define>
  <define name="fluid">
    <element name="fluid">
      <ref name="astm.content.attrib"/>
      <attribute name="status">
        <choice>
          <value>given</value>
          <value>loss</value>
        </choice>
      </attribute>
      <optional>
        <attribute name="volume">
          <text/>
        </attribute>
      </optional>
      <text/>
    </element>
  </define>
  <define name="patient.condition">
    <element name="patient.condition">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="disposition">
    <element name="disposition">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
  <define name="followup">
    <element name="followup">
      <ref name="astm.content.attrib"/>
      <ref name="astm.content"/>
    </element>
  </define>
</grammar>
