{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/optum/json-schema/optum-document-reference-response-schema.json",
  "title": "DocumentReferenceResponse",
  "description": "FHIR Bundle containing DocumentReference search results",
  "x-generated": "2026-11-09",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/optum-document-reference-api-openapi.yml#/components/schemas/DocumentReferenceResponse",
  "type": "object",
  "properties": {
    "resourceType": {
      "type": "string"
    },
    "id": {
      "type": "string"
    },
    "meta": {
      "$ref": "#/$defs/Meta"
    },
    "type": {
      "type": "string"
    },
    "total": {
      "type": "integer"
    },
    "entry": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/DocumentEntry"
      }
    }
  },
  "$defs": {
    "Attachment": {
      "type": "object",
      "description": "Attachment content details",
      "properties": {
        "contentType": {
          "type": "string"
        },
        "creation": {
          "type": "string"
        },
        "data": {
          "type": "string"
        },
        "url": {
          "type": "string"
        },
        "title": {
          "type": "string"
        }
      }
    },
    "Content": {
      "type": "object",
      "properties": {
        "attachment": {
          "$ref": "#/$defs/Attachment"
        }
      }
    },
    "DocumentEntry": {
      "type": "object",
      "description": "Bundle entry containing DocumentReference",
      "properties": {
        "resource": {
          "$ref": "#/$defs/DocumentReference"
        }
      }
    },
    "DocumentReference": {
      "type": "object",
      "description": "FHIR DocumentReference used inside attachment",
      "properties": {
        "resourceType": {
          "type": "string"
        },
        "id": {
          "type": "string"
        },
        "status": {
          "type": "string"
        },
        "date": {
          "type": "string"
        },
        "content": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/Content"
          }
        }
      }
    },
    "Meta": {
      "type": "object",
      "description": "FHIR metadata",
      "properties": {
        "profile": {
          "type": "array",
          "description": "FHIR profile URLs",
          "items": {
            "type": "string"
          }
        }
      }
    }
  }
}