{
  "resourceType": "StructureDefinition",
  "id": "1e76b2b3-bbc8-4c98-a299-3ca6952ed8f1",
  "meta": {
    "lastUpdated": "2020-10-05T11:53:04.608+00:00"
  },
  "language": "Norsk",
  "url": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia",
  "name": "KjConditionComplicationsOfAnesthesia",
  "status": "active",
  "date": "2020-09-16T11:48:31.682982Z",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Condition",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Condition",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Condition",
        "path": "Condition",
        "condition": [
          "kj-coa-4",
          "kj-coa-5",
          "kj-coa-8"
        ],
        "constraint": [
          {
            "key": "kj-coa-4",
            "severity": "error",
            "human": "Evidence can only be set if code.coding is Intubasjonsproblem (code=3)",
            "expression": "evidence.empty() and code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='3').exists().not()  or evidence.exists()",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          },
          {
            "key": "kj-coa-5",
            "severity": "error",
            "human": "If evidence is set, it must contain both GradingOfLaryngoscopicView and GradingOfMaskVentilation",
            "expression": "evidence.empty() or (code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='3').exists() and evidence.code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/GradingOfLaryngoscopicView').exists() and evidence.code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/GradingOfMaskVentilation').exists())",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          },
          {
            "key": "kj-coa-8",
            "severity": "error",
            "human": "Category and code must be the same value",
            "expression": "(category.coding.where(code='4').exists() and code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='4').exists()) or (category.coding.where(code='3').exists() and code.coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='3').exists())",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ]
      },
      {
        "id": "Condition.extension",
        "path": "Condition.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Condition.extension:updater",
        "path": "Condition.extension",
        "sliceName": "updater",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdater"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.extension:updater.value[x]",
        "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": "Condition.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Condition.extension:updatedDateTime",
        "path": "Condition.extension",
        "sliceName": "updatedDateTime",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdatedDateTime"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.extension:updatedDateTime.value[x]",
        "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": "Condition.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Condition.extension:sourceOfInformation",
        "path": "Condition.extension",
        "sliceName": "sourceOfInformation",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjSourceOfInformation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.clinicalStatus",
        "path": "Condition.clinicalStatus",
        "short": "active | inactive",
        "definition": "The clinical status of the condition. Either active or inactive. Rest of the options should return an error.",
        "comment": "We only accept Active and Inactive. The other values would return an error message. Active = normal, Inactive = Disproved or delete.(based on verificationStatus)",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConditionClinicalStatus"
        }
      },
      {
        "id": "Condition.clinicalStatus.coding",
        "path": "Condition.clinicalStatus.coding",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConditionClinicalStatus"
        }
      },
      {
        "id": "Condition.verificationStatus",
        "path": "Condition.verificationStatus",
        "short": "confirmed | refuted | entered-in-error",
        "definition": "Confirmed = normal, Refuted = avkreftet, Entered-in-error = slettet.",
        "comment": "-",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConditionVerificationStatus"
        }
      },
      {
        "id": "Condition.verificationStatus.coding",
        "path": "Condition.verificationStatus.coding",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ConditionVerificationStatus"
        }
      },
      {
        "id": "Condition.verificationStatus.coding.system",
        "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": "Condition.verificationStatus.coding.system",
        "comment": "Confirmed = normal, Refuted = avkrefed, Entered-in-error = slettet."
      },
      {
        "id": "Condition.category",
        "path": "Condition.category",
        "short": "Type of critical information",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ComplicationsOfAnesthesiaCategory"
        }
      },
      {
        "id": "Condition.category.coding",
        "path": "Condition.category.coding",
        "definition": "Valueset with codes from code system : urn:oid:2.16.578.1.12.4.1.1.7651\r\nValid codes to use:\r\n3 - Intubasjonsproblem\r\n4 - Annet problem ved anestesi",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ComplicationsOfAnesthesiaCategory"
        }
      },
      {
        "id": "Condition.category.coding.system",
        "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": "Condition.category.coding.system",
        "short": "Types of critical information",
        "definition": "This code system should denote what type of critical information is registered here."
      },
      {
        "id": "Condition.category.coding.code",
        "path": "Condition.category.coding.code",
        "min": 1
      },
      {
        "id": "Condition.code",
        "path": "Condition.code",
        "min": 1,
        "condition": [
          "kj-coa-3"
        ],
        "constraint": [
          {
            "key": "kj-coa-3",
            "severity": "error",
            "human": "Text can and must be set only if code.coding is Annet problem ved anestesi (code=4)",
            "expression": "(coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='4').exists() and text.exists()) or (text.empty() and coding.where(system='http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation' and code='4').exists().not())",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ],
        "mustSupport": true,
        "binding": {
          "strength": "preferred",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ComplicationsOfAnesthesiaCategory"
        }
      },
      {
        "id": "Condition.code.coding",
        "path": "Condition.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        },
        "mustSupport": true
      },
      {
        "id": "Condition.code.coding:ComplicationOfAnesthesia",
        "path": "Condition.code.coding",
        "sliceName": "ComplicationOfAnesthesia",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ComplicationsOfAnesthesiaCategory"
        }
      },
      {
        "id": "Condition.code.coding:ComplicationOfAnesthesia.system",
        "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": "Condition.code.coding.system",
        "fixedUri": "http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation"
      },
      {
        "id": "Condition.code.coding:ComplicationOfAnesthesia.code",
        "path": "Condition.code.coding.code",
        "min": 1
      },
      {
        "id": "Condition.code.text",
        "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": "Condition.code.text",
        "condition": [
          "kj-coa-2"
        ],
        "constraint": [
          {
            "key": "kj-coa-2",
            "severity": "error",
            "human": "Text can be maximum 80 characters",
            "expression": "value.length() <= 80",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.subject",
        "path": "Condition.subject",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.onset[x]",
        "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": "Condition.onset[x]",
        "type": [
          {
            "code": "dateTime"
          },
          {
            "code": "Age"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.abatement[x]",
        "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": "Condition.abatement[x]",
        "type": [
          {
            "code": "dateTime"
          }
        ]
      },
      {
        "id": "Condition.recordedDate",
        "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": "Condition.recordedDate",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Condition.recorder",
        "path": "Condition.recorder",
        "definition": "Here one should use PractitionerRole, since it is important to register the practitoner and the organization the person worked at when this condition was registered.",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjPractitionerRole"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.evidence",
        "path": "Condition.evidence",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "code.coding.system"
            }
          ],
          "rules": "open"
        },
        "definition": "Supporting evidence / manifestations that are the basis of the Condition's verification status, such as evidence that confirmed or refuted the condition. Both 7515 and 7516 can be used simultanesly so the cardinality is set 0..2",
        "mustSupport": true
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation",
        "path": "Condition.evidence",
        "sliceName": "intubationProblemAsCriticalInformation",
        "short": "7515 - Gradering av anatomisk tilgjengelighet for intubasjon",
        "definition": "Grading of anatomical availability by intubation corrsesponding to Cormack & Lehane.",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation.code",
        "path": "Condition.evidence.code",
        "min": 1,
        "max": "1",
        "constraint": [
          {
            "key": "kj-coa-6",
            "severity": "error",
            "human": "Coding.code or text must be set and are mutually exclusive.",
            "expression": "(text.empty() and coding.code.exists()) or (text.exists() and coding.code.empty())",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ],
        "binding": {
          "strength": "preferred",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/GradingOfLaryngoscopicView"
        }
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation.code.coding",
        "path": "Condition.evidence.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation.code.coding:GradingOfLaryngoscopicView",
        "path": "Condition.evidence.code.coding",
        "sliceName": "GradingOfLaryngoscopicView",
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/GradingOfLaryngoscopicView"
        }
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation.code.coding:GradingOfLaryngoscopicView.system",
        "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": "Condition.evidence.code.coding.system",
        "fixedUri": "http://nhn.no/kj/fhir/CodeSystem/GradingOfLaryngoscopicView"
      },
      {
        "id": "Condition.evidence:intubationProblemAsCriticalInformation.code.text",
        "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": "Condition.evidence.code.text",
        "condition": [
          "kj-coa-7"
        ],
        "constraint": [
          {
            "key": "kj-coa-7",
            "severity": "error",
            "human": "Text can be maximum 80 characters",
            "expression": "value.length() <= 80",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask",
        "path": "Condition.evidence",
        "sliceName": "possibilityForVentilationWithMask",
        "short": "Possibility for ventilation with mask",
        "max": "1",
        "mustSupport": true
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask.code",
        "path": "Condition.evidence.code",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "preferred",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/GradingOfMaskVentilation"
        }
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask.code.coding",
        "path": "Condition.evidence.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask.code.coding:GradingOfMaskVentilation",
        "path": "Condition.evidence.code.coding",
        "sliceName": "GradingOfMaskVentilation",
        "min": 1,
        "max": "1",
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/GradingOfMaskVentilation"
        }
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask.code.coding:GradingOfMaskVentilation.system",
        "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": "Condition.evidence.code.coding.system",
        "min": 1,
        "fixedUri": "http://nhn.no/kj/fhir/CodeSystem/GradingOfMaskVentilation"
      },
      {
        "id": "Condition.evidence:possibilityForVentilationWithMask.code.coding:GradingOfMaskVentilation.code",
        "path": "Condition.evidence.code.coding.code",
        "min": 1
      },
      {
        "id": "Condition.note",
        "path": "Condition.note",
        "max": "1",
        "condition": [
          "kj-coa-1"
        ],
        "constraint": [
          {
            "key": "kj-coa-1",
            "severity": "error",
            "human": "If note is present, then text must be between 4 and 500 characters.",
            "expression": "empty() or (first().text.value.length() >=4 and first().text.value.length() <= 500)",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjConditionComplicationsOfAnesthesia"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}