> ## Documentation Index
> Fetch the complete documentation index at: https://docs.rxscale.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Wartezimmer

> Wartezimmer-Registrierungen über die Management API verwalten

# Wartezimmer

Registrieren Sie Patienten für das virtuelle Wartezimmer, prüfen Sie deren Warteschlangenstatus und stornieren Sie Registrierungen.

## Patient registrieren

Registrieren Sie einen Patienten für das Wartezimmer in einem bestimmten Shop.

```bash theme={null}
POST /v1/management/waiting-room/register
```

**Erforderliche Berechtigung:** `waiting_room:write`

### Anfragekörper

```json theme={null}
{
  "shop_uid": "shop-abc123",
  "patient_profile_uid": "pp-xyz789",
  "preferred_doctor_uid": "doc-456",
  "visit_reason": "Follow-up consultation"
}
```

| Feld                   | Typ    | Erforderlich | Beschreibung                                   |
| ---------------------- | ------ | ------------ | ---------------------------------------------- |
| `shop_uid`             | string | Ja           | Shop-UID, bei dem sich der Patient registriert |
| `patient_profile_uid`  | string | Ja           | Patientenprofil-UID                            |
| `preferred_doctor_uid` | string | Nein         | Bevorzugte Arzt-UID                            |
| `visit_reason`         | string | Nein         | Grund des Besuchs                              |

### Beispielanfrage

```bash theme={null}
curl -X POST "https://api.rxscale.com/v1/management/waiting-room/register" \
  -H "X-API-Key: your-api-key-here" \
  -H "Content-Type: application/json" \
  -d '{
    "shop_uid": "shop-abc123",
    "patient_profile_uid": "pp-xyz789",
    "preferred_doctor_uid": "doc-456",
    "visit_reason": "Follow-up consultation"
  }'
```

### Antwort (201 Created)

```json theme={null}
{
  "queue_uid": "q-abc123",
  "position": 3,
  "estimated_wait_minutes": 15
}
```

## Warteschlangenstatus prüfen

Rufen Sie den aktuellen Status eines Warteschlangeneintrags ab, einschließlich Position und geschätzter Wartezeit.

```bash theme={null}
GET /v1/management/waiting-room/{queue_uid}/status
```

<ParamField path="queue_uid" type="string" required>
  Die Warteschlangeneintrag-UID
</ParamField>

**Erforderliche Berechtigung:** `waiting_room:read`

### Beispielanfrage

```bash theme={null}
curl -X GET "https://api.rxscale.com/v1/management/waiting-room/q-abc123/status" \
  -H "X-API-Key: your-api-key-here"
```

### Antwort

```json theme={null}
{
  "queue_uid": "q-abc123",
  "status": "waiting",
  "position": 2,
  "estimated_wait_minutes": 10,
  "video_room_id": null,
  "allocated_at": null
}
```

### Statuswerte

| Status      | Beschreibung                        |
| ----------- | ----------------------------------- |
| `waiting`   | Patient wartet in der Warteschlange |
| `allocated` | Patient wurde einem Arzt zugewiesen |
| `completed` | Konsultation wurde abgeschlossen    |
| `cancelled` | Registrierung wurde storniert       |

Wenn ein Patient zugewiesen wurde, werden `video_room_id` und `allocated_at` befüllt.

## Registrierung stornieren

Stornieren Sie eine Warteschlangenregistrierung.

```bash theme={null}
DELETE /v1/management/waiting-room/{queue_uid}
```

<ParamField path="queue_uid" type="string" required>
  Die zu stornierende Warteschlangeneintrag-UID
</ParamField>

**Erforderliche Berechtigung:** `waiting_room:write`

### Beispielanfrage

```bash theme={null}
curl -X DELETE "https://api.rxscale.com/v1/management/waiting-room/q-abc123" \
  -H "X-API-Key: your-api-key-here"
```

### Antwort

```json theme={null}
{
  "message": "Registration cancelled"
}
```
