{
  "resourceType": "StructureDefinition",
  "id": "ei-attachment-observation",
  "meta": {
    "lastUpdated": "2019-12-13T05:13:18.99+00:00"
  },
  "url": "http://www.agfa.com/ei/fhir/StructureDefinition/ei-attachment-observation",
  "version": "1.1",
  "name": "Enterprise Imaging Attachment Observation",
  "status": "active",
  "fhirVersion": "3.0.1",
  "mapping": [
    {
      "identity": "agfa-ei-model",
      "name": "Enterprise Imaging Data Model"
    }
  ],
  "kind": "resource",
  "abstract": false,
  "type": "Observation",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/Observation",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "Observation",
        "path": "Observation",
        "short": "Attachment",
        "definition": "Text and keyword attachment of all levels under Enterprise Imaging"
      },
      {
        "id": "Observation.extension",
        "path": "Observation.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.extension:attributes",
        "path": "Observation.extension",
        "sliceName": "attributes",
        "type": [
          {
            "code": "Extension",
            "profile": "http://www.agfa.com/ei/fhir/StructureDefinition/ei-attachment-attributes"
          }
        ]
      },
      {
        "id": "Observation.basedOn",
        "path": "Observation.basedOn",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/ProcedureRequest"
          }
        ]
      },
      {
        "id": "Observation.basedOn.identifier",
        "path": "Observation.basedOn.identifier",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "REQUESTED_PROCEDURE"
          }
        ]
      },
      {
        "id": "Observation.basedOn.identifier.use",
        "path": "Observation.basedOn.identifier.use",
        "max": "0"
      },
      {
        "id": "Observation.basedOn.identifier.type",
        "path": "Observation.basedOn.identifier.type",
        "max": "0"
      },
      {
        "id": "Observation.basedOn.identifier.value",
        "path": "Observation.basedOn.identifier.value",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "REQUESTED_PROCEDURE#STUDY_UID"
          },
          {
            "identity": "agfa-ei-model",
            "map": "REQUESTED_PROCEDURE#PROC_LEVEL_ACCESSIONNR"
          }
        ]
      },
      {
        "id": "Observation.basedOn.identifier.period",
        "path": "Observation.basedOn.identifier.period",
        "max": "0"
      },
      {
        "id": "Observation.basedOn.identifier.assigner",
        "path": "Observation.basedOn.identifier.assigner",
        "max": "0"
      },
      {
        "id": "Observation.basedOn.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Observation.basedOn.display",
        "max": "0"
      },
      {
        "id": "Observation.status",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/structuredefinition-display-hint",
            "valueString": "default: final"
          }
        ],
        "path": "Observation.status",
        "defaultValueCode": "preliminary",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "preliminary"
          }
        ]
      },
      {
        "id": "Observation.category",
        "path": "Observation.category",
        "short": "Attachment definition code",
        "comment": "Attachment definition code, used as the key of the attachment of various objects.",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ei-attachment"
          }
        ]
      },
      {
        "id": "Observation.category.coding.system",
        "path": "Observation.category.coding.system",
        "type": [
          {
            "code": "uri",
            "profile": "urn:ei-attachment-type"
          },
          {
            "code": "uri",
            "profile": "urn:ei-observation-type"
          }
        ]
      },
      {
        "id": "Observation.category.coding.version",
        "path": "Observation.category.coding.version",
        "max": "0"
      },
      {
        "id": "Observation.category.coding.code",
        "path": "Observation.category.coding.code",
        "defaultValueCode": "ei-attachment",
        "binding": {
          "strength": "required",
          "valueSetUri": "http://www.agfa.com/ei/fhir/ValueSet/ei-vs-attachment-type"
        },
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ei-attachment",
            "comment": "hard coded string"
          },
          {
            "identity": "agfa-ei-model",
            "map": "AttachmentType"
          }
        ]
      },
      {
        "id": "Observation.category.coding.userSelected",
        "path": "Observation.category.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Observation.category.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Observation.category.text",
        "max": "0"
      },
      {
        "id": "Observation.code.coding.version",
        "path": "Observation.code.coding.version",
        "max": "0"
      },
      {
        "id": "Observation.code.coding.code",
        "path": "Observation.code.coding.code",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ATTACHMENT_DEFINITION#CODE"
          }
        ]
      },
      {
        "id": "Observation.code.coding.display",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Observation.code.coding.display",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ATTACHMENT_DEFINITION#NAME"
          }
        ]
      },
      {
        "id": "Observation.code.coding.userSelected",
        "path": "Observation.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Observation.subject",
        "path": "Observation.subject",
        "short": "If the attachment is patient level attachment",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Patient"
          }
        ]
      },
      {
        "id": "Observation.issued",
        "path": "Observation.issued",
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ATTACHMENT#MODIFIED_ON"
          }
        ]
      },
      {
        "id": "Observation.issued.extension",
        "path": "Observation.issued.extension",
        "slicing": {
          "discriminator": [
            {
              "type": "value",
              "path": "url"
            }
          ],
          "rules": "open"
        }
      },
      {
        "id": "Observation.issued.extension:display",
        "path": "Observation.issued.extension",
        "sliceName": "display",
        "type": [
          {
            "code": "Extension",
            "profile": "http://www.agfa.com/ei/fhir/StructureDefinition/ei-display-name"
          }
        ]
      },
      {
        "id": "Observation.performer",
        "path": "Observation.performer",
        "type": [
          {
            "code": "Reference",
            "targetProfile": "http://hl7.org/fhir/StructureDefinition/Practitioner"
          }
        ],
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ATTACHMENT#CHANGEDBY"
          }
        ]
      },
      {
        "id": "Observation.value[x]",
        "path": "Observation.value[x]",
        "type": [
          {
            "code": "string"
          },
          {
            "code": "Attachment"
          }
        ],
        "mapping": [
          {
            "identity": "agfa-ei-model",
            "map": "ATTACHMENT#CONTENT_BLOB",
            "comment": "if it is a single value attachment"
          }
        ]
      },
      {
        "id": "Observation.dataAbsentReason",
        "path": "Observation.dataAbsentReason",
        "max": "0"
      },
      {
        "id": "Observation.interpretation",
        "path": "Observation.interpretation",
        "max": "0"
      },
      {
        "id": "Observation.comment",
        "path": "Observation.comment",
        "max": "0"
      },
      {
        "id": "Observation.bodySite",
        "path": "Observation.bodySite",
        "max": "0"
      },
      {
        "id": "Observation.method",
        "path": "Observation.method",
        "max": "0"
      },
      {
        "id": "Observation.specimen",
        "path": "Observation.specimen",
        "max": "0"
      },
      {
        "id": "Observation.device",
        "path": "Observation.device",
        "max": "0"
      },
      {
        "id": "Observation.referenceRange",
        "path": "Observation.referenceRange",
        "max": "0"
      },
      {
        "id": "Observation.related",
        "path": "Observation.related",
        "max": "0"
      },
      {
        "id": "Observation.component.code.coding.version",
        "path": "Observation.component.code.coding.version",
        "max": "0"
      },
      {
        "id": "Observation.component.code.coding.userSelected",
        "path": "Observation.component.code.coding.userSelected",
        "max": "0"
      },
      {
        "id": "Observation.component.code.text",
        "extension": [
          {
            "url": "http://hl7.org/fhir/StructureDefinition/elementdefinition-translatable",
            "valueBoolean": true
          }
        ],
        "path": "Observation.component.code.text",
        "max": "0"
      },
      {
        "id": "Observation.component.value[x]",
        "path": "Observation.component.value[x]",
        "type": [
          {
            "code": "string"
          },
          {
            "code": "Attachment"
          }
        ]
      },
      {
        "id": "Observation.component.dataAbsentReason",
        "path": "Observation.component.dataAbsentReason",
        "max": "0"
      },
      {
        "id": "Observation.component.interpretation",
        "path": "Observation.component.interpretation",
        "max": "0"
      },
      {
        "id": "Observation.component.referenceRange",
        "path": "Observation.component.referenceRange",
        "max": "0"
      }
    ]
  }
}