{
  "resourceType": "StructureDefinition",
  "id": "related-person-data-access",
  "url": "http://electronichealth.se/fhir/NDI/StructureDefinition/related-person-data-access",
  "version": "0.1.0",
  "name": "RelatedPersonDataAccess",
  "status": "draft",
  "description": "Profile for Related Person in a data access domain.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "RelatedPerson",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/RelatedPerson",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "RelatedPerson.identifier",
        "path": "RelatedPerson.identifier",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open",
          "ordered": false,
          "description": "Slice on Identifier based on the system value"
        },
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.identifier.system",
        "path": "RelatedPerson.identifier.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.identifier.value",
        "path": "RelatedPerson.identifier.value",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.identifier:personalIdentityNumber",
        "path": "RelatedPerson.identifier",
        "sliceName": "personalIdentityNumber",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.identifier:personalIdentityNumber.system",
        "path": "RelatedPerson.identifier.system",
        "fixedUri": "http://electronichealth.se/identifier/personnummer"
      },
      {
        "id": "RelatedPerson.identifier:coordinationNumber",
        "path": "RelatedPerson.identifier",
        "sliceName": "coordinationNumber",
        "min": 0,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.identifier:coordinationNumber.system",
        "path": "RelatedPerson.identifier.system",
        "fixedUri": "http://electronichealth.se/identifier/samordningsnummer"
      },
      {
        "id": "RelatedPerson.patient",
        "path": "RelatedPerson.patient",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/NDI/StructureDefinition/patient-data-access"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.relationship",
        "path": "RelatedPerson.relationship",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/NDI/ValueSet/da-related-person-relationship"
        }
      },
      {
        "id": "RelatedPerson.relationship.coding",
        "path": "RelatedPerson.relationship.coding",
        "min": 1,
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.relationship.coding.system",
        "path": "RelatedPerson.relationship.coding.system",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.relationship.coding.code",
        "path": "RelatedPerson.relationship.coding.code",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "RelatedPerson.name",
        "path": "RelatedPerson.name",
        "max": "1",
        "mustSupport": true
      }
    ]
  }
}