{
  "resourceType": "StructureDefinition",
  "id": "SHCKontaktuppgiftPersonLogical",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics",
      "valueCode": "can-be-target"
    }
  ],
  "url": "http://electronichealth.se/fhir/shc/StructureDefinition/SHCKontaktuppgiftPersonLogical",
  "name": "SHCKontaktuppgiftPersonLogical",
  "title": "Kontaktuppgift person",
  "status": "draft",
  "description": "Klassen kontaktuppgift person håller information om detaljerade kontaktuppgifter som hör till en individen.",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "KontaktuppgiftPersonToSHCPerson.address",
      "uri": "SHCPerson.contact"
    }
  ],
  "kind": "logical",
  "abstract": false,
  "type": "http://electronichealth.se/fhir/shc/StructureDefinition/SHCKontaktuppgiftPersonLogical",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "SHCKontaktuppgiftPersonLogical",
        "path": "SHCKontaktuppgiftPersonLogical",
        "short": "Kontaktuppgift person",
        "definition": "Klassen kontaktuppgift person håller information om detaljerade kontaktuppgifter som hör till en individen.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical",
          "min": 0,
          "max": "*"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.syfte",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "SHCKontaktuppgiftPersonLogical.syfte",
        "short": "syfte",
        "definition": "kod för syfte i vilket kontaktuppgiften kan användas",
        "comment": "Codes may be defined very casually in enumerations or code lists, up to very formal definitions such as SNOMED CT - see the HL7 v3 Core Principles for more information.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.syfte",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Coding"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "cod-1",
            "severity": "warning",
            "human": "A Coding SHOULD NOT have a display unless a code is also present.  Computation on Coding.display alone is generally unsafe.  Consider using CodeableConcept.text",
            "expression": "code.exists().not() implies display.exists().not()",
            "source": "http://hl7.org/fhir/StructureDefinition/Coding"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "CE/CNE/CWE subset one of the sets of component 1-3 or 4-6"
          },
          {
            "identity": "rim",
            "map": "CV"
          },
          {
            "identity": "orim",
            "map": "fhir:Coding rdfs:subClassOf dt:CDCoding"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adressrad",
        "path": "SHCKontaktuppgiftPersonLogical.adressrad",
        "short": "adress.rad",
        "definition": "Angivelse av en eller flera rader som utgör en adress. Exempelvis gata, gatunummer, lägenhetsnummer, våning. Vid flera rader ska de anges i den ordning de ska skrivas på en adresslapp.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 0,
        "max": "*",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.adressrad",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.line"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adresspostnummer",
        "path": "SHCKontaktuppgiftPersonLogical.adresspostnummer",
        "short": "adress.postnummer",
        "definition": "Angivelse av postnummer",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 0,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.adresspostnummer",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.postalCode"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adresspostort",
        "path": "SHCKontaktuppgiftPersonLogical.adresspostort",
        "short": "adress.postort",
        "definition": "Angivelse av postort",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 0,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.adresspostort",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.city"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adressland",
        "path": "SHCKontaktuppgiftPersonLogical.adressland",
        "short": "adress.land",
        "definition": "Angivelse av land. (Enl. ISO 3166?)",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 0,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.adressland",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.country"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.giltigFrom",
        "path": "SHCKontaktuppgiftPersonLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken kontaktuppgiften gäller.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.giltigFrom",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "time"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.period.start"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.namn",
        "path": "SHCKontaktuppgiftPersonLogical.namn",
        "short": "namn",
        "definition": "namn som är associerat med personen",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 0,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.namn",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.giltigTom",
        "path": "SHCKontaktuppgiftPersonLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då kontaktuppgiften upphör att gälla på så sätt att uppgiften inte längre stämmer för den organisation eller person som avses. Bör lämnas tom ifall att uppgiften fortfarande är giltig.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.giltigTom",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "time"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.period.end"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.arEnDelAv",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-standards-status",
            "valueCode": "normative"
          },
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-normative-version",
            "valueCode": "4.0.0"
          }
        ],
        "path": "SHCKontaktuppgiftPersonLogical.arEnDelAv",
        "short": "är en del av",
        "definition": "är en del av",
        "comment": "References SHALL be a reference to an actual FHIR resource, and SHALL be resolvable (allowing for access control, temporary unavailability, etc.). Resolution can be either by retrieval from the URL, or, where applicable by resource type, by treating an absolute reference as a canonical URL and looking it up in a local registry/repository.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "SHCKontaktuppgiftPersonLogical.arEnDelAv",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/shc/StructureDefinition/SHCTelekommunikationPersonLogical"
            ]
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ref-1",
            "severity": "error",
            "human": "SHALL have a contained resource if a local reference is provided",
            "expression": "reference.exists()  implies (reference.startsWith('#').not() or (reference.substring(1).trace('url') in %rootResource.contained.id.trace('ids')) or (reference='#' and %rootResource!=%resource))",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          },
          {
            "key": "ref-2",
            "severity": "error",
            "human": "At least one of reference, identifier and display SHALL be present (unless an extension is provided).",
            "expression": "reference.exists() or identifier.exists() or display.exists() or extension.exists()",
            "source": "http://hl7.org/fhir/StructureDefinition/Reference"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "rim",
            "map": "The target of a resource reference is a RIM entry point (Act, Role, or Entity)"
          },
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "SHCPerson.telecom"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "SHCKontaktuppgiftPersonLogical",
        "path": "SHCKontaktuppgiftPersonLogical",
        "short": "Kontaktuppgift person",
        "definition": "Klassen kontaktuppgift person håller information om detaljerade kontaktuppgifter som hör till en individen."
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.syfte",
        "path": "SHCKontaktuppgiftPersonLogical.syfte",
        "short": "syfte",
        "definition": "kod för syfte i vilket kontaktuppgiften kan användas",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adressrad",
        "path": "SHCKontaktuppgiftPersonLogical.adressrad",
        "short": "adress.rad",
        "definition": "Angivelse av en eller flera rader som utgör en adress. Exempelvis gata, gatunummer, lägenhetsnummer, våning. Vid flera rader ska de anges i den ordning de ska skrivas på en adresslapp.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.line"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adresspostnummer",
        "path": "SHCKontaktuppgiftPersonLogical.adresspostnummer",
        "short": "adress.postnummer",
        "definition": "Angivelse av postnummer",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.postalCode"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adresspostort",
        "path": "SHCKontaktuppgiftPersonLogical.adresspostort",
        "short": "adress.postort",
        "definition": "Angivelse av postort",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.city"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.adressland",
        "path": "SHCKontaktuppgiftPersonLogical.adressland",
        "short": "adress.land",
        "definition": "Angivelse av land. (Enl. ISO 3166?)",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.country"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.giltigFrom",
        "path": "SHCKontaktuppgiftPersonLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken kontaktuppgiften gäller.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.period.start"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.namn",
        "path": "SHCKontaktuppgiftPersonLogical.namn",
        "short": "namn",
        "definition": "namn som är associerat med personen",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.giltigTom",
        "path": "SHCKontaktuppgiftPersonLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då kontaktuppgiften upphör att gälla på så sätt att uppgiften inte längre stämmer för den organisation eller person som avses. Bör lämnas tom ifall att uppgiften fortfarande är giltig.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "(SHCPerson)address.period.end"
          }
        ]
      },
      {
        "id": "SHCKontaktuppgiftPersonLogical.arEnDelAv",
        "path": "SHCKontaktuppgiftPersonLogical.arEnDelAv",
        "short": "är en del av",
        "definition": "är en del av",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/shc/StructureDefinition/SHCTelekommunikationPersonLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "KontaktuppgiftPersonToSHCPerson.address",
            "map": "SHCPerson.telecom"
          }
        ]
      }
    ]
  }
}