# ECW Download Patient Document

> Perform ECW Download Patient Document through eClinicalWorks.

Source: [https://genhealth.ai/docs/workflows/integrations/eclinicalworks/ecw_download_patient_document](https://genhealth.ai/docs/workflows/integrations/eclinicalworks/ecw_download_patient_document)

Integration: [eClinicalWorks](https://genhealth.ai/docs/workflows/integrations/eclinicalworks.md)

- Handler: `ecw_download_patient_document`

## Use in a workflow

Copy this discovered node config, fill params from the input contract, and validate the complete graph. Integration results are available as {{node_id.default.field}}. Check business success before dependent writes; completion alone does not prove business success.

```json

{
  "_group": "eClinicalWorks",
  "params": {
    "max_ocr_chars": 12000,
    "include_ocr_text": true
  },
  "handler": "ecw_download_patient_document"
}

```

[Action contracts](https://genhealth.ai/docs/workflows/action-contracts.md) · [Run recovery](https://genhealth.ai/docs/workflows/operations.md)

## Inputs

- `patient_id` — Patient Id (text, required)
  Required text value.
- `document_id` — Document Id (text, required)
  Required text value.
- `include_ocr_text` — Include Ocr Text (boolean)
  Optional true-or-false value.
  Default: `true`
- `max_ocr_chars` — Max Ocr Chars (number)
  Optional numeric value.
  Default: `12000`

## Outputs

- `success` — Success
- `document_id` — Document Id
- `filename` — Filename
- `document_name` — Document Name
- `document_date` — Document Date
- `pdf_base64` — Pdf Base64
- `byte_count` — Byte Count
- `page_count` — Page Count
- `ocr_text` — Ocr Text
- `ocr_text_length` — Ocr Text Length
- `error_message` — Error Message

Output schema completeness: `best_effort_declared`

## Safety

- External effect: `write`
- Confirmation recommended: no
- Retry safe: no
- Dry run supported: no

## Schemas

These schemas are first-pass authoring guidance. Runtime validation remains authoritative.

### Input schema

```json
{
  "type": "object",
  "required": [
    "patient_id",
    "document_id"
  ],
  "properties": {
    "patient_id": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "document_id": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "max_ocr_chars": {
      "type": "number",
      "default": 12000,
      "description": "Optional numeric value.",
      "x-workflow-field-type": "number"
    },
    "include_ocr_text": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "success": {},
    "filename": {},
    "ocr_text": {},
    "byte_count": {},
    "page_count": {},
    "pdf_base64": {},
    "document_id": {},
    "document_date": {},
    "document_name": {},
    "error_message": {},
    "ocr_text_length": {}
  },
  "additionalProperties": true
}
```
