{
  "resourceType": "StructureDefinition",
  "id": "45ec70a3-f6ed-4c97-b128-3d340b452d06",
  "meta": {
    "lastUpdated": "2020-10-06T07:15:05.1+00:00"
  },
  "url": "http://nhn.no/kj/fhir/StructureDefinition/KjProcedure",
  "name": "KjProcedure",
  "status": "active",
  "date": "2020-10-06T07:08:46.4455925Z",
  "fhirVersion": "4.0.1",
  "kind": "resource",
  "abstract": false,
  "type": "Procedure",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Procedure",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Procedure.extension",
        "path": "Procedure.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.extension:validUntil",
        "path": "Procedure.extension",
        "sliceName": "validUntil",
        "short": "Procedure lasts until",
        "definition": "If set, the EHR should test if current date is after the given date. Then it should not be shown.",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjValidUntil"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.extension:validUntil.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": "Procedure.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.extension:recordedDate",
        "path": "Procedure.extension",
        "sliceName": "recordedDate",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjRecordedDateTime"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.extension:recordedDate.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": "Procedure.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.extension:updater",
        "path": "Procedure.extension",
        "sliceName": "updater",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdater"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.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": "Procedure.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.extension:updatedDateTime",
        "path": "Procedure.extension",
        "sliceName": "updatedDateTime",
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjUpdatedDateTime"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.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": "Procedure.extension.value[x]",
        "slicing": {
          "discriminator": [
            {
              "type": "type",
              "path": "$this"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.extension:sourceOfInformation",
        "path": "Procedure.extension",
        "sliceName": "sourceOfInformation",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjSourceOfInformation"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.status",
        "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": "Procedure.status",
        "short": "in-progress | completed | entered-in-error",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/ProcedureStatus"
        }
      },
      {
        "id": "Procedure.category",
        "path": "Procedure.category",
        "min": 1,
        "mustSupport": true
      },
      {
        "id": "Procedure.category.coding",
        "path": "Procedure.category.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.category.coding:KjCategory",
        "path": "Procedure.category.coding",
        "sliceName": "KjCategory",
        "min": 1,
        "max": "1"
      },
      {
        "id": "Procedure.category.coding:KjCategory.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": "Procedure.category.coding.system",
        "min": 1,
        "fixedUri": "http://nhn.no/kj/fhir/CodeSystem/SubcategoriesOfCriticalInformation"
      },
      {
        "id": "Procedure.category.coding:KjCategory.code",
        "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": "Procedure.category.coding.code",
        "min": 1,
        "fixedCode": "6"
      },
      {
        "id": "Procedure.code",
        "path": "Procedure.code",
        "min": 1,
        "mustSupport": true,
        "binding": {
          "strength": "preferred",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/OngoingTreatment"
        }
      },
      {
        "id": "Procedure.code.coding",
        "path": "Procedure.code.coding",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "system"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Procedure.code.coding:KjOngoingTreatment",
        "path": "Procedure.code.coding",
        "sliceName": "KjOngoingTreatment",
        "min": 1,
        "max": "1",
        "patternCoding": {
          "system": "http://nhn.no/kj/fhir/CodeSystem/OngoingTreatment"
        },
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://nhn.no/kj/fhir/ValueSet/OngoingTreatment"
        }
      },
      {
        "id": "Procedure.code.coding:KjOngoingTreatment.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": "Procedure.code.coding.system",
        "fixedUri": "http://nhn.no/kj/fhir/CodeSystem/OngoingTreatment"
      },
      {
        "id": "Procedure.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": "Procedure.code.text",
        "short": "Description for type of threatment",
        "definition": "Use this field for additional description to the type of threatment.",
        "constraint": [
          {
            "key": "kj-pro-2",
            "severity": "error",
            "human": "Text can be maximum 80 characters",
            "expression": "value.length() <= 80",
            "source": "http://nhn.no/kj/fhir/StructureDefinition/KjProcedure"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.subject",
        "path": "Procedure.subject",
        "short": "Reference to patient ongoing the threatment",
        "definition": "Add reference to the patient that receives the threatment.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.no/fhir/StructureDefinition/no-basis-Patient"
            ],
            "aggregation": [
              "referenced"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.performed[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": "Procedure.performed[x]",
        "comment": "Age is generally used when the patient reports an age at which the procedure was performed. dateTime supports a range of precision due to some procedures being reported as past procedures that might not have millisecond precision while other procedures performed and documented during the encounter might have more precise UTC timestamps with timezone.",
        "requirements": "Period, string and Range should not be used in this profile",
        "type": [
          {
            "code": "dateTime"
          },
          {
            "code": "Age"
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.recorder",
        "path": "Procedure.recorder",
        "min": 1,
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://nhn.no/kj/fhir/StructureDefinition/KjPractitionerRole"
            ],
            "aggregation": [
              "contained"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "Procedure.note",
        "path": "Procedure.note",
        "comment": "Here one can add additional information, that gives more information that is not given in the other properties.",
        "max": "1",
        "constraint": [
          {
            "key": "kj-pro-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/KjProcedure"
          }
        ],
        "mustSupport": true
      }
    ]
  }
}