{
  "resourceType": "StructureDefinition",
  "id": "HVOUppdragLogical",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics",
      "valueCode": "can-be-target"
    }
  ],
  "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOUppdragLogical",
  "name": "HVOUppdragLogical",
  "title": "Uppdrag",
  "status": "draft",
  "description": "Klassen uppdrag håller information om uppgift med ett uttalat mål som någon tilldelats att utföra under en längre (ofta inte bestämd) tid.",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "UppdragToHVOOrganizationAffiliation",
      "uri": "HVOOrganizationAffiliation"
    }
  ],
  "kind": "logical",
  "abstract": false,
  "type": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOUppdragLogical",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "HVOUppdragLogical",
        "path": "HVOUppdragLogical",
        "short": "Uppdrag",
        "definition": "Klassen uppdrag håller information om uppgift med ett uttalat mål som någon tilldelats att utföra under en längre (ofta inte bestämd) tid.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "HVOUppdragLogical",
          "min": 0,
          "max": "*"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.typ",
        "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": "HVOUppdragLogical.typ",
        "short": "typ",
        "definition": "Angivelse av kod för typ av uppdrag.",
        "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": 0,
        "max": "*",
        "base": {
          "path": "HVOUppdragLogical.typ",
          "min": 0,
          "max": "*"
        },
        "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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.code"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.giltigFrom",
        "path": "HVOUppdragLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken uppdraget är aktivt.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "HVOUppdragLogical.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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.period.start"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.giltigTom",
        "path": "HVOUppdragLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då uppdraget upphör eller är avklarat. Ska ej anges när uppdragets sluttidpunkt är okänd.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "HVOUppdragLogical.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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.period.end"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.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": "HVOUppdragLogical.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": "HVOUppdragLogical.har",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTelekommunikationLogical"
            ]
          }
        ],
        "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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.contact.telecom"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.omfattar",
        "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": "HVOUppdragLogical.omfattar",
        "short": "omfattar",
        "definition": "omfattar",
        "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": "HVOUppdragLogical.omfattar",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTjanstLogical"
            ]
          }
        ],
        "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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.healthcareService(HVOService)"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.harUtforare",
        "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": "HVOUppdragLogical.harUtforare",
        "short": "harUtforare",
        "definition": "harUtforare",
        "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": 1,
        "max": "1",
        "base": {
          "path": "HVOUppdragLogical.harUtforare",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical"
            ]
          }
        ],
        "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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.participatingOrganization(HVOOrganization)"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.harBestallare",
        "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": "HVOUppdragLogical.harBestallare",
        "short": "harBestallare",
        "definition": "harBestallare",
        "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": 1,
        "max": "1",
        "base": {
          "path": "HVOUppdragLogical.harBestallare",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical"
            ]
          }
        ],
        "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": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.organization(HVOOrganization)"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "HVOUppdragLogical",
        "path": "HVOUppdragLogical",
        "short": "Uppdrag",
        "definition": "Klassen uppdrag håller information om uppgift med ett uttalat mål som någon tilldelats att utföra under en längre (ofta inte bestämd) tid."
      },
      {
        "id": "HVOUppdragLogical.typ",
        "path": "HVOUppdragLogical.typ",
        "short": "typ",
        "definition": "Angivelse av kod för typ av uppdrag.",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.code"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.giltigFrom",
        "path": "HVOUppdragLogical.giltigFrom",
        "short": "giltigFrom",
        "definition": "Angivelse av den tidpunkt från och med vilken uppdraget är aktivt.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.period.start"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.giltigTom",
        "path": "HVOUppdragLogical.giltigTom",
        "short": "giltigTom",
        "definition": "Angivelse av den tidpunkt då uppdraget upphör eller är avklarat. Ska ej anges när uppdragets sluttidpunkt är okänd.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "time"
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.period.end"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.har",
        "path": "HVOUppdragLogical.har",
        "short": "har",
        "definition": "har",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTelekommunikationLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.contact.telecom"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.omfattar",
        "path": "HVOUppdragLogical.omfattar",
        "short": "omfattar",
        "definition": "omfattar",
        "min": 0,
        "max": "*",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOTjanstLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.healthcareService(HVOService)"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.harUtforare",
        "path": "HVOUppdragLogical.harUtforare",
        "short": "harUtforare",
        "definition": "harUtforare",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.participatingOrganization(HVOOrganization)"
          }
        ]
      },
      {
        "id": "HVOUppdragLogical.harBestallare",
        "path": "HVOUppdragLogical.harBestallare",
        "short": "harBestallare",
        "definition": "harBestallare",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOOrganisationLogical"
            ]
          }
        ],
        "mapping": [
          {
            "identity": "UppdragToHVOOrganizationAffiliation",
            "map": "HVOOrganizationAffiliation.organization(HVOOrganization)"
          }
        ]
      }
    ]
  }
}