medOS ultra

HDR Brachytherapy Delivery Console

HDR brachytherapy delivery console mini-app.

14 min read diagramsUpdated 2026-05-07docs/architecture/medos-rt-brachy-1-delivery-console.md
Field Value
Spec ID medOS-RT-BRACHY-1
Status Draft v0.1
Module medOS · Radiation Oncology
Companion specs medOS-RT-DDC-1 (EBRT), medOS-RT-IGRT-1, medOS-RT-PlanCockpit
Targets Vajira HDR Co-60 brachytherapy suite (per TOR ภาควิชารังสีวิทยา 2567)
Primary user Radiation Therapist + Brachytherapy Nurse + Medical Physicist (in-room team)
Date 2026-05-07

1. Purpose & scope

medOS-RT-BRACHY-1 specifies the Brachytherapy Delivery Console — the kiosk that runs a HDR (High Dose Rate) intracavitary / interstitial / intraluminal brachytherapy fraction. It is the brachy counterpart to medOS-RT-DDC-1 (which covers external-beam linac delivery). The two consoles share design DNA but differ in physics, hardware, and risk model.

The most consequential gated decision in this mini-app is source release — the moment the afterloader is commanded to drive the Co-60 source out of the safe and into the patient’s catheters. Three failure modes the design prevents are: (a) wrong-applicator delivery (e.g. plan was for Fletcher T&O but patient has Venezia inserted), (b) channel-mapping error (transfer-tube-to-catheter swap → dose deposited in the wrong anatomy), © source-stuck-in-patient emergency (mechanical failure during retraction).

Scope: pre-delivery applicator-position verification, channel/transfer-tube mapping, source-activity decay correction, dwell-position calibration check, intercom + CCTV live confirmation, source release, real-time dwell progression, retract verification, post-delivery applicator removal log.

Out of scope (separate workflows): treatment planning (handled by 3D-TPS workspace), applicator insertion under anesthesia (separate OR-style mini-app), source change-out QA (separate annual-QA mini-app).

2. Clinical context

Brachytherapy is the highest-dose-rate, highest-precision-margin modality in radiation oncology. A single HDR fraction can deliver 6–8 Gy to the HR-CTV in 5–15 minutes of source-out time. Compared to EBRT, brachy fractions are fewer (3–5 typically) but each carries higher consequences: an applicator displacement of 5 mm changes D90 to HR-CTV by 10–15%, and rectal D2cc by 20–30%.

The Vajira procurement TOR (ครุภัณฑ์ 2567) specifies a Co-60 afterloader replacing a 13-year-old Multisource HDR Afterload, supporting:

  • ≥20 channels, source-transfer rated ≥100,000 cycles
  • Position accuracy ±2 mm (premium ±1 mm)
  • Auto-retract on door open, time-up, power loss, emergency stop
  • Battery backup + manual hand-wheel for emergency retraction
  • Applicator library: Fletcher CT/MR, Henschke, M.A.C. interstitial GYN, Endometrium 2/3-channel, Vaginal cylinder, Geneva, Venezia, Fletcher Williamson, Rotte
  • 3D-TPS with TG-43/HEBD dose calc, image fusion (CT/MR), inverse planning (HIPO)
  • Treatment sites: cervix, uterus, vagina, rectum, nasopharynx, breast, esophagus

Vajira treats ~200 cervical brachy patients/year (~800 fractions). This console is the per-fraction delivery surface for that throughput.

3. User personas

RTT + Brachy Nurse (vault team). Two-person workflow: RTT runs the console; nurse confirms patient position and applicator geometry. Both must be in the room until source is released, then both exit before pressing DELIVER. After delivery, both re-enter to remove the applicator.

Medical Physicist (room presence required). For HDR brachy, AAPM/IAEA recommend physicist presence at every fraction. Physicist confirms: source activity calibration, channel-to-applicator mapping, dwell-time pre-calc, treatment-plan version pin. Physicist co-sign required before source release (unlike EBRT where physicist co-sign is optional/deferred).

Radiation Oncologist. Performs applicator insertion (typically under sedation in OR-adjacent suite), reviews CT/MR for applicator position, approves the plan, leaves the room before release. Returns post-delivery if applicator removal under sedation is needed.

4. Workflow state machine

stateDiagram-v2
    [*] --> ApplicatorInserted : RO inserts under sedation
    ApplicatorInserted --> ImagingAcquired : CT/MR scan with applicator in situ
    ImagingAcquired --> PlanGenerated : TPS contour + optimize
    PlanGenerated --> PlanApproved : RO + Physicist co-approve
    PlanApproved --> ConsoleOpen : Patient transferred to brachy suite
    ConsoleOpen --> IdentityChecking
    IdentityChecking --> ApplicatorVerifying
    ApplicatorVerifying --> ChannelMapping
    ChannelMapping --> SourceQA
    SourceQA --> InterlocksChecking
    InterlocksChecking --> RoomCleared : All staff exit, intercom + CCTV active
    RoomCleared --> Ready
    Ready --> SourceOut : RTT taps RELEASE
    SourceOut --> DwellPosition1 : First dwell active
    DwellPosition1 --> DwellPositionN : Sequential progression
    DwellPositionN --> SourceRetracting : All dwells complete
    DwellPositionN --> EmergencyRetract : Door open / E-stop / out-of-tol
    EmergencyRetract --> SourceSafe
    SourceRetracting --> SourceSafe
    SourceSafe --> ApplicatorRemoval : Team re-enters
    ApplicatorRemoval --> [*] : Documentation complete

5. Data model

brachy_fraction_delivery
  id                          uuid PK
  treatment_plan_id           uuid FK
  plan_version_id             uuid FK
  fraction_number             integer
  insertion_session_id        uuid FK   -- the OR-side procedure that placed applicator
  applicator_type             enum (fletcher | henschke | venezia | mac-interstitial | endometrium | vaginal-cylinder | rotte | custom)
  applicator_serial           string    -- physical serial for sterilization tracking
  channel_count_planned       integer
  channels_active             integer
  source_activity_at_release  numeric   -- GBq, decay-corrected
  source_install_date         date
  source_install_activity_GBq numeric   -- 74.0 ± 10% per TOR
  scheduled_total_dwell_sec   numeric
  delivered_total_dwell_sec   numeric
  scheduled_dose_HR_CTV_Gy    numeric   -- per-fraction HR-CTV dose
  delivered_dose_HR_CTV_Gy    numeric
  oar_dose_rectum_D2cc_Gy     numeric
  oar_dose_bladder_D2cc_Gy    numeric
  oar_dose_sigmoid_D2cc_Gy    numeric
  oar_dose_bowel_D2cc_Gy      numeric
  identity_match              jsonb
  applicator_verification     jsonb     -- {position_imaging_id, channel_map: [{ch:1, app_path:'tandem-tip'}, ...], no_kinks, no_blockage}
  source_qa                   jsonb     -- {last_calibration, decay_correct_factor, position_test_passed}
  intercom_state              enum (active | failed)
  cctv_state                  enum (active | failed)
  rtt_id                      uuid FK
  brachy_nurse_id             uuid FK
  physicist_id                uuid FK   -- non-null at all times for brachy
  ro_id                       uuid FK
  emergency_retract_event     jsonb     -- if state was EmergencyRetract
  abort_reason                text
  applicator_removed_ts       timestamptz
  source_in_safe_confirmed_ts timestamptz
  next_fraction_planned_ts    timestamptz
  rt_record_uid               dicom-uid -- DICOM RT BTR pulled from afterloader
  reconciliation_state        enum (pending | matched | deviation)
  created_ts                  timestamptz

Sub-entity:

dwell_position_delivery
  id                          uuid PK
  brachy_fraction_delivery_id uuid FK
  channel_number              integer   -- 1..20 per TOR
  dwell_index                 integer   -- ordinal within channel
  applicator_path_label       string    -- "tandem", "ovoid-left", "ovoid-right", "needle-1", etc.
  dwell_time_planned_sec      numeric
  dwell_time_delivered_sec    numeric
  dwell_position_mm           numeric   -- distance from indexer
  dose_at_dwell_Gy            numeric
  state                       enum (pending | active | complete | aborted)
  start_ts                    timestamptz
  end_ts                      timestamptz

6. UX shell — kiosk layout

Five pre-flight gates row, big release panel center, channel-by-channel dwell visualization right, post-delivery applicator-removal flow surfaces in place when source is safe.

┌────────────────────────────────────────────────────────────────────────────────┐
│  patient strip · plan (pinned v3) · BRACHY FRACTION 3 OF 4 · session timer      │
├────────────────────────────────────────────────────────────────────────────────┤
│  ID MATCH      APPLICATOR     CHANNEL MAP    SOURCE QA     SUITE READY          │
│  [photo + ]    [Fletcher T&O] [3 of 3 ✓]     [73.2 GBq ]   [door ✓ intercom ]  │
│  [biometric]   [pos imaging✓] [no kinks ]    [decay 0.989] [CCTV ✓ E-stop ✓]   │
│  [HN ✓     ]   [serial ✓]    [no blocks]     [pos test ±1] [room cleared ✓ ]   │
├──────────────────────────────────────────┬─────────────────────────────────────┤
│                                          │  PLAN DETAIL · v3 LOCKED            │
│   READY TO RELEASE SOURCE · FRACTION 3   │  Applicator: Fletcher CT/MR T&O     │
│                                          │  Source: Co-60  73.2 GBq today      │
│   Today's HR-CTV dose    7.0 Gy          │  Channels: 3 (tandem + 2 ovoids)    │
│   Total dwell time       8:42            │  Total dwell points: 24             │
│   Source activity        73.2 GBq        │                                     │
│   Cumulative HR-CTV      21.0 → 28.0 Gy  │  ── OAR Constraints ──              │
│                                          │  Rectum D2cc  ≤ 4.0 Gy              │
│   ╔══════════════════════════════════╗   │   today: 3.6 Gy ✓                   │
│   ║  ▶  RELEASE SOURCE · BEAM ON     ║   │  Bladder D2cc ≤ 4.5 Gy              │
│   ╚══════════════════════════════════╝   │   today: 3.9 Gy ✓                   │
│                                          │  Sigmoid D2cc ≤ 4.0 Gy              │
│   [ HOLD ]  [ EMERGENCY RETRACT ]        │   today: 2.8 Gy ✓                   │
│                                          │                                     │
│   Press RELEASE and exit to control      │  ── Approved ──                     │
│   room. Source is live until retract     │  ผศ. นพ. ธีรพันธ์  · 7 พ.ค. 08:30   │
│   is confirmed.                          │  ดร. อภิวัฒน์ (physics) · 08:42     │
├──────────────────────────────────────────┴─────────────────────────────────────┤
│   plan event stream · this session                                              │
└────────────────────────────────────────────────────────────────────────────────┘

7. Five pre-flight gates (brachy-specific)

Gate What it verifies Why brachy-different
1. Identity Match Same 3-factor as DDC: photo + HN barcode + did:bio liveness Identical to EBRT
2. Applicator Setup Applicator type matches plan, serial number scanned, position imaging (post-insertion CT/MR) reviewed, no kinks/blockages in transfer tubes, applicator firmly seated Replaces “Setup Verified” — fundamentally different (no immobilization mask; the applicator IS the geometry)
3. Channel Map Each transfer tube → physical catheter mapping matches plan, indexer positions confirmed, length checks via auto-probe Unique to brachy: transfer-tube-to-channel swap is a top-3 brachy error mode
4. Source QA Co-60 activity decay-corrected from install date, last calibration date in tolerance, daily position test (±1mm) passed, source not nearing replacement Replaces “IGRT Applied” — no patient image registration, just source-side QA
5. Suite Ready Door interlock closed, intercom active, CCTV showing patient, all staff out of room, emergency stops armed Replaces “Linac Ready” — adds intercom + CCTV + room-cleared (staff cannot remain during release)

Concurrent therapy (chemo/holds) is checked but typically less time-critical for brachy than EBRT — most brachy patients are not on same-day cisplatin. Surfaces in plan-detail panel rather than as its own gate.

8. Source-out execution

On RELEASE press, the panel transitions to source-out view:

┌────────────────────────────────────────────────────────────────────────────┐
│   FRACTION 3 · SOURCE OUT · TOTAL DWELL: 8:42                               │
│                                                                             │
│   Channel 1 · Tandem (24 cm probe)                                         │
│   Dwell pos 4 of 8 · 11.5 cm from indexer                                   │
│                                                                             │
│   ████████████░░░░░░░░░░░░░░░░░░░░     2:18 / 8:42 elapsed                │
│                                                                             │
│   activity: 73.2 GBq    cumulative dwell so far: 138 s                     │
│                                                                             │
│   [ HOLD ]   [ EMERGENCY RETRACT ]                                         │
│                                                                             │
│   Patient on table · CCTV: stable · intercom: clear · door: closed         │
└────────────────────────────────────────────────────────────────────────────┘

Real-time updates from afterloader API: source position (mm from indexer), current channel, current dwell position, dwell-time elapsed at this position. Source moves via stepper motor to each programmed position, dwells for the planned time, then steps to the next. Two channels are sequential, never simultaneous.

Pause = source retracts to safe position, timer pauses. Emergency retract = source returns to safe immediately, fraction marked aborted, partial dose recorded, RO + physics paged. Hold is functionally similar to pause in brachy (both retract source for safety) but hold preserves resume-from-position; emergency-retract aborts the run entirely.

9. Concurrent care integration

Brachy patients are often on:

  • Concurrent chemoRT (cisplatin during EBRT phase, may be paused during brachy week) — surface but rarely gated
  • Anti-anxiety / sedation for applicator tolerance — note dose given, time, sedation team
  • Bowel prep (some protocols require enema before each fraction to reduce rectal D2cc) — confirm “today’s prep complete”
  • Pelvic exam / pain control — note PRN morphine if given
  • Indwelling catheter (for bladder dose minimization) — note presence/volume

These are surfaced read-only; entry happens elsewhere.

10. Pause / abort / emergency retract

Failure Handling
Source stuck during retraction Hand-wheel manual retract (per TOR §4.2.2.6); physicist on-call; RO available; patient’s airway secure if sedated
Door opened during source-out Auto-retract via interlock; fraction state → EmergencyRetracted; partial dose recorded; staff briefing
Power loss Battery backup retracts source (per TOR §4.2.2.5); console reconciles on power return
Source position out of tolerance (>2 mm) Auto-abort, source retract; physicist verifies position test; fraction rescheduled
Applicator displacement during fraction Detected via re-imaging post-fraction (if integrated 4D-CT or surface imaging); fraction valid as delivered, RO reviews next fraction plan
Network partition console ↔ afterloader Afterloader is authority — continues delivering programmed plan, console reconciles via DICOM RT BTR pulled on recovery

The principle: the afterloader is the safety authority during source-out. The console orchestrates and records; it does not control source position in real-time. This means a network outage cannot strand a patient with an exposed source — the afterloader’s onboard logic is autonomous and fail-safe.

11. Post-delivery actions

On all-dwells-complete + source-in-safe-confirmed:

  1. Source-position verification — afterloader’s own readback confirms source returned to safe.
  2. Team re-entry allowed (gate transitions to GREEN); RTT + nurse + RO re-enter for applicator removal.
  3. Applicator removal workflow — separate sub-screen: each channel’s transfer tube disconnected, applicator gently withdrawn, applicator inspected for completeness (no broken tip), patient inspected for bleeding/displacement, applicator wiped and sent to sterilization.
  4. Bleeding / pain check — RTT documents.
  5. DICOM RT-BTR pulled from afterloader; reconciled against scheduled.
  6. Cumulative HR-CTV dose advances; OAR D2cc accumulates.
  7. Next fraction plan — typically 1-week or 2-day interval for cervix; date confirmed.
  8. Patient education — post-brachy bleeding/discharge expected; pad with sanitary pad; pelvic rest 2 weeks; emergency contact info.
  9. Console exits.

12. Event payloads

// Source release
{
  "type": "BrachySourceReleased",
  "fraction_id": "...",
  "applicator_type": "fletcher-ct-mr",
  "channels_active": 3,
  "source_activity_GBq": 73.2,
  "ts": "..."
}

// Dwell complete (one event per dwell)
{
  "type": "DwellPositionDelivered",
  "channel": 1,
  "dwell_index": 4,
  "applicator_path": "tandem",
  "position_mm": 115.0,
  "dwell_time_planned_sec": 18.4,
  "dwell_time_delivered_sec": 18.4,
  "ts": "..."
}

// Source safe
{
  "type": "BrachySourceInSafe",
  "fraction_id": "...",
  "delivered_total_dwell_sec": 522.3,
  "scheduled_total_dwell_sec": 522.0,
  "ts": "..."
}

// Emergency retract
{
  "type": "BrachyEmergencyRetract",
  "fraction_id": "...",
  "trigger": "door-open" | "e-stop" | "out-of-tol" | "manual" | "power-loss",
  "delivered_total_dwell_sec": 156.4,
  "completed_dwells": 8,
  "remaining_dwells": 16,
  "ts": "..."
}

// Applicator removed
{
  "type": "BrachyApplicatorRemoved",
  "fraction_id": "...",
  "applicator_intact": true,
  "patient_bleeding": "minimal",
  "ts": "..."
}

13. Afterloader integration — DICOM and vendor

Inbound from afterloader:

  • Source activity at last calibration (DICOM RT BTR header / vendor API)
  • Dwell-position readback during source-out (vendor stream, 5-10 Hz)
  • Post-fraction RT BeamsTreatmentRecord (DIMSE-C-STORE)
  • Channel-by-channel delivered dwell time

Outbound to afterloader:

  • Plan transfer (DICOM RT Plan with brachy-specific tags) — handled by Plan Lock workflow
  • Treatment release (vendor “treat next fraction”)

Adapter required: medos-co60-afterloader-adapter — needs vendor-specific dialect (each vendor’s afterloader API differs more than linac vendors do; less standardization in brachy).

14. Differences from medOS-RT-DDC-1

Aspect DDC (EBRT) BRACHY
Source External, MV photons Internal, Co-60 source on a wire
Position Beam aimed at patient Source inside patient catheters
Geometry Couch + gantry + MLC Applicator (Fletcher/Venezia/etc.)
Imaging gate IGRT couch shifts Applicator position imaging review
Time 2-4 min beam-on 5-15 min source-out
Staff in room during delivery RTT remains in vault All staff must exit
Physicist Optional co-sign Required, in-room until release
Plan calc Photon dose to volumes TG-43/HEBD source kernels
Per-channel detail Beams 1, 2, … (gantry arcs) Channels 1…20 with dwell positions
Failure cardinal Wrong patient Wrong applicator / channel mapping
Emergency control Beam-off Source retract

15. Bilingual & accessibility

Same as DDC. Default TH at vault kiosk. Brachy-specific Thai terminology:

  • รังสีรักษาระยะใกล้ = brachytherapy
  • การใส่แร่ = applicator insertion / brachy fraction
  • สารต้นกำเนิดรังสี = radiation source
  • ถังเก็บสาร = source safe
  • ดึงกลับ = retract
  • ปุ่มหยุดฉุกเฉิน = emergency stop
  • การควบคุมระยะไกล = remote control (intercom + CCTV)

16. Regulatory & safety

  • Office of Atoms for Peace (สำนักงานปรมาณูเพื่อสันติ) — source import/export tracking, dose reconstruction reports per fraction, weekly source position QA log.
  • Thai FDA / MDA — Class C device software (afterloader-coupled).
  • AAPM TG-43, TG-138, TG-43U1, HEBD-WG — dose-calc reference.
  • AAPM TG-59 — HDR brachy QA.
  • DICOM Conformance: RT Plan (with brachy attributes), RT BTR, RT Dose, RT Structure Set.

17. Performance & failure modes

  • Pre-flight to all-clear: < 8 s (slower than EBRT due to channel-map verification).
  • RELEASE tap to source-out: < 1 s.
  • Dwell-position update latency: ≤ 200 ms (faster than EBRT MU update because dwell position is the physics that matters).
  • Source-retract emergency: ≤ 5 s (afterloader-side guarantee).

18. Open questions for v0.2

  • Real-time MR-guided brachy (MR-LINAC + brachy hybrid) — out of scope.
  • Pediatric brachy — pediatric anesthesia integration; out of scope v0.1.
  • Re-implant scenarios — when an applicator must be reinserted mid-course; protocol-dependent.
  • Source change-out (every ~5 years for Co-60) — separate annual-QA mini-app, this console only consumes the source-activity attribute.
  • Multi-fraction same-day (e.g. cervix HDR with 2 fractions in 24h) — the schedule and OAR-dose-accumulation logic differs from once-weekly cadence; needs config.

19. Implementation notes

  1. Mini-app shell. Renders inside DynamicContentRenderer; enum value RT_BRACHY_DELIVERY_CONSOLE.
  2. State machine in XState; concurrent regions (source telemetry, gates, dwell-position progress).
  3. Afterloader telemetry adapter is a separate package (@medos/afterloader-adapter-{vendor}). Console consumes vendor-agnostic event stream.
  4. Press-and-hold on RELEASE: 800 ms haptic confirm (longer than EBRT’s 600 ms because brachy is higher-consequence).
  5. Audit trail per dwell position; every dwell writes a Provenance resource.
  6. Vault kiosk identical to DDC; same authentication model.
  7. Network partition handled at adapter layer; afterloader is authority during source-out.

End of medOS-RT-BRACHY-1 v0.1

Ask Anything