# Check Patient Exists

> Match the extracted patient on an organization-owned document using the configured Brightree strategy. Requires extracted demographics and a strategy supporting patient search. Check success before exists: exists=null means unknown, not an absent patient. Create only when ready_for_patient_create=true. patient_id is a local GenHealth ID; patient_key identifies Brightree. Missing demographics or ambiguous matches require review. A returned error can fail the node; use an explicit fail_branch error route when review is required.

Source: [https://genhealth.ai/docs/workflows/integrations/brightree/brightree_check_patient_exists](https://genhealth.ai/docs/workflows/integrations/brightree/brightree_check_patient_exists)

Integration: [Brightree](https://genhealth.ai/docs/workflows/integrations/brightree.md)

- Handler: `brightree_check_patient_exists`

- Connection type: `brightree`

## 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": "Brightree",
  "params": {
    "force": false
  },
  "handler": "brightree_check_patient_exists"
}

```

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

## Inputs

- `document_id` — Document Id (expression)
  Organization-owned GenHealth document UUID with extracted patient demographics. Set this explicitly in params when authoring an independent workflow.
- `force` — Force (boolean)
  Re-run the configured match check rather than reuse a previously recorded result. Default false.
  Default: `false`

## Outputs

- `success` — Success
- `document_id` — Document Id
- `patient_id` — Patient Id
- `patient_name` — Patient Name
- `birth_date` — Birth Date
- `exists` — Exists
- `ready_for_patient_create` — Ready For Patient Create
- `external_id` — External Id
- `patient_key` — Patient Key
- `patient_url` — Patient Url
- `status` — Status
- `error_message` — Error Message

Output schema completeness: `reviewed_partial`

## 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",
  "properties": {
    "force": {
      "type": "boolean",
      "default": false,
      "description": "Re-run the configured match check rather than reuse a previously recorded result. Default false.",
      "x-workflow-field-type": "boolean"
    },
    "document_id": {
      "description": "Organization-owned GenHealth document UUID with extracted patient demographics. Set this explicitly in params when authoring an independent workflow.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "exists": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "status": {},
    "success": {
      "type": [
        "boolean",
        "null"
      ]
    },
    "birth_date": {},
    "patient_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Local GenHealth patient ID, not a Brightree key."
    },
    "document_id": {},
    "external_id": {},
    "patient_key": {
      "type": [
        "integer",
        "string",
        "null"
      ],
      "description": "Brightree patient key; use only after success and an existing match."
    },
    "patient_url": {},
    "patient_name": {},
    "error_message": {
      "type": [
        "string",
        "null"
      ]
    },
    "ready_for_patient_create": {
      "type": "boolean"
    }
  },
  "additionalProperties": true
}
```
