# Publish Referral Document Version

> Perform Publish Referral Document Version through GenHealth.

Source: [https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_publish_referral_document_version](https://genhealth.ai/docs/workflows/integrations/gen-health/genhealth_publish_referral_document_version)

Integration: [GenHealth](https://genhealth.ai/docs/workflows/integrations/gen-health.md)

- Handler: `genhealth_publish_referral_document_version`

## Inputs

- `referral_id` — Referral Id (expression, required)
  Required literal value or workflow expression.
- `document_id` — Document Id (expression, required)
  Required literal value or workflow expression.
- `document_version_id` — Document Version Id (expression)
  Optional literal value or workflow expression.
- `category` — Category (select, required)
  Required selected identifier or value.
  Options: Sleep Study ("sleep_study"), Clinical Note ("clinical_note"), Supporting Document ("supporting_document")
- `source_system` — Source System (text, required)
  Required text value.
- `idempotency_key` — Idempotency Key (expression)
  Optional literal value or workflow expression.

## Outputs

- `success` — Success
- `status` — Status
- `referral_id` — Referral Id
- `state_version` — State Version
- `document_id` — Document Id
- `document_version_id` — Document Version Id
- `category` — Category
- `source_system` — Source System
- `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": [
    "referral_id",
    "document_id",
    "category",
    "source_system"
  ],
  "properties": {
    "category": {
      "enum": [
        "sleep_study",
        "clinical_note",
        "supporting_document"
      ],
      "type": "string",
      "description": "Required selected identifier or value.",
      "x-workflow-field-type": "select"
    },
    "document_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "referral_id": {
      "description": "Required literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "source_system": {
      "type": "string",
      "description": "Required text value.",
      "x-workflow-field-type": "text"
    },
    "idempotency_key": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    },
    "document_version_id": {
      "description": "Optional literal value or workflow expression.",
      "x-workflow-field-type": "expression"
    }
  },
  "additionalProperties": false
}
```

### Output schema

```json
{
  "type": "object",
  "properties": {
    "error": {},
    "status": {},
    "success": {},
    "category": {},
    "document_id": {},
    "referral_id": {},
    "source_system": {},
    "state_version": {},
    "document_version_id": {}
  },
  "additionalProperties": true
}
```
