# Check Patient Document Exists

> Perform Check Patient Document Exists through NikoHealth.

Source: [https://genhealth.ai/docs/workflows/integrations/nikohealth/nikohealth_check_patient_document_exists](https://genhealth.ai/docs/workflows/integrations/nikohealth/nikohealth_check_patient_document_exists)

Integration: [NikoHealth](https://genhealth.ai/docs/workflows/integrations/nikohealth.md)

- Handler: `nikohealth_check_patient_document_exists`

- Connection type: `nikohealth`

## Inputs

- `patient_id` — Patient Id (expression, required)
  Required literal value or workflow expression.
- `document_type` — Document Type (expression, required)
  Required literal value or workflow expression.
- `filename_prefix` — Filename Prefix (expression, required)
  Required literal value or workflow expression.
- `include_previous_versions` — Include Previous Versions (boolean)
  Optional true-or-false value.
  Default: `true`
- `pseudonymized_filename_template` — Pseudonymized Filename Template (expression)
  Optional literal value or workflow expression.
- `pseudonymization_purpose` — Pseudonymization Purpose (expression)
  Optional literal value or workflow expression.

## Outputs

- `success` — Success
- `status` — Status
- `found` — Found
- `matched_document_id` — Matched Document Id
- `matched_format` — Matched Format
- `matched_legacy_format` — Matched Legacy Format
- `error` — Error

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_type",
    "filename_prefix"
  ],
  "properties": {
    "patient_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_type": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "filename_prefix": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "pseudonymization_purpose": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "include_previous_versions": {
      "type": "boolean",
      "default": true,
      "description": "Optional true-or-false value.",
      "x-workflow-field-type": "boolean"
    },
    "pseudonymized_filename_template": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "found": {},
    "status": {},
    "success": {},
    "matched_format": {},
    "matched_document_id": {},
    "matched_legacy_format": {}
  },
  "additionalProperties": true
}
```
