{
  "resourceType": "StructureDefinition",
  "id": "profile-fileattachment",
  "url": "https://fhir.synapxe.sg/StructureDefinition/profile-fileattachment",
  "name": "FileAttachment",
  "title": "File Attachment Profile",
  "status": "active",
  "description": "DocumentReference profile for storing file attachments associated with clinical documentation.",
  "fhirVersion": "5.0.0",
  "kind": "resource",
  "abstract": false,
  "type": "DocumentReference",
  "baseDefinition": "http://hl7.org/fhir/StructureDefinition/DocumentReference",
  "derivation": "constraint",
  "differential": {
    "element": [
      {
        "id": "DocumentReference",
        "path": "DocumentReference",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment`: Refers to content represented using file attachments.\n- `putComposition/composition/section/content/other/extension/fileAttachment`: Refers to data content represented using an external file format.\n- `putDischargeSummary/fileAttachment`: File attachments associated with the discharge summary.\n- `putEDNotes/fileAttachment`: Refers to data content represented using an attachment format.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm`: Rich text representation of the entire result as issued by the diagnostic service.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm`: Rich text representation of the report.\n- `putOTNotes/fileAttachment`: Refers to data content represented using an attachment format."
      },
      {
        "id": "DocumentReference.identifier",
        "path": "DocumentReference.identifier",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/sequenceNo`: Sequence number assigned to the attachment.\n- `putComposition/composition/section/content/other/extension/fileAttachment/sequenceId`: Display sequence number of the attachment.\n- `putDischargeSummary/fileAttachment/sequenceNo`: Sequence number assigned to the attachment.\n- `putEDNotes/fileAttachment/sequenceNo`: Sequence number of the attachment within the message payload.\n- `putOTNotes/fileAttachment/sequenceNo`: Sequence number assigned to the attachment within the message payload.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "Identifier",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-identifier-sequence-no"
            ]
          }
        ]
      },
      {
        "id": "DocumentReference.version",
        "path": "DocumentReference.version",
        "max": "0"
      },
      {
        "id": "DocumentReference.basedOn",
        "path": "DocumentReference.basedOn",
        "max": "0"
      },
      {
        "id": "DocumentReference.status",
        "path": "DocumentReference.status",
        "patternCode": "current"
      },
      {
        "id": "DocumentReference.docStatus",
        "path": "DocumentReference.docStatus",
        "max": "0"
      },
      {
        "id": "DocumentReference.modality",
        "path": "DocumentReference.modality",
        "max": "0"
      },
      {
        "id": "DocumentReference.type",
        "path": "DocumentReference.type",
        "max": "0"
      },
      {
        "id": "DocumentReference.category",
        "path": "DocumentReference.category",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/attachmentCategory`: Category of the attachment.\n- `putOTNotes/fileAttachment/attachmentCategory`: Code that classifies the category of the attachment.",
        "min": 0,
        "max": "1",
        "type": [
          {
            "code": "CodeableConcept",
            "profile": [
              "https://fhir.synapxe.sg/StructureDefinition/profile-codeableconcept"
            ]
          }
        ],
        "binding": {
          "strength": "required",
          "valueSet": "https://fhir.synapxe.sg/ValueSet/attachment-category"
        }
      },
      {
        "id": "DocumentReference.category.coding.system",
        "path": "DocumentReference.category.coding.system"
      },
      {
        "id": "DocumentReference.subject",
        "path": "DocumentReference.subject",
        "max": "0"
      },
      {
        "id": "DocumentReference.context",
        "path": "DocumentReference.context",
        "max": "0"
      },
      {
        "id": "DocumentReference.event",
        "path": "DocumentReference.event",
        "max": "0"
      },
      {
        "id": "DocumentReference.bodySite",
        "path": "DocumentReference.bodySite",
        "max": "0"
      },
      {
        "id": "DocumentReference.facilityType",
        "path": "DocumentReference.facilityType",
        "max": "0"
      },
      {
        "id": "DocumentReference.practiceSetting",
        "path": "DocumentReference.practiceSetting",
        "max": "0"
      },
      {
        "id": "DocumentReference.period",
        "path": "DocumentReference.period",
        "max": "0"
      },
      {
        "id": "DocumentReference.date",
        "path": "DocumentReference.date",
        "max": "0"
      },
      {
        "id": "DocumentReference.author",
        "path": "DocumentReference.author",
        "max": "0"
      },
      {
        "id": "DocumentReference.attester",
        "path": "DocumentReference.attester",
        "max": "0"
      },
      {
        "id": "DocumentReference.custodian",
        "path": "DocumentReference.custodian",
        "max": "0"
      },
      {
        "id": "DocumentReference.relatesTo",
        "path": "DocumentReference.relatesTo",
        "max": "0"
      },
      {
        "id": "DocumentReference.description",
        "path": "DocumentReference.description",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/comments`: Additional comments describing the attachment.\n- `putDischargeSummary/fileAttachment/comments`: Additional comments describing the attachment.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/comments`: Additional comments describing the attachment.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/comments`: Additional comments used to describe the attachment, if any\n- `putOTNotes/fileAttachment/comments`: Additional comments used to describe the attachment."
      },
      {
        "id": "DocumentReference.securityLabel",
        "path": "DocumentReference.securityLabel",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.id",
        "path": "DocumentReference.content.id",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.extension",
        "path": "DocumentReference.content.extension",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.modifierExtension",
        "path": "DocumentReference.content.modifierExtension",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.extension",
        "path": "DocumentReference.content.attachment.extension",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.contentType",
        "path": "DocumentReference.content.attachment.contentType",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/contentType`: MIME type of the attachment.\n- `putComposition/composition/section/content/other/extension/fileAttachment/contentType`: Identifies the type of content in the attachment and how it should be interpreted.\n- `putDischargeSummary/fileAttachment/contentType`: Identifies the type of data contained in the attachment and how it should be interpreted.\n- `putEDNotes/fileAttachment/contentType`: Type of content contained within the attachment.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/contentType`: Type of the attachment content.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/contentType`: Identifies the type of the data in the attachment and allows a method to be chosen to interpret or render the data. Includes mime type parameters such as charset where appropriate.\n- `putOTNotes/fileAttachment/contentType`: Identifies the type of content contained in the attachment and how it should be interpreted.",
        "min": 1
      },
      {
        "id": "DocumentReference.content.attachment.language",
        "path": "DocumentReference.content.attachment.language",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/language`: Human language of the attachment content.\n- `putComposition/composition/section/content/other/extension/fileAttachment/language`: Human language of the attachment content.\n- `putDischargeSummary/fileAttachment/language`: Human language of the attachment content.\n- `putEDNotes/fileAttachment/language`: Human language of the attachment content.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/language`: Human language of the attachment content.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/language`: The human language of the content. The value can be any valid value according to BCP 47.\n- `putOTNotes/fileAttachment/language`: Human language of the attachment content."
      },
      {
        "id": "DocumentReference.content.attachment.data",
        "path": "DocumentReference.content.attachment.data",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/data`: Base64 encoded attachment content.\n- `putComposition/composition/section/content/other/extension/fileAttachment/file`: Actual attachment content represented as a sequence of bytes encoded in base64.\n- `putDischargeSummary/fileAttachment/file`: Actual content of the attachment represented as a sequence of bytes.\n- `putEDNotes/fileAttachment/file`: Actual attachment content represented as base64 encoded bytes.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/data`: Actual attachment data represented using base64 encoding.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/data`: The actual data of the attachment - a sequence of bytes. In XML, represented using base64.\n- `putOTNotes/fileAttachment/data`: Actual content of the attachment represented as a sequence of bytes encoded in base64.",
        "min": 1
      },
      {
        "id": "DocumentReference.content.attachment.url",
        "path": "DocumentReference.content.attachment.url",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.size",
        "path": "DocumentReference.content.attachment.size",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/size`: Number of bytes in the attachment.\n- `putComposition/composition/section/content/other/extension/fileAttachment/size`: Number of bytes that make up the attachment.\n- `putDischargeSummary/fileAttachment/size`: Number of bytes contained in the attachment.\n- `putEDNotes/fileAttachment/size`: Number of bytes contained in the attachment.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/size`: Number of bytes in the attachment.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/size`: The number of bytes of data that make up this attachment.\n- `putOTNotes/fileAttachment/size`: Number of bytes contained within the attachment."
      },
      {
        "id": "DocumentReference.content.attachment.hash",
        "path": "DocumentReference.content.attachment.hash",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.title",
        "path": "DocumentReference.content.attachment.title",
        "definition": "Carries these NEHR XML elements:\n\n- `putCardiology/fileAttachment/title`: Display title of the attachment.\n- `putComposition/composition/section/content/other/extension/fileAttachment/title`: Label or display title associated with the attachment.\n- `putDischargeSummary/fileAttachment/title`: Label or title displayed for the attachment.\n- `putOTNotes/content/Composition/section/entry/DiagnosticReport/presentedForm/title`: Display label for the attachment.\n- `putOTNotes/content/Composition/section/entry/Procedure/report/presentedForm/title`: A label or set of text to display in place of the data.\n- `putOTNotes/fileAttachment/title`: Label or title used to display the attachment."
      },
      {
        "id": "DocumentReference.content.attachment.height",
        "path": "DocumentReference.content.attachment.height",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.width",
        "path": "DocumentReference.content.attachment.width",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.frames",
        "path": "DocumentReference.content.attachment.frames",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.duration",
        "path": "DocumentReference.content.attachment.duration",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.attachment.pages",
        "path": "DocumentReference.content.attachment.pages",
        "max": "0"
      },
      {
        "id": "DocumentReference.content.profile",
        "path": "DocumentReference.content.profile",
        "max": "0"
      }
    ]
  }
}