<StructureDefinition xmlns="http://hl7.org/fhir">
  <url value="https://fhir.synapxe.sg/StructureDefinition/profile-ed-procedure" />
  <name value="Procedure" />
  <status value="active" />
  <fhirVersion value="5.0.0" />
  <kind value="resource" />
  <abstract value="false" />
  <type value="Procedure" />
  <baseDefinition value="http://hl7.org/fhir/StructureDefinition/Procedure" />
  <derivation value="constraint" />
  <differential>
    <element id="Procedure.contained">
      <path value="Procedure.contained" />
      <short value="An action that is being or was performed on an individual or entity" />
      <definition value="An action that is or was performed on or for a patient, practitioner, device, organization, or location. For example, this can be a physical intervention on a patient like an operation, or less invasive like long term services, counseling, or hypnotherapy.  This can be a quality or safety inspection for a location, organization, or device.  This can be an accreditation procedure on a practitioner for licensing." />
      <constraint>
        <key value="dom-2" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL NOT contain nested Resources" />
        <expression value="contained.contained.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-4" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated" />
        <expression value="contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-3" />
        <severity value="error" />
        <human value="If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource" />
        <expression value="contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().ofType(canonical) | %resource.descendants().ofType(uri) | %resource.descendants().ofType(url))) or descendants().where(reference = '#').exists() or descendants().where(ofType(canonical) = '#').exists() or descendants().where(ofType(canonical) = '#').exists()).not()).trace('unmatched', id).empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-6" />
        <severity value="warning" />
        <human value="A resource should have narrative for robust management" />
        <expression value="text.`div`.exists()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <constraint>
        <key value="dom-5" />
        <severity value="error" />
        <human value="If a resource is contained in another resource, it SHALL NOT have a security label" />
        <expression value="contained.meta.security.empty()" />
        <source value="http://hl7.org/fhir/StructureDefinition/DomainResource" />
      </constraint>
      <mapping>
        <identity value="rim" />
        <map value="n/a" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Entity. Role, or Act" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="N/A" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Entity, Role, or Act" />
      </mapping>
      <mapping>
        <identity value="workflow" />
        <map value="Event" />
      </mapping>
      <mapping>
        <identity value="w5" />
        <map value="clinical.general" />
      </mapping>
      <mapping>
        <identity value="rim" />
        <map value="Procedure[moodCode=EVN]" />
      </mapping>
    </element>
    <element id="Procedure.identifier">
      <path value="Procedure.identifier" />
      <min value="1" />
      <max value="1" />
      <type>
        <code value="Identifier" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-identifier" />
      </type>
    </element>
    <element id="Procedure.identifier.system">
      <path value="Procedure.identifier.system" />
      <fixedUri value="https://fhir.synapxe.sg/NamingSystem/procedure-id" />
    </element>
    <element id="Procedure.instantiatesCanonical">
      <path value="Procedure.instantiatesCanonical" />
      <max value="0" />
    </element>
    <element id="Procedure.instantiatesUri">
      <path value="Procedure.instantiatesUri" />
      <max value="0" />
    </element>
    <element id="Procedure.basedOn">
      <path value="Procedure.basedOn" />
      <max value="1" />
      <type>
        <code value="Reference" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-servicerequest" />
      </type>
    </element>
    <element id="Procedure.partOf">
      <path value="Procedure.partOf" />
      <max value="0" />
      <type>
        <code value="Reference" />
        <aggregation value="contained" />
      </type>
    </element>
    <element id="Procedure.status">
      <path value="Procedure.status" />
      <patternCode value="completed" />
    </element>
    <element id="Procedure.statusReason">
      <path value="Procedure.statusReason" />
      <max value="0" />
    </element>
    <element id="Procedure.category">
      <path value="Procedure.category" />
      <max value="0" />
    </element>
    <element id="Procedure.code">
      <path value="Procedure.code" />
      <min value="1" />
      <type>
        <code value="CodeableConcept" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept" />
      </type>
    </element>
    <element id="Procedure.subject">
      <path value="Procedure.subject" />
      <type>
        <code value="Reference" />
        <profile value="https://fhir.synapxe.sg/StructureDefinition/profile-reference-patient" />
        <targetProfile value="https://fhir.synapxe.sg/StructureDefinition/profile-patient" />
      </type>
    </element>
    <element id="Procedure.focus">
      <path value="Procedure.focus" />
      <max value="0" />
    </element>
    <element id="Procedure.encounter">
      <path value="Procedure.encounter" />
      <max value="0" />
    </element>
    <element id="Procedure.occurrence[x]">
      <path value="Procedure.occurrence[x]" />
      <max value="0" />
    </element>
    <element id="Procedure.recorded">
      <path value="Procedure.recorded" />
      <max value="0" />
    </element>
    <element id="Procedure.recorder">
      <path value="Procedure.recorder" />
      <max value="0" />
    </element>
    <element id="Procedure.reported[x]">
      <path value="Procedure.reported[x]" />
      <max value="0" />
    </element>
    <element id="Procedure.performer">
      <path value="Procedure.performer" />
      <max value="0" />
    </element>
    <element id="Procedure.location">
      <path value="Procedure.location" />
      <max value="0" />
    </element>
    <element id="Procedure.reason">
      <path value="Procedure.reason" />
      <max value="0" />
    </element>
    <element id="Procedure.bodySite">
      <path value="Procedure.bodySite" />
      <max value="0" />
    </element>
    <element id="Procedure.outcome">
      <path value="Procedure.outcome" />
      <max value="0" />
    </element>
    <element id="Procedure.report">
      <path value="Procedure.report" />
      <max value="0" />
    </element>
    <element id="Procedure.complication">
      <path value="Procedure.complication" />
      <max value="0" />
    </element>
    <element id="Procedure.followUp">
      <path value="Procedure.followUp" />
      <max value="0" />
    </element>
    <element id="Procedure.note">
      <path value="Procedure.note" />
      <max value="0" />
    </element>
    <element id="Procedure.focalDevice">
      <path value="Procedure.focalDevice" />
      <max value="0" />
    </element>
    <element id="Procedure.used">
      <path value="Procedure.used" />
      <max value="0" />
    </element>
    <element id="Procedure.supportingInfo">
      <path value="Procedure.supportingInfo" />
      <max value="0" />
    </element>
  </differential>
</StructureDefinition>