{
  "resourceType": "StructureDefinition",
  "id": "problem-closed-by",
  "url": "http://hl7.org/fhir/StructureDefinition/problem-closed-by",
  "version": "4.0",
  "name": "problem-closed-by",
  "title": "Problem Closed By",
  "status": "draft",
  "publisher": "Orion Health",
  "description": "Indicates the practitioner who closed a problem",
  "purpose": "This extension indicates the practitioner who closed a problem. This can be used in conjunction with the problem-closed-reason and problem-closed-date extensions",
  "fhirVersion": "4.0",
  "kind": "complex-type",
  "abstract": false,
  "type": "Extension",
  "snapshot": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "max": "1",
        "base": {
          "path": "Extension",
          "max": "1"
        }
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "base": {
          "path": "Extension.url"
        },
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/problem-closed-by"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "Indicates the practitioner who closed a problem",
        "definition": "Set the practitioner who closed a problem",
        "min": 1,
        "max": "1",
        "base": {
          "path": "Extension.value[x]",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Practitioner"
          }
        ],
        "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()",
            "xpath": "not(parent::f:contained and f:contained)",
            "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()",
            "xpath": "not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))",
            "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().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()",
            "xpath": "not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice",
                "valueBoolean": true
              },
              {
                "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation",
                "valueMarkdown": "When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."
              }
            ],
            "key": "dom-6",
            "severity": "warning",
            "human": "A resource should have narrative for robust management",
            "expression": "text.`div`.exists()",
            "xpath": "exists(f:text/h:div)",
            "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()",
            "xpath": "not(exists(f:contained/*/f:meta/f:security))",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity. Role, or Act"
          },
          {
            "identity": "v2",
            "map": "PRD (as one example)"
          },
          {
            "identity": "rim",
            "map": "Role"
          },
          {
            "identity": "servd",
            "map": "Provider"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "Extension",
        "path": "Extension",
        "max": "1"
      },
      {
        "id": "Extension.url",
        "path": "Extension.url",
        "fixedUri": "http://hl7.org/fhir/StructureDefinition/problem-closed-by"
      },
      {
        "id": "Extension.value[x]",
        "path": "Extension.value[x]",
        "short": "Indicates the practitioner who closed a problem",
        "definition": "Set the practitioner who closed a problem",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Practitioner"
          }
        ]
      }
    ]
  }
}