@welshare/sdk
    Preparing search index...

    Variable DocumentReferenceContentSchemaConst

    DocumentReferenceContentSchema: ZodObject<
        {
            attachment: ZodObject<
                {
                    contentType: ZodOptional<ZodString>;
                    creation: ZodOptional<ZodISODateTime>;
                    data: ZodOptional<ZodString>;
                    duration: ZodOptional<ZodNumber>;
                    frames: ZodOptional<ZodNumber>;
                    hash: ZodOptional<ZodString>;
                    height: ZodOptional<ZodNumber>;
                    id: ZodOptional<ZodString>;
                    language: ZodOptional<ZodString>;
                    pages: ZodOptional<ZodNumber>;
                    size: ZodOptional<ZodNumber>;
                    title: ZodOptional<ZodString>;
                    url: ZodOptional<ZodURL>;
                    width: ZodOptional<ZodNumber>;
                },
                $strip,
            >;
            profile: ZodOptional<
                ZodArray<
                    ZodUnion<
                        readonly [
                            ZodObject<
                                {
                                    valueCoding: ZodObject<
                                        {
                                            code: ZodOptional<(...)>;
                                            display: ZodOptional<(...)>;
                                            system: ZodURL;
                                            userSelected: ZodOptional<(...)>;
                                            version: ZodOptional<(...)>;
                                        },
                                        $strip,
                                    >;
                                },
                                $strip,
                            >,
                            ZodObject<{ valueUri: ZodString }, $strip>,
                        ],
                    >,
                >,
            >;
        },
        $strip,
    > = ...

    Content element for DocumentReference - links to the actual binary content.

    The architecture adds DocumentReference as a metadata layer without modifying Binary:

    DocumentReference                    BinaryFileSchema (unchanged)
    ├── type (LOINC) ├── file_type (MIME/contentType)
    ├── subject ├── controller_did
    └── content[].attachment.url ────────┤
    = "binary/{_id}" ├── url (welshare://) ← internal storage URL
    └── reference (existing, for questionnaire attachments)
    1. DocumentReference → Binary: Use makeBinaryReference to create references:

      • makeBinaryReference(binaryId).reference"binary/{id}"
      • This reference is stored in content[].attachment.url
    2. Binary → S3: Binary resource's url field points to actual content:

      • url = "welshare://{key}" (internal, for content retrieval)
    3. Binary.reference (deprecated, backwards compatibility): Used for questionnaire field references

    ../../lib/fhir.ts#makeBinaryReference for creating binary references