{
  "resourceType": "StructureDefinition",
  "id": "shr-base-Subject-extension",
  "text": {
    "status": "generated",
    "div": "<div xmlns=\"http://www.w3.org/1999/xhtml\">\n  <p><b>SHR Subject Extension</b></p>\n  <p>The person or thing that this entry relates to, usually the Person of Record. However, not all entries have health information specifically about the patient, but in different contexts, could refer to a fetus, family member (living or dead), device, location, organization, finding, condition, or intervention.</p>\n</div>"
  },
  "url": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-base-Subject-extension",
  "identifier": [
    {
      "system": "http://standardhealthrecord.org",
      "value": "shr.base.Subject"
    }
  ],
  "version": "0.0.1",
  "name": "SHR Subject Extension",
  "title": "SHR Subject Extension",
  "status": "draft",
  "date": "2017-12-20",
  "publisher": "The MITRE Corporation: Standard Health Record Collaborative",
  "contact": [
    {
      "telecom": [
        {
          "system": "url",
          "value": "http://standardhealthrecord.org"
        }
      ]
    }
  ],
  "description": "The person or thing that this entry relates to, usually the Person of Record. However, not all entries have health information specifically about the patient, but in different contexts, could refer to a fetus, family member (living or dead), device, location, organization, finding, condition, or intervention.",
  "fhirVersion": "3.0.1",
  "kind": "complex-type",
  "abstract": false,
  "contextType": "resource",
  "context": [
    "*"
  ],
  "type": "Extension",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Extension",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Extension:subject",
        "path": "Extension",
        "short": "SHR Subject Extension",
        "definition": "The person or thing that this entry relates to, usually the Person of Record. However, not all entries have health information specifically about the patient, but in different contexts, could refer to a fetus, family member (living or dead), device, location, organization, finding, condition, or intervention.",
        "min": 0,
        "max": "*",
        "constraint": [
          {
            "key": "choice-1",
            "severity": "error",
            "human": "shr-base-Subject-extension SHALL have either extension('patient') or extension('group') or extension('device') or extension('location') or extension('relatedperson') or extension('organization')",
            "expression": "( extension('patient').url | extension('group').url | extension('device').url | extension('location').url | extension('relatedperson').url | extension('organization').url ).distinct().count() == 1"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:patient",
        "path": "Extension.extension",
        "sliceName": "patient",
        "definition": "A person in the role of a patient, including extended demographic information about the subject of this health record.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-Patient-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:group",
        "path": "Extension.extension",
        "sliceName": "group",
        "definition": "A set of entities (personnel, material, or places) to be considered together. May be a pool of like-type resources, a team, or combination of personnel, material and places.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-Group-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:device",
        "path": "Extension.extension",
        "sliceName": "device",
        "definition": "A specific durable physical device used in diagnosis or treatment. The value is the coding for a type of device, for example, a CPAP machine. The same device might be used on multiple patients.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-device-Device-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:location",
        "path": "Extension.extension",
        "sliceName": "location",
        "definition": "A position, site, or point in space where something can be found.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-core-Location-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:relatedperson",
        "path": "Extension.extension",
        "sliceName": "relatedperson",
        "definition": "A person in a role defined in relationship to a patient",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-RelatedPerson-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.extension:organization",
        "path": "Extension.extension",
        "sliceName": "organization",
        "definition": "A social or legal structure formed by human beings.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-entity-Organization-extension"
          }
        ]
      },
      {
        "id": "Extension:subject.url",
        "path": "Extension.url",
        "type": [
          {
            "code": "uri"
          }
        ],
        "fixedUri": "http://standardhealthrecord.org/fhir/StructureDefinition/shr-base-Subject-extension"
      },
      {
        "id": "Extension:subject.value[x]",
        "path": "Extension.value[x]",
        "min": 0,
        "max": "0"
      }
    ]
  }
}