{
  "resourceType": "StructureDefinition",
  "id": "HVOVillkorLogical",
  "extension": [
    {
      "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-type-characteristics",
      "valueCode": "can-be-target"
    }
  ],
  "url": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical",
  "name": "HVOVillkorLogical",
  "title": "Villkor",
  "status": "draft",
  "description": "Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst.",
  "fhirVersion": "5.0.0",
  "mapping": [
    {
      "identity": "VillkorToHVOeligbilityValue",
      "uri": "HVOeligbilityValue"
    }
  ],
  "kind": "logical",
  "abstract": false,
  "type": "http://electronichealth.se/fhir/hvo/StructureDefinition/HVOVillkorLogical",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Base",
  "derivation": "specialization",
  "snapshot": {
    "element": [
      {
        "id": "HVOVillkorLogical",
        "path": "HVOVillkorLogical",
        "short": "Villkor",
        "definition": "Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "HVOVillkorLogical",
          "min": 0,
          "max": "*"
        },
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.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": "HVOVillkorLogical.kod",
        "short": "kod",
        "definition": "Angivelse av kod för villkor som behöver uppfyllas för att vara behörig att ta del av tjänsten.",
        "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": "HVOVillkorLogical.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": "VillkorToHVOeligbilityValue",
            "map": "HVOEligbilityGroup.characteristic.code"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.beskrivning",
        "path": "HVOVillkorLogical.beskrivning",
        "short": "beskrivning",
        "definition": "Textuell beskrivning av villkoret.",
        "comment": "Note that FHIR strings SHALL NOT exceed 1,048,576 (1024*1024) characters in size",
        "min": 1,
        "max": "1",
        "base": {
          "path": "HVOVillkorLogical.beskrivning",
          "min": 1,
          "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": "VillkorToHVOeligbilityValue",
            "map": "(HVOService)eligibility.comment"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardemin",
        "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": "HVOVillkorLogical.vardemin",
        "short": "värde.min",
        "definition": "Angivelse av minsta värde för det villkor som specificeras i attributet kod.",
        "comment": "The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "HVOVillkorLogical.vardemin",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "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": "qty-3",
            "severity": "error",
            "human": "If a code for the unit is present, the system SHALL also be present",
            "expression": "code.empty() or system.exists()",
            "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "SN (see also Range) or CQ"
          },
          {
            "identity": "rim",
            "map": "PQ, IVL<PQ>, MO, CO, depending on the values"
          },
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueRange.low"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardemax",
        "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": "HVOVillkorLogical.vardemax",
        "short": "värde.max",
        "definition": "Angivelse av maximalt värde för det villkor som specificeras i attributet kod.",
        "comment": "The context of use may frequently define what kind of quantity this is and therefore what kind of units can be used. The context of use may also restrict the values for the comparator.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "HVOVillkorLogical.vardemax",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "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": "qty-3",
            "severity": "error",
            "human": "If a code for the unit is present, the system SHALL also be present",
            "expression": "code.empty() or system.exists()",
            "source": "http://hl7.org/fhir/StructureDefinition/Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          },
          {
            "identity": "v2",
            "map": "SN (see also Range) or CQ"
          },
          {
            "identity": "rim",
            "map": "PQ, IVL<PQ>, MO, CO, depending on the values"
          },
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueRange.high"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardekod",
        "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": "HVOVillkorLogical.vardekod",
        "short": "värde.kod",
        "definition": "Angivelse av kod för det villkor som ska uppfyllas.",
        "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": "1",
        "base": {
          "path": "HVOVillkorLogical.vardekod",
          "min": 0,
          "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": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueCodeableConcept"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "HVOVillkorLogical",
        "path": "HVOVillkorLogical",
        "short": "Villkor",
        "definition": "Klassen villkor håller information om övriga villkor som ställs för att ta del av en viss tjänst."
      },
      {
        "id": "HVOVillkorLogical.kod",
        "path": "HVOVillkorLogical.kod",
        "short": "kod",
        "definition": "Angivelse av kod för villkor som behöver uppfyllas för att vara behörig att ta del av tjänsten.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mapping": [
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligbilityGroup.characteristic.code"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.beskrivning",
        "path": "HVOVillkorLogical.beskrivning",
        "short": "beskrivning",
        "definition": "Textuell beskrivning av villkoret.",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "string"
          }
        ],
        "mapping": [
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "(HVOService)eligibility.comment"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardemin",
        "path": "HVOVillkorLogical.vardemin",
        "short": "värde.min",
        "definition": "Angivelse av minsta värde för det villkor som specificeras i attributet kod.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueRange.low"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardemax",
        "path": "HVOVillkorLogical.vardemax",
        "short": "värde.max",
        "definition": "Angivelse av maximalt värde för det villkor som specificeras i attributet kod.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Quantity"
          }
        ],
        "mapping": [
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueRange.high"
          }
        ]
      },
      {
        "id": "HVOVillkorLogical.vardekod",
        "path": "HVOVillkorLogical.vardekod",
        "short": "värde.kod",
        "definition": "Angivelse av kod för det villkor som ska uppfyllas.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Coding"
          }
        ],
        "mapping": [
          {
            "identity": "VillkorToHVOeligbilityValue",
            "map": "HVOEligibilityGroup.characteristic.valueCodeableConcept"
          }
        ]
      }
    ]
  }
}