{
  "resourceType": "StructureDefinition",
  "id": "room2Patient",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-category",
      "valueString": "Base.Individuals"
    },
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-security-category",
      "valueCode": "patient"
    }
  ],
  "url": "http://example.org/StructureDefinition/room2Patient",
  "version": "1.0.0",
  "name": "Room2PatientProfile",
  "title": "My Favorite Room 2 Patient",
  "status": "active",
  "description": "Always follows recommendations.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "cda",
      "uri": "http://hl7.org/v3/cda",
      "name": "CDA (R2)"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "v2",
      "uri": "http://hl7.org/v2",
      "name": "HL7 v2 Mapping"
    },
    {
      "identity": "loinc",
      "uri": "http://loinc.org",
      "name": "LOINC code for the element"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient",
        "path": "Patient",
        "definition": "This is the element description."
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Patient.extension:birthPlace",
        "path": "Patient.extension",
        "sliceName": "birthPlace",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://hl7.org/fhir/StructureDefinition/patient-birthPlace"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.extension:occupation",
        "path": "Patient.extension",
        "sliceName": "occupation",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://example.org/StructureDefinition/occupation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.extension:occupation.extension:occupationType",
        "path": "Patient.extension.extension",
        "sliceName": "occupationType"
      },
      {
        "id": "Patient.extension:occupation.extension:occupationType.valueCodeableConcept",
        "path": "Patient.extension.extension.valueCodeableConcept",
        "min": 0,
        "max": "1",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://example.org/ValueSet/MyValueSet"
        }
      },
      {
        "id": "Patient.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open",
          "ordered": false,
          "description": "Slice based on the identifier.system value"
        },
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:official",
        "path": "Patient.identifier",
        "sliceName": "official",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:official.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "patternUri": "http://national.registry.org/ids"
      },
      {
        "id": "Patient.identifier:official.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:hospital",
        "path": "Patient.identifier",
        "sliceName": "hospital",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Patient.identifier:hospital.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "patternUri": "http://optumcare.com/ids"
      },
      {
        "id": "Patient.identifier:hospital.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "http://example.org/StructureDefinition/room2HumanName"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "mustSupport": true
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "constraint": [
          {
            "key": "PatientAddressInvariant",
            "severity": "error",
            "human": "If the patient has a temporary address, the period this address is in use should be filled in",
            "expression": "(use = 'temp') implies period.exists()",
            "xpath": "f:use or f:period",
            "source": "http://example.org/StructureDefinition/room2Patient"
          }
        ]
      }
    ]
  }
}