---
title: "Edit an order. Any schedule field that changes re-materializes future occurrences (ITE-701)."
method: PUT
path: "/hospitalstays/{id}/orders/{orderId}"
tags: ["HospitalStays"]
---

# Edit an order. Any schedule field that changes re-materializes future occurrences (ITE-701).

`PUT /hospitalstays/{id}/orders/{orderId}`

## Request

- Base URL: `https://api.clinicos.vet/backend/business`
- URL: `https://api.clinicos.vet/backend/business/hospitalstays/{id}/orders/{orderId}`
- Auth: HTTP bearer
- TypeScript: <https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/docs/hospitalstays/:id/orders/:orderId/put.ts> (a function with typed inputs; its response is checked against the schema)

## Path parameters

- `id` string, required
- `orderId` string, required

## Request body

- UpdateTreatmentOrderRequest: Edit an order — `Partial` of the create request, as the mirror has it. Omitted fields are left alone. Any schedule field that changes is what makes the scheduling engine (ITE-701) re-materialize future pending occurrences.
  - `kind` 'medication' | 'fluid' | 'diagnostic' | 'monitoring' | 'procedure' | 'nursing' | 'nutrition' | 'communication' | 'task': What kind of thing a treatment order is. Mirrors the prototype's `TreatmentOrderKind` so the web mirror can map one-to-one.
  - `title` string, nullable
  - `subtitle` string, nullable
  - `priority` 'routine' | 'important' | 'critical': Clinical urgency of an order. Distinct from Priority, which is a task concept.
  - `scheduleType` 'once' | 'interval' | 'times' | 'continuous' | 'prn': How an order recurs. The occurrence rows themselves are materialized by the scheduling engine (ITE-701); this enum is only the declaration of intent.
  - `scheduleLabel` string, nullable
  - `intervalMinutes` union
    - integer
    - string, int32
  - `startAt` string, date-time, nullable
  - `endAt` string, date-time, nullable
  - `times` string[], nullable
  - `maxOccurrences` union
    - integer
    - string, int32
  - `medication` TreatmentMedicationDetailsDto: Medication dosing detail. Every field optional — see the entity's landmine note.
    - `drug` string, nullable
    - `dose` union
      - number, double
      - string, double
    - `doseUnit` string, nullable
    - `calculatedDose` union
      - number, double
      - string, double
    - `calculatedDoseUnit` string, nullable
    - `concentration` union
      - number, double
      - string, double
    - `concentrationUnit` string, nullable
    - `calculatedVolumeMl` union
      - number, double
      - string, double
    - `route` string, nullable
    - `maxDose` union
      - number, double
      - string, double
  - `fluid` TreatmentFluidDetailsDto: Fluid-therapy detail. Every field optional — see the entity's landmine note.
    - `fluid` string, nullable
    - `rateMlHr` union
      - number, double
      - string, double
    - `bolusMlKg` union
      - number, double
      - string, double
    - `calculatedBolusMl` union
      - number, double
      - string, double
    - `additives` string[], nullable
  - `instructions` string, nullable
  - `resultUnit` string, nullable
  - `serviceCatalogItemId` string, nullable
  - `inventoryItemId` string, nullable
  - `billableItemId` string, nullable

## Response `200`

OK

- TreatmentOrderDto: One standing instruction on the sheet. Schedule fields are flat on the order, as the mirror has them. List&lt;TreatmentOccurrenceDto&gt; TreatmentOrderDto.Occurrences are the slots the scheduling engine has materialized so far (ITE-701); an order with an empty list is declared but not yet scheduled.
  - `id` string
  - `stayId` string
  - `kind` 'medication' | 'fluid' | 'diagnostic' | 'monitoring' | 'procedure' | 'nursing' | 'nutrition' | 'communication' | 'task': What kind of thing a treatment order is. Mirrors the prototype's `TreatmentOrderKind` so the web mirror can map one-to-one.
  - `title` string
  - `subtitle` string, nullable
  - `state` 'active' | 'held' | 'discontinued' | 'completed': Workflow state of an order. Completed is reached when the schedule runs out (or every occurrence is resolved); Discontinued is a clinician stopping it early. Both are terminal — an order is never hard-deleted, so the audit trail survives.
  - `priority` 'routine' | 'important' | 'critical': Clinical urgency of an order. Distinct from Priority, which is a task concept.
  - `scheduleType` 'once' | 'interval' | 'times' | 'continuous' | 'prn': How an order recurs. The occurrence rows themselves are materialized by the scheduling engine (ITE-701); this enum is only the declaration of intent.
  - `scheduleLabel` string, nullable
  - `intervalMinutes` union
    - integer
    - string, int32
  - `startAt` string, date-time, nullable
  - `endAt` string, date-time, nullable
  - `times` string[]: Explicit due times for `times` schedules, stored exactly as the client sent them.
  - `maxOccurrences` union
    - integer
    - string, int32
  - `medication` TreatmentMedicationDetailsDto: Medication dosing detail. Every field optional — see the entity's landmine note.
    - `drug` string, nullable
    - `dose` union
      - number, double
      - string, double
    - `doseUnit` string, nullable
    - `calculatedDose` union
      - number, double
      - string, double
    - `calculatedDoseUnit` string, nullable
    - `concentration` union
      - number, double
      - string, double
    - `concentrationUnit` string, nullable
    - `calculatedVolumeMl` union
      - number, double
      - string, double
    - `route` string, nullable
    - `maxDose` union
      - number, double
      - string, double
  - `fluid` TreatmentFluidDetailsDto: Fluid-therapy detail. Every field optional — see the entity's landmine note.
    - `fluid` string, nullable
    - `rateMlHr` union
      - number, double
      - string, double
    - `bolusMlKg` union
      - number, double
      - string, double
    - `calculatedBolusMl` union
      - number, double
      - string, double
    - `additives` string[], nullable
  - `instructions` string, nullable
  - `resultUnit` string, nullable
  - `serviceCatalogItemId` string, nullable
  - `inventoryItemId` string, nullable
  - `billableItemId` string, nullable
  - `createdBy` string: Display name of the author; falls back to the user id, never null.
  - `createdById` string, nullable
  - `createdAt` string, date-time
  - `updatedAt` string, date-time
  - `heldAt` string, date-time, nullable
  - `discontinuedAt` string, date-time, nullable
  - `completedAt` string, date-time, nullable
  - `occurrences` TreatmentOccurrenceDto[]
    - `id` string
    - `orderId` string
    - `dueAt` string, date-time
    - `status` 'pending' | 'completed' | 'skipped' | 'held': State of one scheduled slot of an order.
    - `kind` 'clinical' | 'billing': What an occurrence row stands for. The Now view, the care board and the awareness engine only ever look at TreatmentOccurrenceKind.Clinical rows; TreatmentOccurrenceKind.Billing rows are the daily charge cadence for continuous orders (ITE-735) and must never surface as nursing work.
    - `completedAt` string, date-time, nullable
    - `completedById` string, nullable
    - `completedBy` string, nullable
    - `actualValue` string, nullable
    - `note` string, nullable
    - `skippedReason` string, nullable
    - `heldAt` string, date-time, nullable
    - `occurrenceKey` string
    - `estimateLineItemId` string, nullable: The estimate line this completion was charged as (ITE-703); null when nothing was captured.
  - `events` TreatmentOrderEventDto[]: The append-only audit trail, oldest first.
    - `id` string
    - `orderId` string
    - `occurrenceId` string, nullable
    - `action` 'created' | 'edited' | 'completed' | 'skipped' | 'held' | 'resumed' | 'discontinued' | 'delayed' | 'charge_captured' | 'charge_capture_failed': Append-only audit actions on the treatment-order trail, mirroring MedicationRequestEventType for the medication-request trail.
    - `at` string, date-time
    - `actor` string
    - `actorUserId` string, nullable
    - `detail` string, nullable

## Other responses

- `400`: Bad Request
- `404`: Not Found
- `409`: Conflict

## Changes

- **2026-09-11** `503cd0546309`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/changes/hospitalstays/:id/orders/:orderId/put.md)

---

[API](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1.md) - [All operations](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/llms.txt) - [OpenAPI document](https://skmtc.dev/clinicos/apis/pawthosx-business-api-v1/revisions/099cf36186e0?raw)
