{
  "resourceType": "StructureDefinition",
  "id": "MyPatient",
  "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://MyProject.pt/MyPatient",
  "version": "2.0",
  "name": "MyPatient",
  "status": "active",
  "date": "2023-08-22T16:08:01.8045808+00:00",
  "fhirVersion": "4.3.0",
  "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.identifier",
        "path": "Patient.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "description": "Slice based on the system value",
          "rules": "open"
        },
        "min": 1
      },
      {
        "id": "Patient.identifier:NHC",
        "path": "Patient.identifier",
        "sliceName": "NHC",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://example.org/StructureDefinition/MyIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:NHC.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://Hospital.org/NHC"
      },
      {
        "id": "Patient.identifier:NHC.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:SNS",
        "path": "Patient.identifier",
        "sliceName": "SNS",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://example.org/StructureDefinition/MyIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:SNS.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://sns.pt/SNS"
      },
      {
        "id": "Patient.identifier:SNS.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:CZ",
        "path": "Patient.identifier",
        "sliceName": "CZ",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://example.org/StructureDefinition/MyIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:CZ.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://irn.pt/CC"
      },
      {
        "id": "Patient.identifier:CZ.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:PPN",
        "path": "Patient.identifier",
        "sliceName": "PPN",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://example.org/StructureDefinition/MyIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:PPN.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://irn.pt/PEP"
      },
      {
        "id": "Patient.identifier:PPN.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.identifier:TAX",
        "path": "Patient.identifier",
        "sliceName": "TAX",
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "http://example.org/StructureDefinition/MyIdentifier"
            ]
          }
        ]
      },
      {
        "id": "Patient.identifier:TAX.system",
        "path": "Patient.identifier.system",
        "min": 1,
        "fixedUri": "http://AT.pt/NIF"
      },
      {
        "id": "Patient.identifier:TAX.value",
        "path": "Patient.identifier.value",
        "min": 1
      },
      {
        "id": "Patient.active",
        "path": "Patient.active",
        "min": 1
      },
      {
        "id": "Patient.name",
        "path": "Patient.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "http://example.org/StructureDefinition/MyHumanName"
            ]
          }
        ]
      },
      {
        "id": "Patient.telecom",
        "path": "Patient.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "description": "Slice based on the system value",
          "rules": "open"
        }
      },
      {
        "id": "Patient.telecom:Phone",
        "path": "Patient.telecom",
        "sliceName": "Phone",
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://example.org/StructureDefinition/MyTelecom"
            ]
          }
        ]
      },
      {
        "id": "Patient.telecom:Phone.system",
        "path": "Patient.telecom.system",
        "min": 1,
        "fixedCode": "phone"
      },
      {
        "id": "Patient.telecom:Phone.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:Phone2",
        "path": "Patient.telecom",
        "sliceName": "Phone2",
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://example.org/StructureDefinition/MyTelecom"
            ]
          }
        ]
      },
      {
        "id": "Patient.telecom:Phone2.system",
        "path": "Patient.telecom.system",
        "min": 1,
        "fixedCode": "phone"
      },
      {
        "id": "Patient.telecom:Phone2.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.telecom:Email",
        "path": "Patient.telecom",
        "sliceName": "Email",
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://example.org/StructureDefinition/MyTelecom"
            ]
          }
        ]
      },
      {
        "id": "Patient.telecom:Email.system",
        "path": "Patient.telecom.system",
        "min": 1,
        "fixedCode": "email"
      },
      {
        "id": "Patient.telecom:Email.value",
        "path": "Patient.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.gender",
        "path": "Patient.gender",
        "min": 1,
        "binding": {
          "strength": "required",
          "valueSet": "https://MyProject.pt/Gender"
        }
      },
      {
        "id": "Patient.birthDate",
        "path": "Patient.birthDate",
        "min": 1
      },
      {
        "id": "Patient.deceased[x]",
        "path": "Patient.deceased[x]",
        "max": "0"
      },
      {
        "id": "Patient.address",
        "path": "Patient.address",
        "max": "0"
      },
      {
        "id": "Patient.maritalStatus",
        "path": "Patient.maritalStatus",
        "binding": {
          "strength": "extensible",
          "valueSet": "https://MyProject.pt/Maritalstatus"
        }
      },
      {
        "id": "Patient.multipleBirth[x]",
        "path": "Patient.multipleBirth[x]",
        "max": "0"
      },
      {
        "id": "Patient.photo",
        "path": "Patient.photo",
        "max": "0"
      },
      {
        "id": "Patient.contact.relationship",
        "path": "Patient.contact.relationship",
        "max": "0"
      },
      {
        "id": "Patient.contact.name",
        "path": "Patient.contact.name",
        "min": 1,
        "type": [
          {
            "code": "HumanName",
            "profile": [
              "http://example.org/StructureDefinition/MyHumanName"
            ]
          }
        ]
      },
      {
        "id": "Patient.contact.telecom",
        "path": "Patient.contact.telecom",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "description": "Slice based on the system value",
          "rules": "open"
        }
      },
      {
        "id": "Patient.contact.telecom:ContactPhone",
        "path": "Patient.contact.telecom",
        "sliceName": "ContactPhone",
        "max": "1",
        "type": [
          {
            "code": "ContactPoint",
            "profile": [
              "http://example.org/StructureDefinition/MyTelecom"
            ]
          }
        ]
      },
      {
        "id": "Patient.contact.telecom:ContactPhone.system",
        "path": "Patient.contact.telecom.system",
        "min": 1,
        "fixedCode": "phone"
      },
      {
        "id": "Patient.contact.telecom:ContactPhone.value",
        "path": "Patient.contact.telecom.value",
        "min": 1
      },
      {
        "id": "Patient.contact.address",
        "path": "Patient.contact.address",
        "max": "0"
      },
      {
        "id": "Patient.contact.gender",
        "path": "Patient.contact.gender",
        "binding": {
          "strength": "required",
          "valueSet": "https://MyProject.pt/Gender"
        }
      },
      {
        "id": "Patient.contact.organization",
        "path": "Patient.contact.organization",
        "max": "0"
      },
      {
        "id": "Patient.contact.period",
        "path": "Patient.contact.period",
        "max": "0"
      },
      {
        "id": "Patient.communication",
        "path": "Patient.communication",
        "max": "0"
      },
      {
        "id": "Patient.generalPractitioner",
        "path": "Patient.generalPractitioner",
        "max": "0"
      },
      {
        "id": "Patient.managingOrganization",
        "path": "Patient.managingOrganization",
        "max": "0"
      },
      {
        "id": "Patient.link",
        "path": "Patient.link",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "type"
            }
          ],
          "description": "Slice based on the type value",
          "rules": "open"
        },
        "max": "1"
      },
      {
        "id": "Patient.link:Replacer",
        "path": "Patient.link",
        "sliceName": "Replacer",
        "max": "1"
      },
      {
        "id": "Patient.link:Replacer.extension",
        "path": "Patient.link.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        },
        "min": 0
      },
      {
        "id": "Patient.link:Replacer.extension:replacedNHC",
        "path": "Patient.link.extension",
        "sliceName": "replacedNHC",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://MyProject.pt/PatientLinkExt"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.link:Replacer.extension:mergedOn",
        "path": "Patient.link.extension",
        "sliceName": "mergedOn",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://MyProject.pt/PatientLinkDateExt"
            ]
          }
        ],
        "isModifier": false
      },
      {
        "id": "Patient.link:Replacer.other",
        "path": "Patient.link.other",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://MyProject.pt/MyPatient"
            ]
          }
        ]
      },
      {
        "id": "Patient.link:Replacer.type",
        "path": "Patient.link.type",
        "fixedCode": "replaces"
      }
    ]
  }
}