{
  "resourceType": "StructureDefinition",
  "id": "nexus-emr-core-auditevent",
  "extension": [
    {
      "url": "https://fhir.apps.health/StructureDefinition/effective-date",
      "extension": [
        {
          "url": "paths",
          "valueString": "period.start | recorded"
        }
      ]
    },
    {
      "url": "https://fhir.apps.health/StructureDefinition/salient-field",
      "extension": [
        {
          "url": "key",
          "valueCode": "action"
        },
        {
          "url": "expression",
          "valueString": "action"
        },
        {
          "url": "type",
          "valueCode": "code"
        },
        {
          "url": "comment",
          "valueMarkdown": "The interaction performed, as R4's `audit-event-action` codes. See the element note: the platform records a transmission action that these five codes do not express."
        }
      ]
    },
    {
      "url": "https://fhir.apps.health/StructureDefinition/salient-field",
      "extension": [
        {
          "url": "key",
          "valueCode": "outcome"
        },
        {
          "url": "expression",
          "valueString": "outcome"
        },
        {
          "url": "type",
          "valueCode": "code"
        },
        {
          "url": "comment",
          "valueMarkdown": "Present only when the outcome is known. An entry recording an outcome the platform could not determine carries no code at all -- treat absence as unknown, never as success."
        }
      ]
    },
    {
      "url": "https://fhir.apps.health/StructureDefinition/salient-field",
      "extension": [
        {
          "url": "key",
          "valueCode": "date"
        },
        {
          "url": "expression",
          "valueString": "period.start | recorded"
        },
        {
          "url": "type",
          "valueCode": "dateTime"
        },
        {
          "url": "comment",
          "valueMarkdown": "When the entry was recorded, falling back from the activity period where one is given. Not necessarily the instant of the interaction -- see the `recorded` note."
        }
      ]
    },
    {
      "url": "https://fhir.apps.health/StructureDefinition/salient-field",
      "extension": [
        {
          "url": "key",
          "valueCode": "performed_by"
        },
        {
          "url": "expression",
          "valueString": "agent.altId.first()"
        },
        {
          "url": "type",
          "valueCode": "string"
        },
        {
          "url": "comment",
          "valueMarkdown": "The identity-provider subject of the acting user, as the platform holds it. An opaque account identifier, not a FHIR id and not a Practitioner reference. Resolving it to a person needs the identity directory, which this guide does not describe."
        }
      ]
    }
  ],
  "url": "https://fhir.apps.health/StructureDefinition/nexus-emr-core-auditevent",
  "name": "NexusEmrCoreAuditEvent",
  "title": "AuditEvent Profile",
  "status": "draft",
  "experimental": true,
  "description": "Nexus EMR profile for AuditEvent -- the access and activity log: who acted, on which record, when,\nthrough what interaction, and with what outcome.\n\nDistinct from Provenance, which describes how a record came to be and is written selectively, and\nfrom the `AIAST` security label, which says only whether a machine produced the content. An audit\nentry describes an INTERACTION rather than authorship, is written for reads as well as writes, and\nis not part of the record it describes. A report over access to personal health information is this\nresource's question.\n\nFirst pass: constrains the actor, the moment, the interaction, its outcome and the record concerned.\nThe event-type vocabulary, purpose of use and network attribution are not yet constrained. Closed to\nSMART apps pending an exposure decision.",
  "fhirVersion": "4.0.1",
  "mapping": [
    {
      "identity": "workflow",
      "uri": "http://hl7.org/fhir/workflow",
      "name": "Workflow Pattern"
    },
    {
      "identity": "rim",
      "uri": "http://hl7.org/v3",
      "name": "RIM Mapping"
    },
    {
      "identity": "dicom",
      "uri": "http://nema.org/dicom",
      "name": "DICOM Tag Mapping"
    },
    {
      "identity": "w5",
      "uri": "http://hl7.org/fhir/fivews",
      "name": "FiveWs Pattern Mapping"
    },
    {
      "identity": "w3c.prov",
      "uri": "http://www.w3.org/ns/prov",
      "name": "W3C PROV"
    },
    {
      "identity": "fhirprovenance",
      "uri": "http://hl7.org/fhir/provenance",
      "name": "FHIR Provenance Mapping"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "AuditEvent",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/AuditEvent",
  "derivation": "constraint",
  "snapshot": {
    "element": [
      {
        "id": "AuditEvent",
        "path": "AuditEvent",
        "short": "Nexus EMR AuditEvent Core",
        "definition": "A record of an interaction with the estate: the actor, the moment, the interaction performed, its\noutcome, and the records it concerned.\n\nAudit entries are append-only by intent. An entry describes something that happened; correcting it\nby rewriting it destroys the property that makes it worth keeping. Where an entry is wrong, record\na further entry.",
        "comment": "Based on IHE-ATNA.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent",
          "min": 0,
          "max": "*"
        },
        "constraint": [
          {
            "key": "dom-2",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL NOT contain nested Resources",
            "expression": "contained.contained.empty()",
            "xpath": "not(parent::f:contained and f:contained)",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-3",
            "severity": "error",
            "human": "If the resource is contained in another resource, it SHALL be referred to from elsewhere in the resource or SHALL refer to the containing resource",
            "expression": "contained.where((('#'+id in (%resource.descendants().reference | %resource.descendants().as(canonical) | %resource.descendants().as(uri) | %resource.descendants().as(url))) or descendants().where(reference = '#').exists() or descendants().where(as(canonical) = '#').exists() or descendants().where(as(canonical) = '#').exists()).not()).trace('unmatched', id).empty()",
            "xpath": "not(exists(for $id in f:contained/*/f:id/@value return $contained[not(parent::*/descendant::f:reference/@value=concat('#', $contained/*/id/@value) or descendant::f:reference[@value='#'])]))",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-4",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a meta.versionId or a meta.lastUpdated",
            "expression": "contained.meta.versionId.empty() and contained.meta.lastUpdated.empty()",
            "xpath": "not(exists(f:contained/*/f:meta/f:versionId)) and not(exists(f:contained/*/f:meta/f:lastUpdated))",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "dom-5",
            "severity": "error",
            "human": "If a resource is contained in another resource, it SHALL NOT have a security label",
            "expression": "contained.meta.security.empty()",
            "xpath": "not(exists(f:contained/*/f:meta/f:security))",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice",
                "valueBoolean": true
              },
              {
                "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bestpractice-explanation",
                "valueMarkdown": "When a resource has no narrative, only systems that fully understand the data can display the resource to a human safely. Including a human readable representation in the resource makes for a much more robust eco-system and cheaper handling of resources by intermediary systems. Some ecosystems restrict distribution of resources to only those systems that do fully understand the resources, and as a consequence implementers may believe that the narrative is superfluous. However experience shows that such eco-systems often open up to new participants over time."
              }
            ],
            "key": "dom-6",
            "severity": "warning",
            "human": "A resource should have narrative for robust management",
            "expression": "text.`div`.exists()",
            "xpath": "exists(f:text/h:div)",
            "source": "http://hl7.org/fhir/StructureDefinition/DomainResource"
          },
          {
            "key": "auditevent-names-an-actor",
            "severity": "warning",
            "human": "An AuditEvent SHOULD name who acted -- at least one agent carrying a resolvable `who` reference or an `altId` user identifier. An entry naming no actor answers none of the questions an access log exists to answer",
            "expression": "agent.where(who.exists() or altId.exists()).exists()",
            "source": "https://fhir.apps.health/StructureDefinition/nexus-emr-core-auditevent"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "Entity. Role, or Act"
          },
          {
            "identity": "workflow",
            "map": "Event"
          },
          {
            "identity": "rim",
            "map": "ControlAct[moodCode=EVN]"
          },
          {
            "identity": "dicom",
            "map": "Message"
          }
        ]
      },
      {
        "id": "AuditEvent.id",
        "path": "AuditEvent.id",
        "short": "Logical id of this artifact",
        "definition": "The logical id of the resource, as used in the URL for the resource. Once assigned, this value never changes.",
        "comment": "The only time that a resource does not have an id is when it is being submitted to the server using a create operation.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": true
      },
      {
        "id": "AuditEvent.meta",
        "path": "AuditEvent.meta",
        "short": "Metadata about the resource",
        "definition": "The metadata about the resource. This is content that is maintained by the infrastructure. Changes to the content might not always be associated with version changes to the resource.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.meta",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Meta"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": true
      },
      {
        "id": "AuditEvent.implicitRules",
        "path": "AuditEvent.implicitRules",
        "short": "A set of rules under which this content was created",
        "definition": "A reference to a set of rules that were followed when the resource was constructed, and which must be understood when processing the content. Often, this is a reference to an implementation guide that defines the special rules along with other profiles etc.",
        "comment": "Asserting this rule set restricts the content to be only understood by a limited set of trading partners. This inherently limits the usefulness of the data in the long term. However, the existing health eco-system is highly fractured, and not yet ready to define, collect, and exchange data in a generally computable sense. Wherever possible, implementers and/or specification writers should avoid using this element. Often, when used, the URL is a reference to an implementation guide that defines these special rules as part of it's narrative along with other profiles, value sets, etc.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.implicitRules",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": true,
        "isModifierReason": "This element is labeled as a modifier because the implicit rules may provide additional knowledge about the resource that modifies it's meaning or interpretation",
        "isSummary": true
      },
      {
        "id": "AuditEvent.language",
        "path": "AuditEvent.language",
        "short": "Language of the resource content",
        "definition": "The base language in which the resource is written.",
        "comment": "Language is provided to support indexing and accessibility (typically, services such as text to speech use the language tag). The html language tag in the narrative applies  to the narrative. The language tag on the resource may be used to specify the language of other presentations generated from the data in the resource. Not all the content has to be in the base language. The Resource.language should not be assumed to apply to the narrative automatically. If a language is specified, it should it also be specified on the div element in the html (see rules in HTML5 for information about the relationship between xml:lang and the html lang attribute).",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Resource.language",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-maxValueSet",
              "valueCanonical": "http://hl7.org/fhir/ValueSet/all-languages"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "Language"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "preferred",
          "description": "A human language.",
          "valueSet": "http://hl7.org/fhir/ValueSet/languages"
        }
      },
      {
        "id": "AuditEvent.text",
        "path": "AuditEvent.text",
        "short": "Narrative",
        "definition": "A human-readable narrative summary of the NexusEmrCoreAuditEvent resource for human interpretation.",
        "comment": "Contained resources do not have narrative. Resources that are not contained SHOULD have a narrative. In some cases, a resource may only have text with little or no additional discrete data (as long as all minOccurs=1 elements are satisfied).  This may be necessary for data from legacy systems where information is captured as a \"text blob\" or where text is additionally entered raw or narrated and encoded information is added later.",
        "alias": [
          "narrative",
          "html",
          "xhtml",
          "display"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "DomainResource.text",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Narrative"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "Act.text?"
          }
        ]
      },
      {
        "id": "AuditEvent.contained",
        "path": "AuditEvent.contained",
        "short": "Contained, inline Resources",
        "definition": "These resources do not have an independent existence apart from the resource that contains them - they cannot be identified independently, and nor can they have their own independent transaction scope.",
        "comment": "This should never be done when the content can be identified properly, as once identification is lost, it is extremely difficult (and context dependent) to restore it again. Contained resources may have profiles and tags In their meta elements, but SHALL NOT have security labels.",
        "alias": [
          "inline resources",
          "anonymous resources",
          "contained resources"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "DomainResource.contained",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Resource"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.extension",
        "path": "AuditEvent.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the resource. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "DomainResource.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.modifierExtension",
        "path": "AuditEvent.modifierExtension",
        "short": "Extensions that cannot be ignored",
        "definition": "May be used to represent additional information that is not part of the basic definition of the resource and that modifies the understanding of the element that contains it and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer is allowed to define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "DomainResource.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the resource that contains them",
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.type",
        "path": "AuditEvent.type",
        "short": "What kind of event this is",
        "definition": "Identifier for a family of the event.  For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.",
        "comment": "Required by R4 (1..1) and NOT yet fixed by this guide, though two values are recommended and both\ncome from the standard vocabulary rather than from a local one.\n\n`http://terminology.hl7.org/CodeSystem/audit-event-type#rest` for an entry describing a FHIR API\ninteraction, which is what a projection of the platform's access log writes for the great majority of\nentries. `http://dicom.nema.org/resources/ontology/DCM#110106` (Export) for an entry describing\ninformation LEAVING the estate -- a packet released, a report downloaded, a referral transmitted --\nbecause `action` cannot express that distinction and a disclosure report has to be able to find those\nentries. Recommended rather than required: nothing writes an AuditEvent through this API today, so\nfixing a value would constrain a producer that does not exist. Do not invent a local vocabulary here.",
        "requirements": "This identifies the performed function. For \"Execute\" Event Action Code audit records, this identifies the application function performed.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.type",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventType"
            }
          ],
          "strength": "extensible",
          "description": "Type of event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-event-type"
        },
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.code"
          },
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".code (type, subtype and action are pre-coordinated or sent as translations)"
          },
          {
            "identity": "dicom",
            "map": "EventId"
          },
          {
            "identity": "w3c.prov",
            "map": "Activity"
          }
        ]
      },
      {
        "id": "AuditEvent.subtype",
        "path": "AuditEvent.subtype",
        "short": "The narrower activity, where the event is not simply a REST interaction",
        "definition": "Identifier for the category of event.",
        "comment": "Where an entry describes a named platform activity rather than an interaction with a chart record --\nassembling a document packet, launching a billing handoff, running an eligibility check, exchanging\ncredentials, transmitting a referral -- the activity belongs here rather than on `entity`.\n\nNO VOCABULARY IS PUBLISHED FOR THAT SET. The platform's log carries its own activity names, and this\nguide does not yet declare a code system for them: the majority of the values name FHIR resource\ntypes, which already have a published code system, and minting a second one that restates them would\nbe a permanent commitment to a duplicate. What would settle it is the residue -- the values that name\na platform activity rather than a resource type -- published as a code system in its own right.\nUntil then, read `subtype` liberally and do not assume a system URI.",
        "requirements": "This field enables queries of messages by implementation-defined event categories.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.subtype",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventSubType"
            }
          ],
          "strength": "extensible",
          "description": "Sub-type of event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-event-sub-type"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".code (type, subtype and action are pre-coordinated or sent as translations)"
          },
          {
            "identity": "dicom",
            "map": "EventTypeCode"
          }
        ]
      },
      {
        "id": "AuditEvent.action",
        "path": "AuditEvent.action",
        "short": "create | read | update | delete | execute",
        "definition": "Indicator for type of action performed during the event that generated the audit.",
        "comment": "R4 binds this to five codes (`C`, `R`, `U`, `D`, `E`) and this guide adds none.\n\nTWO THINGS A READER MUST KNOW. First, every interaction that is not a create, an update or a delete\nis recorded as a READ -- searches, version reads and history reads included. `R` therefore means\n\"the record was disclosed to someone\", which is what a privacy report wants, and does not mean a\nsingle-resource GET. A search that returned twelve records yields TWELVE read entries, one per\nrecord returned, rather than one entry for the search: the question an access log has to answer is\nwhich records were disclosed, not how many queries were run. Count records, not entries, and expect\na busy chart view to produce many.\n\nSecond, the platform distinguishes a TRANSMISSION -- a referral sent to an external party, a report\nexported or downloaded -- from an ordinary read, and R4's five codes do not express that distinction.\nUntil it is settled, a transmission projected here appears as `R`, and the fact that it left the\nestate is carried on `type`/`subtype` rather than on `action`. A consumer answering \"what was\ndisclosed outside the clinic\" must therefore not read `action` alone. Settling it means either\nassigning the standard export event type on `type` as a required convention, or an extension; this\nguide has done neither yet.",
        "requirements": "This broadly indicates what kind of action was done on the AuditEvent.entity by the AuditEvent.agent.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.action",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventAction"
            }
          ],
          "strength": "required",
          "description": "Indicator for type of action performed during the event that generated the event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-event-action|4.0.1"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".code (type, subtype and action are pre-coordinated or sent as translations)"
          },
          {
            "identity": "dicom",
            "map": "EventActionCode"
          }
        ]
      },
      {
        "id": "AuditEvent.period",
        "path": "AuditEvent.period",
        "short": "When the activity itself occurred",
        "definition": "The period during which the activity occurred.",
        "comment": "Preferred over `recorded` as THE moment where it is present, for the reason above. The platform's access log does not populate it today, so it is optional and its absence is expected rather than a defect.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.period",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Period"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.occurred[x]"
          },
          {
            "identity": "w5",
            "map": "FiveWs.done[x]"
          },
          {
            "identity": "rim",
            "map": "./effectiveTime[type=IVL_TS]"
          },
          {
            "identity": "dicom",
            "map": "EventDateTime"
          },
          {
            "identity": "w3c.prov",
            "map": "Activity.startTime & Activity.endTime"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.occurred[x]"
          }
        ]
      },
      {
        "id": "AuditEvent.recorded",
        "path": "AuditEvent.recorded",
        "short": "When the entry was recorded",
        "definition": "The time when the event was recorded.",
        "comment": "R4 makes this 1..1, and it is the one element every entry carries. It is the moment the entry was PERSISTED, which is not exactly the moment of the interaction: entries reach the log asynchronously and the stamp is applied on arrival. The difference is small and it is not zero. Order interactions by it freely; reconcile it against an external timestamp with care, and prefer `period` where an entry carries one.",
        "requirements": "This ties an event to a specific date and time. Security audits typically require a consistent time base (e.g. UTC), to eliminate time-zone issues arising from geographical distribution.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.recorded",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "instant"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.recorded"
          },
          {
            "identity": "rim",
            "map": ".effectiveTime"
          },
          {
            "identity": "w3c.prov",
            "map": "Activity.when"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.recorded"
          }
        ]
      },
      {
        "id": "AuditEvent.outcome",
        "path": "AuditEvent.outcome",
        "short": "0 | 4 | 8 | 12 -- whether the interaction succeeded",
        "definition": "Indicates whether the event succeeded or failed.",
        "comment": "The platform records three outcomes -- succeeded, failed, and could not be determined -- against\nR4's four severity-graded codes. The mapping this guide states: a success is `0`; a failure is `4`\n(minor failure), because the platform does not grade failures and claiming a serious or major\nfailure would assert something it did not observe; an undetermined outcome carries NO code.\n\nREAD AN ABSENT `outcome` AS UNKNOWN, NEVER AS SUCCESS. It is the single most consequential misread\navailable on this resource: an access whose outcome could not be determined is exactly the access a\nprivacy review wants surfaced, and defaulting it to success buries it.\n\nONE CLASS OF ENTRY CARRIES A SUCCESS OUTCOME THAT IS NOT A CLAIM ABOUT THE RESULT. An entry recorded\nfor an INVOKED OPERATION is written when the invocation is accepted, before the operation has\nresolved, and records that the attempt was made. Its outcome is not evidence that the operation\nsucceeded. Entries for record interactions are written on the response and their outcome does reflect\nit.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.outcome",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventOutcome"
            }
          ],
          "strength": "required",
          "description": "Indicates whether the event succeeded or failed.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-event-outcome|4.0.1"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".actionNegationInd"
          },
          {
            "identity": "dicom",
            "map": "EventOutcomeIndicator"
          }
        ]
      },
      {
        "id": "AuditEvent.outcomeDesc",
        "path": "AuditEvent.outcomeDesc",
        "short": "Free-text detail about the event",
        "definition": "A free text description of the outcome of the event.",
        "comment": "The platform's log carries an optional free-text detail on any entry, not only on a failure. R4 scopes this element to describing the outcome, which is narrower than what is written; a consumer should treat the text as descriptive of the event and should not assume it is present only on failures, nor that it is machine-readable.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.outcomeDesc",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=OUT].target.text"
          },
          {
            "identity": "dicom",
            "map": "EventOutcomeDescription"
          }
        ]
      },
      {
        "id": "AuditEvent.purposeOfEvent",
        "path": "AuditEvent.purposeOfEvent",
        "short": "Why the interaction took place",
        "definition": "The reason the interaction occurred, bound extensibly by R4 to the standard purpose-of-use\nvocabulary (treatment, payment, operations, emergency treatment, and the rest).\n\n**This guide does not yet constrain it, and emergency access is the reason to say so explicitly.**\nWhere a clinician overrides a patient's restriction on their record to obtain information in an\nemergency, this element -- together with `agent.purposeOfUse` and `agent.policy` -- is where base R4\nrecords that the access was an override and under what authority. That is the shape a reader should\nexpect if and when such a record appears.\n\n**No such record is produced in this estate today.** Nothing implements an emergency-access\noverride, and this guide therefore constrains nothing about one: no code is fixed, no element is\nmade mandatory, and no invariant asserts that an override carries a justification. Read the absence\nof `purposeOfEvent` on an entry as \"not recorded\", not as \"routine access\".\n\nWhat would settle it: the override itself becoming a product behaviour, at which point the question\nthis guide has to answer is whether the override is a coded purpose on the access entry, as here, or\na separate record of its own with the access entry pointing at it. The two differ in whether the\njustification is queryable independently of the access it authorised.",
        "comment": "Use AuditEvent.agent.purposeOfUse when you know that it is specific to the agent, otherwise use AuditEvent.purposeOfEvent. For example, during a machine-to-machine transfer it might not be obvious to the audit system who caused the event, but it does know why.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.purposeOfEvent",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditPurposeOfUse"
            }
          ],
          "strength": "extensible",
          "description": "The reason the activity took place.",
          "valueSet": "http://terminology.hl7.org/ValueSet/v3-PurposeOfUse"
        },
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.reasonCode"
          },
          {
            "identity": "w5",
            "map": "FiveWs.why[x]"
          },
          {
            "identity": "rim",
            "map": "* .reasonCode [ControlActReason when Act.class = CACT Control Act]\n*.outboundRelationship[typeCode=RSON].target"
          },
          {
            "identity": "dicom",
            "map": "EventPurposeOfUse"
          },
          {
            "identity": "w3c.prov",
            "map": "Activity.Activity"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.reason, Provenance.activity"
          }
        ]
      },
      {
        "id": "AuditEvent.agent",
        "path": "AuditEvent.agent",
        "short": "Who acted",
        "definition": "The actor or actors involved in the interaction. R4 makes this `1..*`.\n\nThe platform's access log records exactly ONE actor per entry: the identity that made the request.\nEntries carrying a second agent -- a recipient of a disclosure, a system acting on a user's behalf --\nare permitted by R4 and are not produced today.",
        "comment": "Several agents may be associated (i.e. have some responsibility for an activity) with an event or activity.\n\nFor example, an activity may be initiated by one user for other users or involve more than one user. However, only one user may be the initiator/requestor for the activity.",
        "requirements": "An agent can be a person, an organization, software, device, or other actors that may be ascribed responsibility.",
        "alias": [
          "ActiveParticipant"
        ],
        "min": 1,
        "max": "*",
        "base": {
          "path": "AuditEvent.agent",
          "min": 1,
          "max": "*"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.performer"
          },
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".participation"
          },
          {
            "identity": "dicom",
            "map": "ActiveParticipant"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.agent"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.id",
        "path": "AuditEvent.agent.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.extension",
        "path": "AuditEvent.agent.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.modifierExtension",
        "path": "AuditEvent.agent.modifierExtension",
        "short": "Extensions that cannot be ignored even if unrecognized",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content",
          "modifiers"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "BackboneElement.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.type",
        "path": "AuditEvent.agent.type",
        "short": "How agent participated",
        "definition": "Specification of the participation type the user plays when performing the event.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.type",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditAgentType"
            }
          ],
          "strength": "extensible",
          "description": "The Participation type of the agent to the event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/participation-role-type"
        },
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.performer.function"
          },
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".typeCode and/or .functionCode"
          },
          {
            "identity": "dicom",
            "map": "RoleIdCode"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Attribution"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.agent.type"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.role",
        "path": "AuditEvent.agent.role",
        "short": "Agent role in the event",
        "definition": "The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.",
        "comment": "Should be roles relevant to the event. Should  not be an exhaustive list of roles.",
        "requirements": "This value ties an audited event to a user's role(s). It is an optional value that might be used to group events for analysis by user functional role categories.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.agent.role",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditAgentRole"
            }
          ],
          "strength": "example",
          "description": "What security role enabled the agent to participate in the event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/security-role-type"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".role"
          },
          {
            "identity": "dicom",
            "map": "RoleIdCode"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Attribution"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.agent.role"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.who",
        "path": "AuditEvent.agent.who",
        "short": "The actor, where it resolves to a resource",
        "definition": "Reference to who this agent is that was involved in the event.",
        "comment": "Left OPTIONAL deliberately. The identity the platform holds for an actor is an identity-provider subject, not a resource reference, and resolving it needs an identity directory this guide does not describe; not every actor has a Practitioner resource at all. Where a producer CAN resolve the actor it should write both this and `altId`. Per the Nexus EMR logical-reference model the reference MAY be identifier-only.",
        "requirements": "This field ties an audit event to a specific resource or identifier.",
        "alias": [
          "userId"
        ],
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.who",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-practitioner",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-practitionerrole",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-patient",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-relatedperson",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-organization",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-appdevice",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-emrdevice"
            ]
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.performer.actor"
          },
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".id"
          },
          {
            "identity": "dicom",
            "map": "UserId"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Identity"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.agent.who"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.altId",
        "path": "AuditEvent.agent.altId",
        "short": "The acting user's identity-provider subject",
        "definition": "The opaque account identifier the identity provider issues for the acting user (for example\n`auth0|abc123`). This is the identity the platform actually holds on every entry, and it is the\nelement to match on when correlating an audit entry with the `meta-updated-by` extension on a\nresource version -- the two carry the same kind of value for the same reason.\n\nNOT a FHIR id and NOT a Practitioner reference. Resolving it to a person needs the identity\ndirectory, which this guide does not describe.",
        "requirements": "In some situations, a human user may authenticate with one identity but, to access a specific application system, may use a synonymous identify. For example, some \"single sign on\" implementations will do this. The alternative identifier would then be the original identify  used for authentication, and the User ID is the one known to and used by the application.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.altId",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".id (distinguish id type by root)"
          },
          {
            "identity": "dicom",
            "map": "AlternativeUserId"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Identity"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.name",
        "path": "AuditEvent.agent.name",
        "short": "Human-readable label for the actor",
        "definition": "Human-meaningful name for the agent.",
        "comment": "A display label -- the actor's username, falling back to their email address where no username is held. FOR DISPLAY ONLY. It is not stable, it is not unique, and it must never be used for an authorization or matching decision; `altId` is the identity.",
        "requirements": "The User ID and Authorization User ID may be internal or otherwise obscure values. This field assists the auditor in identifying the actual user.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.name",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": ".name"
          },
          {
            "identity": "dicom",
            "map": "UserName"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Identity"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.requestor",
        "path": "AuditEvent.agent.requestor",
        "short": "Whether this agent initiated the interaction",
        "definition": "Indicator that the user is or is not the requestor, or initiator, for the event being audited.",
        "comment": "R4 makes this 1..1. The single agent on a platform-produced entry is the requester, so `true` is the expected value; an entry naming a second, non-initiating agent sets it `false` on that agent.",
        "requirements": "This value is used to distinguish between requestor-users and recipient-users. For example, one person may initiate a report-output to be sent to another user.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.requestor",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "boolean"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.who"
          },
          {
            "identity": "rim",
            "map": "If participation.typeCode was author, then true"
          },
          {
            "identity": "dicom",
            "map": "UserIsRequestor"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.location",
        "path": "AuditEvent.agent.location",
        "short": "Where",
        "definition": "Where the event occurred.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.location",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Location"
            ]
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "workflow",
            "map": "Event.location"
          },
          {
            "identity": "w5",
            "map": "FiveWs.where[x]"
          },
          {
            "identity": "rim",
            "map": "* Role.Class =SDLOC\n*Role.Code = ServiceDeliveryLocationRoleType\n *Entity.Code  = PlaceEntityType = df.Types of places for  Entity.Class = PLC\n*EntityClass = PLC = df.A physical place or site with its containing structure. May be natural or man-made. The geographic position of a place might or might not be constant."
          },
          {
            "identity": "w3c.prov",
            "map": "Activity.location"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.location"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.policy",
        "path": "AuditEvent.agent.policy",
        "short": "The authority the interaction was performed under",
        "definition": "The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.",
        "comment": "Where an interaction was authorised by something nameable -- a consent directive, a provincial consent-override transaction -- its identifier belongs here as a URI. Not produced today; named so that a producer of such a record has a declared element rather than an invented one.",
        "requirements": "This value is used retrospectively to determine the authorization policies.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.agent.policy",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "uri"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.why[x]"
          },
          {
            "identity": "rim",
            "map": "ActPolicyType"
          },
          {
            "identity": "dicom",
            "map": "ParticipantRoleIDCode"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.policy"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.media",
        "path": "AuditEvent.agent.media",
        "short": "Type of media",
        "definition": "Type of media involved. Used when the event is about exporting/importing onto media.",
        "requirements": "Usually, this is used instead of specifying a network address. This field is not used for Media Id (i.e. the serial number of a CD).",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.media",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "DICOMMediaType"
            }
          ],
          "strength": "extensible",
          "description": "Used when the event is about exporting/importing onto media.",
          "valueSet": "http://hl7.org/fhir/ValueSet/dicm-405-mediatype"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.where[x]"
          },
          {
            "identity": "rim",
            "map": ".player.description.mediaType"
          },
          {
            "identity": "dicom",
            "map": "MediaType"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network",
        "path": "AuditEvent.agent.network",
        "short": "Where the request came from",
        "definition": "Logical network location for application activity, if the activity has a network location.",
        "comment": "NOT populated. The platform's access log does not record the requesting network address on ordinary entries, so a consumer must not expect one and must not treat its absence as evidence about the origin of a request. Constraining it would assert a guarantee that does not exist. What would settle it is the address being captured at the API tier; the element is named here so that it lands in the right place when it is.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.network",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.where[x]"
          },
          {
            "identity": "rim",
            "map": ".player.description.reference"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network.id",
        "path": "AuditEvent.agent.network.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network.extension",
        "path": "AuditEvent.agent.network.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network.modifierExtension",
        "path": "AuditEvent.agent.network.modifierExtension",
        "short": "Extensions that cannot be ignored even if unrecognized",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content",
          "modifiers"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "BackboneElement.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network.address",
        "path": "AuditEvent.agent.network.address",
        "short": "Identifier for the network access point of the user device",
        "definition": "An identifier for the network access point of the user device for the audit event.",
        "comment": "This could be a device id, IP address or some other identifier associated with a device.",
        "requirements": "This datum identifies the user's network access point, which may be distinct from the server that performed the action. It is an optional value that may be used to group events recorded on separate servers for analysis of a specific network access point's data access across all servers.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.network.address",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.where[x]"
          },
          {
            "identity": "rim",
            "map": "pre-coordinated into URL"
          },
          {
            "identity": "dicom",
            "map": "NetworkAccessPointID"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Location"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.network.type",
        "path": "AuditEvent.agent.network.type",
        "short": "The type of network access point",
        "definition": "An identifier for the type of network access point that originated the audit event.",
        "requirements": "This datum identifies the type of network access point identifier of the user device for the audit event. It is an optional value that may be used to group events recorded on separate servers for analysis of access according to a network access point's type.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.agent.network.type",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "code"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventAgentNetworkType"
            }
          ],
          "strength": "required",
          "description": "The type of network access point of this agent in the audit event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/network-type|4.0.1"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.where[x]"
          },
          {
            "identity": "rim",
            "map": "pre-coordinated into URL"
          },
          {
            "identity": "dicom",
            "map": "NetworkAccessPointTypeCode"
          }
        ]
      },
      {
        "id": "AuditEvent.agent.purposeOfUse",
        "path": "AuditEvent.agent.purposeOfUse",
        "short": "Reason given for this user",
        "definition": "The reason (purpose of use), specific to this agent, that was used during the event being recorded.",
        "comment": "Use AuditEvent.agent.purposeOfUse when you know that is specific to the agent, otherwise use AuditEvent.purposeOfEvent. For example, during a machine-to-machine transfer it might not be obvious to the audit system who caused the event, but it does know why.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.agent.purposeOfUse",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "CodeableConcept"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditPurposeOfUse"
            }
          ],
          "strength": "extensible",
          "description": "The reason the activity took place.",
          "valueSet": "http://terminology.hl7.org/ValueSet/v3-PurposeOfUse"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.why[x]"
          },
          {
            "identity": "rim",
            "map": "*.reasonCode [ActHealthInformationPurposeOfUseReason codes/v:PurposeOfUse\n(2.16.840.1.113883.1.11.20448)\n* .outboundRelationship[typeCode=RSON or SUBJ].target"
          },
          {
            "identity": "w3c.prov",
            "map": "Agent.Activity"
          }
        ]
      },
      {
        "id": "AuditEvent.source",
        "path": "AuditEvent.source",
        "short": "The system that recorded the entry",
        "definition": "The system that is reporting the event.",
        "comment": "R4 makes `source` 1..1 and `source.observer` 1..1, so any conformant instance must name an observer. The platform's access log does not record which service produced an entry: entries arrive from every service in the estate on one shared channel and carry no producer identity. A projection therefore has to supply the observer from the endpoint doing the projecting rather than read it from the entry. Treat `source.observer` as naming the reporting endpoint, not the service where the interaction occurred.",
        "requirements": "The event is reported by one source.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.source",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.witness"
          },
          {
            "identity": "rim",
            "map": ".participation[typeCode=INF].role[classCode=ASSIGN].player[classCode=DEV, determinerCode=INSTANCE]"
          },
          {
            "identity": "dicom",
            "map": "AuditSourceIdentification"
          }
        ]
      },
      {
        "id": "AuditEvent.source.id",
        "path": "AuditEvent.source.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.source.extension",
        "path": "AuditEvent.source.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.source.modifierExtension",
        "path": "AuditEvent.source.modifierExtension",
        "short": "Extensions that cannot be ignored even if unrecognized",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content",
          "modifiers"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "BackboneElement.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.source.site",
        "path": "AuditEvent.source.site",
        "short": "The logical source location",
        "definition": "Logical source location within the healthcare enterprise network.  For example, a hospital or other provider location within a multi-entity provider group.",
        "comment": "Not populated. The estate is multi-tenant and an entry is scoped to its tenant, but tenancy is carried out of band rather than on the resource, so this element does not receive it. A projection serving more than one tenant must scope its results rather than expecting a reader to filter on this.",
        "requirements": "This value differentiates among the sites in a multi-site enterprise health information system.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.source.site",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.witness"
          },
          {
            "identity": "rim",
            "map": ".scopedRole[classCode=LOCE].player.desc"
          },
          {
            "identity": "dicom",
            "map": "AuditEnterpriseSiteId"
          }
        ]
      },
      {
        "id": "AuditEvent.source.observer",
        "path": "AuditEvent.source.observer",
        "short": "The identity of source detecting the event",
        "definition": "Identifier of the source where the event was detected.",
        "requirements": "This field ties the event to a specific source system. It may be used to group events for analysis according to where the event was detected.",
        "alias": [
          "SourceId"
        ],
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.source.observer",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/PractitionerRole",
              "http://hl7.org/fhir/StructureDefinition/Practitioner",
              "http://hl7.org/fhir/StructureDefinition/Organization",
              "http://hl7.org/fhir/StructureDefinition/Device",
              "http://hl7.org/fhir/StructureDefinition/Patient",
              "http://hl7.org/fhir/StructureDefinition/RelatedPerson"
            ]
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.witness"
          },
          {
            "identity": "rim",
            "map": ".id"
          },
          {
            "identity": "dicom",
            "map": "AuditSourceId"
          }
        ]
      },
      {
        "id": "AuditEvent.source.type",
        "path": "AuditEvent.source.type",
        "short": "The type of source where event originated",
        "definition": "Code specifying the type of source where event originated.",
        "requirements": "This field indicates which type of source is identified by the Audit Source ID. It is an optional value that may be used to group events for analysis according to the type of source where the event occurred.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.source.type",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventSourceType"
            }
          ],
          "strength": "extensible",
          "description": "Code specifying the type of system that detected and recorded the event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-source-type"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.witness"
          },
          {
            "identity": "rim",
            "map": ".code"
          },
          {
            "identity": "dicom",
            "map": "AuditSourceTypeCode"
          }
        ]
      },
      {
        "id": "AuditEvent.entity",
        "path": "AuditEvent.entity",
        "short": "The records the interaction concerned",
        "definition": "What the interaction was about. For an interaction with a chart record this is the record itself;\nan entry may name more than one, and a single interaction that touched several records names each.\n\nThe platform's log carries the target of the interaction plus a set of correlation identifiers\ngathered from the enclosing operation, so that the entries written for one transaction can be\nretrieved together. Projected here, each of those is an `entity`.\n\nCOVERAGE IS THE WHOLE TYPE SPACE, not the set this guide profiles. Every R4 resource type reaching\nthe FHIR API is classified and logged, including types this specification does not model. A\nconsumer should not assume that the types appearing in an access log are the types described here.",
        "comment": "Optional (`0..*`) because entries describing an activity rather than a record -- a credential exchange, a report run -- legitimately concern no resource.",
        "requirements": "The event may have other entities involved.",
        "alias": [
          "ParticipantObject"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.entity",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "sev-1",
            "severity": "error",
            "human": "Either a name or a query (NOT both)",
            "expression": "name.empty() or query.empty()",
            "xpath": "not(exists(f:name)) or not(exists(f:query))"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".outboundRelationship[typeCode=SUBJ].target  or  .participation[typeCode=SBJ].role"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectIdentification"
          },
          {
            "identity": "w3c.prov",
            "map": "Entity"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.target, Provenance.entity"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.id",
        "path": "AuditEvent.entity.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.extension",
        "path": "AuditEvent.entity.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.modifierExtension",
        "path": "AuditEvent.entity.modifierExtension",
        "short": "Extensions that cannot be ignored even if unrecognized",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content",
          "modifiers"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "BackboneElement.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.what",
        "path": "AuditEvent.entity.what",
        "short": "The record concerned",
        "definition": "Identifies a specific instance of the entity. The reference should be version specific.",
        "comment": "Per the Nexus EMR logical-reference model this MAY be identifier-only, and in a projection of the platform's log it usually IS: the log stores the target's identifier rather than a resolvable reference. A consumer treating a reference with no literal `reference` as absent will read most entries as concerning nothing. NOTE also that the log records a target identifier only where the record's id takes the platform's identifier form; entries for records whose id does not take that form are recorded WITHOUT a target, and the interaction is then reconstructable only from the entry's other elements.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.what",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "http://hl7.org/fhir/StructureDefinition/Resource"
            ]
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": ".id"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectID and ParticipantObjectIDTypeCode"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.target, Provenance.entity.what"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.type",
        "path": "AuditEvent.entity.type",
        "short": "What kind of thing the record is",
        "definition": "The type of the object that was involved in this audit event.",
        "comment": "Bound extensibly by R4 to a four-value vocabulary (person, system object, organization, other), which is coarser than the resource type a reader usually wants. Where `entity.what` is a typed reference the resource type is readable there and is the better answer; this element says only which of the four kinds it falls into.",
        "requirements": "To describe the object being acted upon. In addition to queries on the subject of the action in an auditable event, it is also important to be able to query on the object type for the action.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.type",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventEntityType"
            }
          ],
          "strength": "extensible",
          "description": "Code for the entity type involved in the audit event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/audit-entity-type"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.what[x]"
          },
          {
            "identity": "rim",
            "map": "[self::Act].code or role.player.code"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectTypeCode"
          },
          {
            "identity": "w3c.prov",
            "map": "Entity.type"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.entity.type"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.role",
        "path": "AuditEvent.entity.role",
        "short": "What role the entity played",
        "definition": "Code representing the role the entity played in the event being audited.",
        "requirements": "For some detailed audit analysis it may be necessary to indicate a more granular type of entity, based on the application role it serves.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.role",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventEntityRole"
            }
          ],
          "strength": "extensible",
          "description": "Code representing the role the entity played in the audit event.",
          "valueSet": "http://hl7.org/fhir/ValueSet/object-role"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": "role.code (not sure what this would mean for an Act)"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectTypeCodeRole"
          },
          {
            "identity": "w3c.prov",
            "map": "Entity.role"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.lifecycle",
        "path": "AuditEvent.entity.lifecycle",
        "short": "Life-cycle stage for the entity",
        "definition": "Identifier for the data life-cycle stage for the entity.",
        "comment": "This can be used to provide an audit trail for data, over time, as it passes through the system.",
        "requirements": "Institutional policies for privacy and security may optionally fall under different accountability rules based on data life cycle. This provides a differentiating value for those cases.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.lifecycle",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "AuditEventEntityLifecycle"
            }
          ],
          "strength": "extensible",
          "description": "Identifier for the data life-cycle stage for the entity.",
          "valueSet": "http://hl7.org/fhir/ValueSet/object-lifecycle-events"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": "target of ObservationEvent[code=\"lifecycle\"].value"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectDataLifeCycle"
          },
          {
            "identity": "w3c.prov",
            "map": "Entity.role"
          },
          {
            "identity": "fhirprovenance",
            "map": "Provenance.entity.role"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.securityLabel",
        "path": "AuditEvent.entity.securityLabel",
        "short": "Security labels on the entity",
        "definition": "Security labels for the identified entity.",
        "comment": "Copied from entity meta security tags.",
        "requirements": "This field identifies the security labels for a specific instance of an object, such as a patient, to detect/track privacy and security issues.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.entity.securityLabel",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "binding": {
          "extension": [
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-bindingName",
              "valueString": "SecurityLabels"
            },
            {
              "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-isCommonBinding",
              "valueBoolean": true
            }
          ],
          "strength": "extensible",
          "description": "Security Labels from the Healthcare Privacy and Security Classification System.",
          "valueSet": "http://hl7.org/fhir/ValueSet/security-labels"
        },
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".confidentialityCode"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectSensitivity"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.name",
        "path": "AuditEvent.entity.name",
        "short": "Descriptor for entity",
        "definition": "A name of the entity in the audit event.",
        "comment": "This field may be used in a query/report to identify audit events for a specific person.  For example, where multiple synonymous entity identifiers (patient number, medical record number, encounter number, etc.) have been used.",
        "requirements": "Use only where entity can't be identified with an identifier.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.name",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          }
        ],
        "condition": [
          "sev-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".title"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectName"
          },
          {
            "identity": "w3c.prov",
            "map": "Entity.Label"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.description",
        "path": "AuditEvent.entity.description",
        "short": "Descriptive text",
        "definition": "Text that describes the entity in more detail.",
        "requirements": "Use only where entity can't be identified with an identifier.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.description",
          "min": 0,
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".text"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectDescription"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.query",
        "path": "AuditEvent.entity.query",
        "short": "Query parameters",
        "definition": "The query parameters for a query-type entities.",
        "comment": "The meaning and secondary-encoding of the content of base64 encoded blob is specific to the AuditEvent.type, AuditEvent.subtype, AuditEvent.entity.type, and AuditEvent.entity.role.  The base64 is a general-use and safe container for event specific data blobs regardless of the encoding used by the transaction being recorded.  An AuditEvent consuming application must understand the event it is consuming and the formats used by the event. For example, if auditing an Oracle network database access, the Oracle formats must be understood as they will be simply encoded in the base64binary blob.",
        "requirements": "For query events, it may be necessary to capture the actual query input to the query process in order to identify the specific event. Because of differences among query implementations and data encoding for them, this is a base 64 encoded data blob. It may be subsequently decoded or interpreted by downstream audit analysis processing.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.query",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "base64Binary"
          }
        ],
        "condition": [
          "sev-1"
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": true,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": "No mapping"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectQuery"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail",
        "path": "AuditEvent.entity.detail",
        "short": "Named values carrying detail about the record concerned",
        "definition": "Tagged value pairs for conveying additional information about the entity.",
        "comment": "Where an entry needs to carry a measured value about what it describes -- how many pages a disclosure withheld, which parameters a report ran with -- this is the element for it, as a named type with its value. No detail names are fixed by this guide, so a consumer must read the `type` string rather than assume a position.",
        "requirements": "Implementation-defined data about specific details of the object accessed or used.",
        "min": 0,
        "max": "*",
        "base": {
          "path": "AuditEvent.entity.detail",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "BackboneElement"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "mustSupport": true,
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".inboundRelationship[typeCode=SUBJ].target[classCode=OBS, moodCode=EVN]"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectDetail"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail.id",
        "path": "AuditEvent.entity.detail.id",
        "representation": [
          "xmlAttr"
        ],
        "short": "Unique id for inter-element referencing",
        "definition": "Unique id for the element within a resource (for internal references). This may be any string value that does not contain spaces.",
        "min": 0,
        "max": "1",
        "base": {
          "path": "Element.id",
          "min": 0,
          "max": "1"
        },
        "type": [
          {
            "code": "http://hl7.org/fhirpath/System.String",
            "extension": [
              {
                "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-fhir-type",
                "valueUrl": "string"
              }
            ]
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail.extension",
        "path": "AuditEvent.entity.detail.extension",
        "short": "Additional content defined by implementations",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element. To make the use of extensions safe and manageable, there is a strict set of governance  applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension.",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "alias": [
          "extensions",
          "user content"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "Element.extension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "rim",
            "map": "n/a"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail.modifierExtension",
        "path": "AuditEvent.entity.detail.modifierExtension",
        "short": "Extensions that cannot be ignored even if unrecognized",
        "definition": "May be used to represent additional information that is not part of the basic definition of the element and that modifies the understanding of the element in which it is contained and/or the understanding of the containing element's descendants. Usually modifier elements provide negation or qualification. To make the use of extensions safe and manageable, there is a strict set of governance applied to the definition and use of extensions. Though any implementer can define an extension, there is a set of requirements that SHALL be met as part of the definition of the extension. Applications processing a resource are required to check for modifier extensions.\n\nModifier extensions SHALL NOT change the meaning of any elements on Resource or DomainResource (including cannot change the meaning of modifierExtension itself).",
        "comment": "There can be no stigma associated with the use of extensions by any application, project, or standard - regardless of the institution or jurisdiction that uses or defines the extensions.  The use of extensions is what allows the FHIR specification to retain a core level of simplicity for everyone.",
        "requirements": "Modifier extensions allow for extensions that *cannot* be safely ignored to be clearly distinguished from the vast majority of extensions which can be safely ignored.  This promotes interoperability by eliminating the need for implementers to prohibit the presence of extensions. For further information, see the [definition of modifier extensions](extensibility.html#modifierExtension).",
        "alias": [
          "extensions",
          "user content",
          "modifiers"
        ],
        "min": 0,
        "max": "*",
        "base": {
          "path": "BackboneElement.modifierExtension",
          "min": 0,
          "max": "*"
        },
        "type": [
          {
            "code": "Extension"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          },
          {
            "key": "ext-1",
            "severity": "error",
            "human": "Must have either extensions or value[x], not both",
            "expression": "extension.exists() != value.exists()",
            "xpath": "exists(f:extension)!=exists(f:*[starts-with(local-name(.), \"value\")])",
            "source": "http://hl7.org/fhir/StructureDefinition/Extension"
          }
        ],
        "isModifier": true,
        "isModifierReason": "Modifier extensions are expected to modify the meaning or interpretation of the element that contains them",
        "isSummary": true,
        "mapping": [
          {
            "identity": "rim",
            "map": "N/A"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail.type",
        "path": "AuditEvent.entity.detail.type",
        "short": "Name of the property",
        "definition": "The type of extra detail provided in the value.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.detail.type",
          "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())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".code"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectDetail.type"
          }
        ]
      },
      {
        "id": "AuditEvent.entity.detail.value[x]",
        "path": "AuditEvent.entity.detail.value[x]",
        "short": "Property value",
        "definition": "The  value of the extra detail.",
        "comment": "The value can be string when known to be a string, else base64 encoding should be used to protect binary or undefined content.  The meaning and secondary-encoding of the content of base64 encoded blob is specific to the AuditEvent.type, AuditEvent.subtype, AuditEvent.entity.type, and AuditEvent.entity.role.  The base64 is a general-use and safe container for event specific data blobs regardless of the encoding used by the transaction being recorded.  An AuditEvent consuming application must understand the event it is consuming and the formats used by the event. For example if auditing an Oracle network database access, the Oracle formats must be understood as they will be simply encoded in the base64binary blob.",
        "requirements": "Should not duplicate the entity value unless absolutely necessary.",
        "min": 1,
        "max": "1",
        "base": {
          "path": "AuditEvent.entity.detail.value[x]",
          "min": 1,
          "max": "1"
        },
        "type": [
          {
            "code": "string"
          },
          {
            "code": "base64Binary"
          }
        ],
        "constraint": [
          {
            "key": "ele-1",
            "severity": "error",
            "human": "All FHIR elements must have a @value or children",
            "expression": "hasValue() or (children().count() > id.count())",
            "xpath": "@value|f:*|h:div",
            "source": "http://hl7.org/fhir/StructureDefinition/Element"
          }
        ],
        "isModifier": false,
        "isSummary": false,
        "mapping": [
          {
            "identity": "w5",
            "map": "FiveWs.context"
          },
          {
            "identity": "rim",
            "map": ".value"
          },
          {
            "identity": "dicom",
            "map": "ParticipantObjectDetail.value"
          }
        ]
      }
    ]
  },
  "differential": {
    "element": [
      {
        "id": "AuditEvent",
        "path": "AuditEvent",
        "short": "Nexus EMR AuditEvent Core",
        "definition": "A record of an interaction with the estate: the actor, the moment, the interaction performed, its\noutcome, and the records it concerned.\n\nAudit entries are append-only by intent. An entry describes something that happened; correcting it\nby rewriting it destroys the property that makes it worth keeping. Where an entry is wrong, record\na further entry.",
        "constraint": [
          {
            "key": "auditevent-names-an-actor",
            "severity": "warning",
            "human": "An AuditEvent SHOULD name who acted -- at least one agent carrying a resolvable `who` reference or an `altId` user identifier. An entry naming no actor answers none of the questions an access log exists to answer",
            "expression": "agent.where(who.exists() or altId.exists()).exists()",
            "source": "https://fhir.apps.health/StructureDefinition/nexus-emr-core-auditevent"
          }
        ]
      },
      {
        "id": "AuditEvent.text",
        "path": "AuditEvent.text",
        "short": "Narrative",
        "definition": "A human-readable narrative summary of the NexusEmrCoreAuditEvent resource for human interpretation.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.type",
        "path": "AuditEvent.type",
        "short": "What kind of event this is",
        "comment": "Required by R4 (1..1) and NOT yet fixed by this guide, though two values are recommended and both\ncome from the standard vocabulary rather than from a local one.\n\n`http://terminology.hl7.org/CodeSystem/audit-event-type#rest` for an entry describing a FHIR API\ninteraction, which is what a projection of the platform's access log writes for the great majority of\nentries. `http://dicom.nema.org/resources/ontology/DCM#110106` (Export) for an entry describing\ninformation LEAVING the estate -- a packet released, a report downloaded, a referral transmitted --\nbecause `action` cannot express that distinction and a disclosure report has to be able to find those\nentries. Recommended rather than required: nothing writes an AuditEvent through this API today, so\nfixing a value would constrain a producer that does not exist. Do not invent a local vocabulary here.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.subtype",
        "path": "AuditEvent.subtype",
        "short": "The narrower activity, where the event is not simply a REST interaction",
        "comment": "Where an entry describes a named platform activity rather than an interaction with a chart record --\nassembling a document packet, launching a billing handoff, running an eligibility check, exchanging\ncredentials, transmitting a referral -- the activity belongs here rather than on `entity`.\n\nNO VOCABULARY IS PUBLISHED FOR THAT SET. The platform's log carries its own activity names, and this\nguide does not yet declare a code system for them: the majority of the values name FHIR resource\ntypes, which already have a published code system, and minting a second one that restates them would\nbe a permanent commitment to a duplicate. What would settle it is the residue -- the values that name\na platform activity rather than a resource type -- published as a code system in its own right.\nUntil then, read `subtype` liberally and do not assume a system URI.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.action",
        "path": "AuditEvent.action",
        "short": "create | read | update | delete | execute",
        "comment": "R4 binds this to five codes (`C`, `R`, `U`, `D`, `E`) and this guide adds none.\n\nTWO THINGS A READER MUST KNOW. First, every interaction that is not a create, an update or a delete\nis recorded as a READ -- searches, version reads and history reads included. `R` therefore means\n\"the record was disclosed to someone\", which is what a privacy report wants, and does not mean a\nsingle-resource GET. A search that returned twelve records yields TWELVE read entries, one per\nrecord returned, rather than one entry for the search: the question an access log has to answer is\nwhich records were disclosed, not how many queries were run. Count records, not entries, and expect\na busy chart view to produce many.\n\nSecond, the platform distinguishes a TRANSMISSION -- a referral sent to an external party, a report\nexported or downloaded -- from an ordinary read, and R4's five codes do not express that distinction.\nUntil it is settled, a transmission projected here appears as `R`, and the fact that it left the\nestate is carried on `type`/`subtype` rather than on `action`. A consumer answering \"what was\ndisclosed outside the clinic\" must therefore not read `action` alone. Settling it means either\nassigning the standard export event type on `type` as a required convention, or an extension; this\nguide has done neither yet.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.period",
        "path": "AuditEvent.period",
        "short": "When the activity itself occurred",
        "comment": "Preferred over `recorded` as THE moment where it is present, for the reason above. The platform's access log does not populate it today, so it is optional and its absence is expected rather than a defect.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.recorded",
        "path": "AuditEvent.recorded",
        "short": "When the entry was recorded",
        "comment": "R4 makes this 1..1, and it is the one element every entry carries. It is the moment the entry was PERSISTED, which is not exactly the moment of the interaction: entries reach the log asynchronously and the stamp is applied on arrival. The difference is small and it is not zero. Order interactions by it freely; reconcile it against an external timestamp with care, and prefer `period` where an entry carries one.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.outcome",
        "path": "AuditEvent.outcome",
        "short": "0 | 4 | 8 | 12 -- whether the interaction succeeded",
        "comment": "The platform records three outcomes -- succeeded, failed, and could not be determined -- against\nR4's four severity-graded codes. The mapping this guide states: a success is `0`; a failure is `4`\n(minor failure), because the platform does not grade failures and claiming a serious or major\nfailure would assert something it did not observe; an undetermined outcome carries NO code.\n\nREAD AN ABSENT `outcome` AS UNKNOWN, NEVER AS SUCCESS. It is the single most consequential misread\navailable on this resource: an access whose outcome could not be determined is exactly the access a\nprivacy review wants surfaced, and defaulting it to success buries it.\n\nONE CLASS OF ENTRY CARRIES A SUCCESS OUTCOME THAT IS NOT A CLAIM ABOUT THE RESULT. An entry recorded\nfor an INVOKED OPERATION is written when the invocation is accepted, before the operation has\nresolved, and records that the attempt was made. Its outcome is not evidence that the operation\nsucceeded. Entries for record interactions are written on the response and their outcome does reflect\nit.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.outcomeDesc",
        "path": "AuditEvent.outcomeDesc",
        "short": "Free-text detail about the event",
        "comment": "The platform's log carries an optional free-text detail on any entry, not only on a failure. R4 scopes this element to describing the outcome, which is narrower than what is written; a consumer should treat the text as descriptive of the event and should not assume it is present only on failures, nor that it is machine-readable.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.purposeOfEvent",
        "path": "AuditEvent.purposeOfEvent",
        "short": "Why the interaction took place",
        "definition": "The reason the interaction occurred, bound extensibly by R4 to the standard purpose-of-use\nvocabulary (treatment, payment, operations, emergency treatment, and the rest).\n\n**This guide does not yet constrain it, and emergency access is the reason to say so explicitly.**\nWhere a clinician overrides a patient's restriction on their record to obtain information in an\nemergency, this element -- together with `agent.purposeOfUse` and `agent.policy` -- is where base R4\nrecords that the access was an override and under what authority. That is the shape a reader should\nexpect if and when such a record appears.\n\n**No such record is produced in this estate today.** Nothing implements an emergency-access\noverride, and this guide therefore constrains nothing about one: no code is fixed, no element is\nmade mandatory, and no invariant asserts that an override carries a justification. Read the absence\nof `purposeOfEvent` on an entry as \"not recorded\", not as \"routine access\".\n\nWhat would settle it: the override itself becoming a product behaviour, at which point the question\nthis guide has to answer is whether the override is a coded purpose on the access entry, as here, or\na separate record of its own with the access entry pointing at it. The two differ in whether the\njustification is queryable independently of the access it authorised.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent",
        "path": "AuditEvent.agent",
        "short": "Who acted",
        "definition": "The actor or actors involved in the interaction. R4 makes this `1..*`.\n\nThe platform's access log records exactly ONE actor per entry: the identity that made the request.\nEntries carrying a second agent -- a recipient of a disclosure, a system acting on a user's behalf --\nare permitted by R4 and are not produced today.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.who",
        "path": "AuditEvent.agent.who",
        "short": "The actor, where it resolves to a resource",
        "comment": "Left OPTIONAL deliberately. The identity the platform holds for an actor is an identity-provider subject, not a resource reference, and resolving it needs an identity directory this guide does not describe; not every actor has a Practitioner resource at all. Where a producer CAN resolve the actor it should write both this and `altId`. Per the Nexus EMR logical-reference model the reference MAY be identifier-only.",
        "type": [
          {
            "code": "Reference",
            "targetProfile": [
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-practitioner",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-practitionerrole",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-patient",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-relatedperson",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-organization",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-appdevice",
              "https://fhir.apps.health/StructureDefinition/nexus-emr-core-emrdevice"
            ]
          }
        ],
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.altId",
        "path": "AuditEvent.agent.altId",
        "short": "The acting user's identity-provider subject",
        "definition": "The opaque account identifier the identity provider issues for the acting user (for example\n`auth0|abc123`). This is the identity the platform actually holds on every entry, and it is the\nelement to match on when correlating an audit entry with the `meta-updated-by` extension on a\nresource version -- the two carry the same kind of value for the same reason.\n\nNOT a FHIR id and NOT a Practitioner reference. Resolving it to a person needs the identity\ndirectory, which this guide does not describe.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.name",
        "path": "AuditEvent.agent.name",
        "short": "Human-readable label for the actor",
        "comment": "A display label -- the actor's username, falling back to their email address where no username is held. FOR DISPLAY ONLY. It is not stable, it is not unique, and it must never be used for an authorization or matching decision; `altId` is the identity.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.requestor",
        "path": "AuditEvent.agent.requestor",
        "short": "Whether this agent initiated the interaction",
        "comment": "R4 makes this 1..1. The single agent on a platform-produced entry is the requester, so `true` is the expected value; an entry naming a second, non-initiating agent sets it `false` on that agent.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.policy",
        "path": "AuditEvent.agent.policy",
        "short": "The authority the interaction was performed under",
        "comment": "Where an interaction was authorised by something nameable -- a consent directive, a provincial consent-override transaction -- its identifier belongs here as a URI. Not produced today; named so that a producer of such a record has a declared element rather than an invented one.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.agent.network",
        "path": "AuditEvent.agent.network",
        "short": "Where the request came from",
        "comment": "NOT populated. The platform's access log does not record the requesting network address on ordinary entries, so a consumer must not expect one and must not treat its absence as evidence about the origin of a request. Constraining it would assert a guarantee that does not exist. What would settle it is the address being captured at the API tier; the element is named here so that it lands in the right place when it is.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.source",
        "path": "AuditEvent.source",
        "short": "The system that recorded the entry",
        "comment": "R4 makes `source` 1..1 and `source.observer` 1..1, so any conformant instance must name an observer. The platform's access log does not record which service produced an entry: entries arrive from every service in the estate on one shared channel and carry no producer identity. A projection therefore has to supply the observer from the endpoint doing the projecting rather than read it from the entry. Treat `source.observer` as naming the reporting endpoint, not the service where the interaction occurred.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.source.site",
        "path": "AuditEvent.source.site",
        "short": "The logical source location",
        "comment": "Not populated. The estate is multi-tenant and an entry is scoped to its tenant, but tenancy is carried out of band rather than on the resource, so this element does not receive it. A projection serving more than one tenant must scope its results rather than expecting a reader to filter on this.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.entity",
        "path": "AuditEvent.entity",
        "short": "The records the interaction concerned",
        "definition": "What the interaction was about. For an interaction with a chart record this is the record itself;\nan entry may name more than one, and a single interaction that touched several records names each.\n\nThe platform's log carries the target of the interaction plus a set of correlation identifiers\ngathered from the enclosing operation, so that the entries written for one transaction can be\nretrieved together. Projected here, each of those is an `entity`.\n\nCOVERAGE IS THE WHOLE TYPE SPACE, not the set this guide profiles. Every R4 resource type reaching\nthe FHIR API is classified and logged, including types this specification does not model. A\nconsumer should not assume that the types appearing in an access log are the types described here.",
        "comment": "Optional (`0..*`) because entries describing an activity rather than a record -- a credential exchange, a report run -- legitimately concern no resource.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.entity.what",
        "path": "AuditEvent.entity.what",
        "short": "The record concerned",
        "comment": "Per the Nexus EMR logical-reference model this MAY be identifier-only, and in a projection of the platform's log it usually IS: the log stores the target's identifier rather than a resolvable reference. A consumer treating a reference with no literal `reference` as absent will read most entries as concerning nothing. NOTE also that the log records a target identifier only where the record's id takes the platform's identifier form; entries for records whose id does not take that form are recorded WITHOUT a target, and the interaction is then reconstructable only from the entry's other elements.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.entity.type",
        "path": "AuditEvent.entity.type",
        "short": "What kind of thing the record is",
        "comment": "Bound extensibly by R4 to a four-value vocabulary (person, system object, organization, other), which is coarser than the resource type a reader usually wants. Where `entity.what` is a typed reference the resource type is readable there and is the better answer; this element says only which of the four kinds it falls into.",
        "mustSupport": true
      },
      {
        "id": "AuditEvent.entity.detail",
        "path": "AuditEvent.entity.detail",
        "short": "Named values carrying detail about the record concerned",
        "comment": "Where an entry needs to carry a measured value about what it describes -- how many pages a disclosure withheld, which parameters a report ran with -- this is the element for it, as a named type with its value. No detail names are fixed by this guide, so a consumer must read the `type` string rather than assume a position.",
        "mustSupport": true
      }
    ]
  }
}
