# Create Patient From Document

> Create or reuse a Brightree patient from an organization-owned document's extracted first name, last name, and birth date. Requires configured Brightree credentials and an organization strategy supporting patient search/create. The action checks for an existing patient before creation. success=true with created=false means an existing patient was reused. patient_id is local; patient_key identifies Brightree. An unverified existing link or ambiguous match requires review. Use fail_branch with an error edge to handle failures. No dry run is declared. After a timeout or uncertain external write, reconcile the Brightree record before retrying; an existence check is not an exactly-once guarantee.

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

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

- Handler: `brightree_create_patient_from_document`

- 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": {},
  "handler": "brightree_create_patient_from_document"
}

```

[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, required)
  Required organization-owned GenHealth document UUID. Its extracted patient must have first_name, last_name, and birth_date before this action runs.

## Outputs

- `success` — Success
- `document_id` — Document Id
- `patient_id` — Patient Id
- `patient_name` — Patient Name
- `birth_date` — Birth Date
- `patient_key` — Patient Key
- `external_id` — External Id
- `created` — Created
- `message` — Message
- `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",
  "required": [
    "document_id"
  ],
  "properties": {
    "document_id": {
      "description": "Required organization-owned GenHealth document UUID. Its extracted patient must have first_name, last_name, and birth_date before this action runs.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "created": {
      "type": "boolean",
      "description": "With success=true, false indicates reuse of an existing patient."
    },
    "message": {},
    "success": {
      "type": "boolean"
    },
    "birth_date": {},
    "patient_id": {
      "type": [
        "string",
        "null"
      ],
      "description": "Local GenHealth patient ID."
    },
    "document_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "external_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "patient_key": {
      "type": [
        "integer",
        "string",
        "null"
      ],
      "description": "Brightree patient key. Check success before using it."
    },
    "patient_name": {},
    "error_message": {
      "type": [
        "string",
        "null"
      ]
    }
  },
  "additionalProperties": true
}
```
