{
  "resourceType": "StructureDefinition",
  "id": "HVOPersonrollLogical",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics",
      "valueCode": "can-be-target"
    }
  ],
  "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPersonrollLogical",
  "name": "HVOPersonrollLogical",
  "title": "Personroll",
  "status": "draft",
  "description": "Klassen personroll håller information om en roll för en viss person.",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "PersonrollToHVOPractitionerRole",
      "uri": "HVOPractitionerRole"
    }
  ],
  "kind": "logical",
  "abstract": false,
  "type": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPersonrollLogical",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "HVOPersonrollLogical",
        "path": "HVOPersonrollLogical",
        "short": "Personroll",
        "definition": "Klassen personroll håller information om en roll för en viss person.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "HVOPersonrollLogical",
          "min": 0,
          "max": "*"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.kod",
        "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": "HVOPersonrollLogical.kod",
        "short": "kod",
        "definition": "Angivelse av kod för personrollen.",
        "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": "HVOPersonrollLogical.kod",
          "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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.code"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.giltigFrom",
        "path": "HVOPersonrollLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken en viss person har rollen.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "HVOPersonrollLogical.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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.period.start"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.giltigTom",
        "path": "HVOPersonrollLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då en viss person upphör att ha rollen. Ska ej anges om denna tidpunkt är okänd.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "HVOPersonrollLogical.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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.period.end"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.har",
        "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": "HVOPersonrollLogical.har",
        "short": "har",
        "definition": "har",
        "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": "HVOPersonrollLogical.har",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOKontaktuppgiftLogical"
            ]
          }
        ],
        "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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.contact"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.tillhor",
        "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": "HVOPersonrollLogical.tillhor",
        "short": "tillhor",
        "definition": "tillhor",
        "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": "1",
        "base": {
          "path": "HVOPersonrollLogical.tillhor",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical",
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisatoriskEnhetLogical"
            ]
          }
        ],
        "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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.organization(HVOOrganization or HVOOrganizationalUnit)"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.antar",
        "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": "HVOPersonrollLogical.antar",
        "short": "antar",
        "definition": "antar",
        "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": "1",
        "base": {
          "path": "HVOPersonrollLogical.antar",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPersonLogical"
            ]
          }
        ],
        "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": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.practitioner(HVOPractitioner)"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "HVOPersonrollLogical",
        "path": "HVOPersonrollLogical",
        "short": "Personroll",
        "definition": "Klassen personroll håller information om en roll för en viss person."
      },
      {
        "id": "HVOPersonrollLogical.kod",
        "path": "HVOPersonrollLogical.kod",
        "short": "kod",
        "definition": "Angivelse av kod för personrollen.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.code"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.giltigFrom",
        "path": "HVOPersonrollLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken en viss person har rollen.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.period.start"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.giltigTom",
        "path": "HVOPersonrollLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då en viss person upphör att ha rollen. Ska ej anges om denna tidpunkt är okänd.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.period.end"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.har",
        "path": "HVOPersonrollLogical.har",
        "short": "har",
        "definition": "har",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOKontaktuppgiftLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.contact"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.tillhor",
        "path": "HVOPersonrollLogical.tillhor",
        "short": "tillhor",
        "definition": "tillhor",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical",
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisatoriskEnhetLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.organization(HVOOrganization or HVOOrganizationalUnit)"
          }
        ]
      },
      {
        "id": "HVOPersonrollLogical.antar",
        "path": "HVOPersonrollLogical.antar",
        "short": "antar",
        "definition": "antar",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOPersonLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "PersonrollToHVOPractitionerRole",
            "map": "HVOPractitionerRole.practitioner(HVOPractitioner)"
          }
        ]
      }
    ]
  }
}