{
  "resourceType": "StructureDefinition",
  "id": "el-patient",
  "url": "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-patient",
  "version": "1.0.0",
  "name": "ELPatient",
  "title": "EL Patient Profile",
  "status": "draft",
  "description": "The profile for the Patient.",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Patient",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Patient",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Patient.meta.tag",
        "path": "Patient.meta.tag",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-metatag-vs"
        }
      },
      {
        "id": "Patient.extension",
        "path": "Patient.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "ordered": false,
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Patient.extension:el-patient-extension",
        "path": "Patient.extension",
        "sliceName": "el-patient-extension",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-patient-extension"
            ]
          }
        ]
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "use"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "3"
      },
      {
        "id": "Patient.name:official",
        "path": "Patient.name",
        "sliceName": "official",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.name:official.use",
        "path": "Patient.name.use",
        "min": 1,
        "patternCode": "official"
      },
      {
        "id": "Patient.name:official.family",
        "path": "Patient.name.family",
        "min": 1
      },
      {
        "id": "Patient.name:official.given",
        "path": "Patient.name.given",
        "min": 1,
        "max": "2"
      },
      {
        "id": "Patient.name:official.prefix",
        "path": "Patient.name.prefix",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.name:official.suffix",
        "path": "Patient.name.suffix",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.name:nickname",
        "path": "Patient.name",
        "sliceName": "nickname",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Patient.name:nickname.use",
        "path": "Patient.name.use",
        "min": 1,
        "patternCode": "nickname"
      },
      {
        "id": "Patient.name:nickname.given",
        "path": "Patient.name.given",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.name:old",
        "path": "Patient.name",
        "sliceName": "old",
        "min": 0,
        "max": "1"
      },
      {
        "id": "Patient.name:old.use",
        "path": "Patient.name.use",
        "min": 1,
        "patternCode": "old"
      },
      {
        "id": "Patient.name:old.given",
        "path": "Patient.name.given",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Patient.telecom.system",
        "path": "Patient.telecom.system",
        "min": 1
      },
      {
        "id": "Patient.telecom.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom.use",
        "path": "Patient.telecom.use",
        "min": 1
      },
      {
        "id": "Patient.telecom.rank",
        "path": "Patient.telecom.rank",
        "min": 1
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1
      },
      {
        "id": "Patient.deceased[x]",
        "path": "Patient.deceased[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "ordered": false,
          "rules": "open"
        }
      },
      {
        "id": "Patient.deceased[x]:deceasedDateTime",
        "path": "Patient.deceased[x]",
        "sliceName": "deceasedDateTime",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Patient.address.extension",
        "path": "Patient.address.extension",
        "min": 1
      },
      {
        "id": "Patient.address.extension:addresstype",
        "path": "Patient.address.extension",
        "sliceName": "addresstype",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-patient-address-type-extension"
            ]
          }
        ]
      },
      {
        "id": "Patient.address.line",
        "path": "Patient.address.line",
        "min": 1,
        "max": "2"
      },
      {
        "id": "Patient.address.city",
        "path": "Patient.address.city",
        "min": 1
      },
      {
        "id": "Patient.address.state",
        "path": "Patient.address.state",
        "min": 1
      },
      {
        "id": "Patient.address.postalCode",
        "path": "Patient.address.postalCode",
        "min": 1
      },
      {
        "id": "Patient.contact",
        "path": "Patient.contact",
        "max": "1"
      },
      {
        "id": "Patient.contact.relationship.coding",
        "path": "Patient.contact.relationship.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://fhir.essilorluxottica.com/fhir/ValueSet/el-relationship-code-vs"
        }
      },
      {
        "id": "Patient.contact.name.text",
        "path": "Patient.contact.name.text",
        "min": 1
      },
      {
        "id": "Patient.contact.telecom.system",
        "path": "Patient.contact.telecom.system",
        "min": 1
      },
      {
        "id": "Patient.contact.telecom.value",
        "path": "Patient.contact.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.generalPractitioner",
        "path": "Patient.generalPractitioner",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "rules": "open"
        },
        "min": 1,
        "max": "2"
      },
      {
        "id": "Patient.generalPractitioner:practice",
        "path": "Patient.generalPractitioner",
        "sliceName": "practice",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-practice"
            ]
          }
        ]
      },
      {
        "id": "Patient.generalPractitioner:practice.extension",
        "path": "Patient.generalPractitioner.extension",
        "min": 1
      },
      {
        "id": "Patient.generalPractitioner:practice.extension:el-organization-reference-type",
        "path": "Patient.generalPractitioner.extension",
        "sliceName": "el-organization-reference-type",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-organization-reference-type-extension"
            ]
          }
        ]
      },
      {
        "id": "Patient.generalPractitioner:practice.reference",
        "path": "Patient.generalPractitioner.reference",
        "min": 1
      },
      {
        "id": "Patient.generalPractitioner:practice.type",
        "path": "Patient.generalPractitioner.type",
        "min": 1,
        "patternUri": "Organization"
      },
      {
        "id": "Patient.generalPractitioner:preferredProvider",
        "path": "Patient.generalPractitioner",
        "sliceName": "preferredProvider",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-practitioner"
            ]
          }
        ]
      },
      {
        "id": "Patient.generalPractitioner:preferredProvider.reference",
        "path": "Patient.generalPractitioner.reference",
        "min": 1
      },
      {
        "id": "Patient.generalPractitioner:preferredProvider.type",
        "path": "Patient.generalPractitioner.type",
        "min": 1,
        "patternUri": "Practitioner"
      },
      {
        "id": "Patient.managingOrganization",
        "path": "Patient.managingOrganization",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-organization"
            ]
          }
        ]
      },
      {
        "id": "Patient.managingOrganization.extension",
        "path": "Patient.managingOrganization.extension",
        "min": 1
      },
      {
        "id": "Patient.managingOrganization.extension:el-organization-reference-type",
        "path": "Patient.managingOrganization.extension",
        "sliceName": "el-organization-reference-type",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://fhir.essilorluxottica.com/fhir/StructureDefinition/el-organization-reference-type-extension"
            ]
          }
        ]
      },
      {
        "id": "Patient.managingOrganization.reference",
        "path": "Patient.managingOrganization.reference",
        "min": 1
      }
    ]
  }
}