{
  "resourceType": "StructureDefinition",
  "url": "http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceDataLock",
  "name": "NLLProvenanceDataLock",
  "status": "draft",
  "fhirVersion": "4.0.0",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "w3c.prov",
      "uri": "http://www.w3.org/ns/prov",
      "name": "W3C PROV"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "fhirauditevent",
      "uri": "http://hl7.org/fhir/auditevent",
      "name": "FHIR AuditEvent Mapping"
    },
    {
      "identity": "EHM",
      "uri": "http://www.ehalsomyndigheten.se",
      "name": "E-hälsomyndigheten"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Provenance",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Provenance",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Provenance",
        "path": "Provenance",
        "short": "Who, What, When for a NLLDataLock",
        "definition": "Provenance of an NLLDataLock describes important information related to who initiated the action and/or who is responsible (author) of the action, date, decision (usually an automated descision Offentlighets- och sekretesslag (2009:400), OSL),",
        "mapping": [
          {
            "identity": "EHM",
            "map": "Spärrhändelse"
          }
        ]
      },
      {
        "id": "Provenance.extension",
        "path": "Provenance.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Provenance.extension:nllDataLockReasonType",
        "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": "Provenance.extension",
        "sliceName": "nllDataLockReasonType",
        "short": "Describes the reason for locking data",
        "definition": "This type describes the reason for applying a privacy lock or secrecy lock. INTEGRITET |  SEKRETESS_VH | SEKRETESS_PAT",
        "min": 1,
        "max": "1",
        "type": [
          {
            "code": "Extension",
            "profile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLProvenanceDataLockCoding"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/data-lock-reason-type"
        },
        "mapping": [
          {
            "identity": "EHM",
            "map": "Spärrorsak",
            "comment": "INTEGRITET | SEKRETESS_PAT | SEKRETESS_VH"
          }
        ]
      },
      {
        "id": "Provenance.target",
        "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": "Provenance.target",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLDataLock"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Spärr id",
            "comment": "Den spärr som händelsen avser"
          }
        ]
      },
      {
        "id": "Provenance.occurred[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": "Provenance.occurred[x]",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Tidpunkt"
          }
        ]
      },
      {
        "id": "Provenance.reason.coding",
        "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": "Provenance.reason.coding",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/data-lock-decision-type"
        },
        "mapping": [
          {
            "identity": "EHM",
            "map": "Besluttyp"
          }
        ]
      },
      {
        "id": "Provenance.reason.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": "Provenance.reason.coding.system",
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/data-lock-decision-type"
        }
      },
      {
        "id": "Provenance.activity",
        "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": "Provenance.activity",
        "definition": "Only codes: REGISTERED or UNREGISTERED are currently supported (sv: registrerad, avregistrerad).",
        "min": 1
      },
      {
        "id": "Provenance.activity.coding",
        "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": "Provenance.activity.coding",
        "short": "Type of activity described in this provenance",
        "definition": "Type of activity described in this provenance. A reference to a code defined by a terminology system.",
        "min": 1,
        "max": "1",
        "mustSupport": true,
        "binding": {
          "strength": "required",
          "valueSet": "http://electronichealth.se/fhir/ValueSet/actitvity-type"
        },
        "mapping": [
          {
            "identity": "EHM",
            "map": "Spärrhändelsetyp"
          }
        ]
      },
      {
        "id": "Provenance.agent",
        "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": "Provenance.agent",
        "definition": "An actor taking a role in an activity. In the provenance of a data lock it describes the responsible (performer) and potentially also the person who entered the information (enterer)."
      },
      {
        "id": "Provenance.agent.type",
        "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": "Provenance.agent.type",
        "definition": "The participation the agent had with respect to the activity. Supported coded values are: AUTHOR (sv: Uppdragsgivare) and ENTERER (sv: Utförare)",
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Utförare/Uppdragsgivare"
          }
        ]
      },
      {
        "id": "Provenance.agent.who",
        "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": "Provenance.agent.who",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://electronichealth.se/fhir/StructureDefinition/NLLPatient",
              "http://electronichealth.se/fhir/StructureDefinition/NLLPractitioner"
            ],
            "aggregation": [
              "contained",
              "referenced"
            ]
          }
        ],
        "mustSupport": true,
        "mapping": [
          {
            "identity": "EHM",
            "map": "Patient/Personal"
          }
        ]
      }
    ]
  }
}