{
  "resourceType": "StructureDefinition",
  "url": "https://fhir.synapxe.sg/StructureDefinition/profile-ed-procedure",
  "name": "Procedure",
  "status": "active",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "Procedure",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Procedure",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Procedure.contained",
        "path": "Procedure.contained",
        "short": "An action that is being or was performed on an individual or entity",
        "definition": "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": "dom-2",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources",
            "expression": "contained.contained.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-4",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",
            "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-3",
            "severity": "error",
            "human": "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": "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": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-6",
            "severity": "warning",
            "human": "A resource should have narrative for robust management",
            "expression": "text.`div`.exists()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-5",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a security label",
            "expression": "contained.meta.security.empty()",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "Entity. Role, or Act"
          },
          {
            "identity": "rim",
            "map": "N/A"
          },
          {
            "identity": "rim",
            "map": "Entity, Role, or Act"
          },
          {
            "identity": "workflow",
            "map": "Event"
          },
          {
            "identity": "w5",
            "map": "clinical.general"
          },
          {
            "identity": "rim",
            "map": "Procedure[moodCode=EVN]"
          }
        ]
      },
      {
        "id": "Procedure.identifier",
        "path": "Procedure.identifier",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier"
            ]
          }
        ]
      },
      {
        "id": "Procedure.identifier.system",
        "path": "Procedure.identifier.system",
        "fixedUri": "https://fhir.synapxe.sg/NamingSystem/procedure-id"
      },
      {
        "id": "Procedure.instantiatesCanonical",
        "path": "Procedure.instantiatesCanonical",
        "max": "0"
      },
      {
        "id": "Procedure.instantiatesUri",
        "path": "Procedure.instantiatesUri",
        "max": "0"
      },
      {
        "id": "Procedure.basedOn",
        "path": "Procedure.basedOn",
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-servicerequest"
            ]
          }
        ]
      },
      {
        "id": "Procedure.partOf",
        "path": "Procedure.partOf",
        "max": "0",
        "type": [
          {
            "code": "Reference",
            "aggregation": [
              "contained"
            ]
          }
        ]
      },
      {
        "id": "Procedure.status",
        "path": "Procedure.status",
        "patternCode": "completed"
      },
      {
        "id": "Procedure.statusReason",
        "path": "Procedure.statusReason",
        "max": "0"
      },
      {
        "id": "Procedure.category",
        "path": "Procedure.category",
        "max": "0"
      },
      {
        "id": "Procedure.code",
        "path": "Procedure.code",
        "min": 1,
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ]
      },
      {
        "id": "Procedure.subject",
        "path": "Procedure.subject",
        "type": [
          {
            "code": "Reference",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-reference-patient"
            ],
            "targetProfile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-patient"
            ]
          }
        ]
      },
      {
        "id": "Procedure.focus",
        "path": "Procedure.focus",
        "max": "0"
      },
      {
        "id": "Procedure.encounter",
        "path": "Procedure.encounter",
        "max": "0"
      },
      {
        "id": "Procedure.occurrence[x]",
        "path": "Procedure.occurrence[x]",
        "max": "0"
      },
      {
        "id": "Procedure.recorded",
        "path": "Procedure.recorded",
        "max": "0"
      },
      {
        "id": "Procedure.recorder",
        "path": "Procedure.recorder",
        "max": "0"
      },
      {
        "id": "Procedure.reported[x]",
        "path": "Procedure.reported[x]",
        "max": "0"
      },
      {
        "id": "Procedure.performer",
        "path": "Procedure.performer",
        "max": "0"
      },
      {
        "id": "Procedure.location",
        "path": "Procedure.location",
        "max": "0"
      },
      {
        "id": "Procedure.reason",
        "path": "Procedure.reason",
        "max": "0"
      },
      {
        "id": "Procedure.bodySite",
        "path": "Procedure.bodySite",
        "max": "0"
      },
      {
        "id": "Procedure.outcome",
        "path": "Procedure.outcome",
        "max": "0"
      },
      {
        "id": "Procedure.report",
        "path": "Procedure.report",
        "max": "0"
      },
      {
        "id": "Procedure.complication",
        "path": "Procedure.complication",
        "max": "0"
      },
      {
        "id": "Procedure.followUp",
        "path": "Procedure.followUp",
        "max": "0"
      },
      {
        "id": "Procedure.note",
        "path": "Procedure.note",
        "max": "0"
      },
      {
        "id": "Procedure.focalDevice",
        "path": "Procedure.focalDevice",
        "max": "0"
      },
      {
        "id": "Procedure.used",
        "path": "Procedure.used",
        "max": "0"
      },
      {
        "id": "Procedure.supportingInfo",
        "path": "Procedure.supportingInfo",
        "max": "0"
      }
    ]
  }
}